Correct hard coded URL, implement missing features

This commit is contained in:
Sam
2014-10-18 18:09:45 +11:00
parent bf7ee92d56
commit bfbfc16cca
3 changed files with 10 additions and 4 deletions

View File

@ -154,7 +154,10 @@ class Search
@status = :archived
nil
elsif word == 'status:noreplies'
@no_replies = true
@posts_count = 1
nil
elsif word == 'status:singleuser'
@single_user = true
nil
elsif word == 'order:latest'
@order = :latest
@ -294,10 +297,14 @@ class Search
posts = posts.where('topics.closed')
end
if @no_replies
if @single_user
posts = posts.where("topics.featured_user1_id IS NULL AND topics.last_post_user_id = topics.user_id")
end
if @posts_count
posts = posts.where("topics.posts_count = #{@posts_count}")
end
if @user_id
posts = posts.where("posts.user_id = #{@user_id}")
end