|
|
|
@ -166,10 +166,10 @@ class ForumsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def search_forum
|
|
|
|
|
# @forums = paginateHelper Forum.where("name LIKE '%#{params[:name]}%'")
|
|
|
|
|
name = params[:name]
|
|
|
|
|
(redirect_to forums_path, :notice => l(:label_sumbit_empty);return) if name.blank?
|
|
|
|
|
q = "%#{params[:name].strip}%"
|
|
|
|
|
(redirect_to forums_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
|
|
|
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
|
|
|
|
@forums_all = Forum.where("name LIKE '%#{params[:name]}%'")
|
|
|
|
|
@forums_all = Forum.where("name LIKE ?", q)
|
|
|
|
|
@forums_count = @forums_all.count
|
|
|
|
|
@forums_pages = Paginator.new @forums_count, @limit, params['page']
|
|
|
|
|
|
|
|
|
@ -185,11 +185,13 @@ class ForumsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def search_memo
|
|
|
|
|
q = "%#{params[:name].strip}%"
|
|
|
|
|
|
|
|
|
|
limit = PageLimit
|
|
|
|
|
@memo = Memo.new
|
|
|
|
|
@offset, @limit = api_offset_and_limit({:limit => limit})
|
|
|
|
|
@forum = Forum.find(params[:id])
|
|
|
|
|
@memos_all = @forum.topics.where("subject LIKE '%#{params[:name]}%'")
|
|
|
|
|
@memos_all = @forum.topics.where("subject LIKE ?", q)
|
|
|
|
|
@topic_count = @memos_all.count
|
|
|
|
|
@topic_pages = Paginator.new @topic_count, @limit, params['page']
|
|
|
|
|
|
|
|
|
|