enable post view count tracking (for mods initially)
This commit is contained in:
@@ -46,6 +46,14 @@ module PostsHelper
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def post_view_count_js
|
||||||
|
return nil unless Danbooru.config.enable_post_search_counts
|
||||||
|
|
||||||
|
msg = "#{params[:id]},#{session.id}"
|
||||||
|
verifier = ActiveSupport::MessageVerifier.new(Danbooru.config.reportbooru_key, digest: "SHA256").generate(msg)
|
||||||
|
return render("posts/partials/index/view_count", msg: msg)
|
||||||
|
end
|
||||||
|
|
||||||
def common_searches_html(user)
|
def common_searches_html(user)
|
||||||
return nil unless Danbooru.config.enable_post_search_counts
|
return nil unless Danbooru.config.enable_post_search_counts
|
||||||
return nil unless user.is_platinum?
|
return nil unless user.is_platinum?
|
||||||
|
|||||||
9
app/views/posts/partials/show/_view_count.html.erb
Normal file
9
app/views/posts/partials/show/_view_count.html.erb
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<% if CurrentUser.user.is_moderator? %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$.post("<%= Danbooru.config.reportbooru_server %>/post_views", {
|
||||||
|
msg: "<%= msg %>"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% end %>
|
||||||
Reference in New Issue
Block a user