diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index eb2596537..17872c5e2 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -237,6 +237,13 @@ class PostQueryBuilder has_constraints! end + if q[:note_updater_ids] + q[:note_updater_ids].each do |note_updater_id| + relation = relation.where(:id => NoteVersion.where("updater_id = ?", note_updater_id).select("post_id").uniq) + end + has_constraints! + end + if q[:artcomm_ids] q[:artcomm_ids].each do |artcomm_id| relation = relation.where(:id => ArtistCommentaryVersion.where("updater_id = ?", artcomm_id).select("post_id").uniq) diff --git a/app/models/tag.rb b/app/models/tag.rb index 9afc9b7c2..945fb2ff9 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ActiveRecord::Base - METATAGS = "-user|user|-approver|approver|commenter|comm|noter|artcomm|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|limit|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv" + METATAGS = "-user|user|-approver|approver|commenter|comm|noter|noteupdater|artcomm|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|limit|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv" attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin] attr_accessible :is_locked, :as => [:moderator, :janitor, :admin] has_one :wiki_page, :foreign_key => "title", :primary_key => "name" @@ -375,6 +375,11 @@ class Tag < ActiveRecord::Base user_id = User.name_to_id($2) q[:noter_ids] << user_id unless user_id.blank? + when "noteupdater" + q[:note_updater_ids] ||= [] + user_id = User.name_to_id($2) + q[:note_updater_ids] << user_id unless user_id.blank? + when "artcomm" q[:artcomm_ids] ||= [] user_id = User.name_to_id($2) diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index 5f08c3fbd..ea444ff8d 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -98,7 +98,7 @@ class UserPresenter end def commented_posts_count(template) - template.link_to(Post.fast_count("commenter:#{user.name}"), template.posts_path(:tags => "commenter:#{user.name}")) + template.link_to(Post.fast_count("commenter:#{user.name} order:comm"), template.posts_path(:tags => "commenter:#{user.name} order:comm")) end def post_version_count(template) @@ -110,7 +110,7 @@ class UserPresenter end def noted_posts_count(template) - template.link_to(Post.fast_count("noter:#{user.name}"), template.posts_path(:tags => "noter:#{user.name}")) + template.link_to(Post.fast_count("noteupdater:#{user.name} order:note"), template.posts_path(:tags => "noteupdater:#{user.name} order:note")) end def wiki_page_version_count(template) diff --git a/app/views/users/_statistics.html.erb b/app/views/users/_statistics.html.erb index fdd428d17..732c1c2ea 100644 --- a/app/views/users/_statistics.html.erb +++ b/app/views/users/_statistics.html.erb @@ -51,11 +51,7 @@