add user searches

This commit is contained in:
r888888888
2016-08-23 18:20:21 -07:00
parent 6d20ecb20d
commit c3b78b1752
8 changed files with 38 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ module ApplicationHelper
string += '</div>'
string.html_safe
end
protected
def nav_link_match(controller, url)
url =~ case controller

View File

@@ -28,6 +28,18 @@ module PostsHelper
return nil
end
def common_searches_html(user)
return nil unless Danbooru.config.enable_post_search_counts
return nil unless user.is_platinum?
return nil unless user.enable_recent_searches?
key = "uid"
value = user.id
digest = OpenSSL::Digest.new("sha256")
sig = OpenSSL::HMAC.hexdigest(digest, Danbooru.config.shared_remote_key, "#{key},#{value}")
render("users/common_searches", user: user, sig: sig)
end
def resize_image_links(post, user)
links = []