molten-trunk/molten5_withgrid/app/controllers/topics_controller.rb
def active
    options = {}
    options[:per_page]   = 25
    options[:select]     = "topic.*, (SELECT COUNT(*) from post WHERE post.topic_id = topic.id AND #{Post.abusive_post_conditions} ) AS posts_count"
    options[:joins]      = 'inner join forum on topic.forum_id = forum.id'
    options[:order]      = 'posts_count desc, replied_at DESC'
    options[:conditions] = Topic.abusive_topic_conditions
    
    @topic_pages, @topics = paginate(:topic, options)
    @users = Sfcontact.find(:all, :select => 'distinct *', :conditions => ['sf_id in (?)', @topics.map { |t| t.posts.first }.collect(&:user_id).uniq]).index_by(&:id)
  end
# Retrieves a list of the most active, unabused topics
Retrieves a list of the most active, unabused topics
Retrieves a list of the most active unabused topics
def active
    options = {}
    options[:per_page]   = 25
    options[:select]     = "topic.*, (SELECT COUNT(*) from post WHERE post.topic_id = topic.id AND #{Post.abusive_post_conditions} ) AS posts_count"
    options[:joins]      = 'inner join forum on topic.forum_id = forum.id'
    options[:order]      = 'posts_count desc, replied_at DESC'
    options[:conditions] = Topic.abusive_topic_conditions
    @topic_pages, @topics = paginate(:topic, options)
    @users = Sfcontact.find(:all, :select => 'distinct *', :conditions => ['sf_id in (?)', @topics.map { |t| t.posts.first }.collect(&:user_id).uniq]).index_by(&:id)
  end
def active options = { } options [ :per_page ] = 25 options [ :select ] = "topic.*, (SELECT COUNT(*) from post WHERE post.topic_id = topic.id AND #{Post.abusive_post_conditions} ) AS posts_count" options [ :joins ] = 'inner join forum on topic.forum_id = forum.id' options [ :order ] = 'posts_count desc, replied_at DESC' options [ :conditions ] = Topic . abusive_topic_conditions @topic_pages , @topics = paginate ( :topic , options ) @users = Sfcontact . find ( :all , :select => 'distinct *' , :conditions => [ 'sf_id in (?)' , @topics . map { | t | t . posts . first } . collect ( & :user_id ) . uniq ] ) . index_by ( & :id ) end
Retrieves a list of the most active, unabused topics
Retrieves a list of the most active unabused topics