Advertisement:

Author Topic: Showing more than the 10 items in "Top 10 Topics (by Replies)"  (Read 921 times)

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
Showing more than the 10 items in "Top 10 Topics (by Replies)"
« on: January 27, 2014, 03:23:58 PM »
Is it possible to either;
- Show more than 10 topics in the "Top 10 Topics by replies"
OR - Find out what topics are on position 11,12,13,14,... sorted by replies?

Currently my stats are like this, but I'm curious what other topics are the most popular by replies (without doing it manually)

TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Offline Branko.

  • SMF Hero
  • ******
  • Posts: 3,330
  • Gender: Male
  • U zemlji slijepih, jednooki je kralj
    • SATForum
Re: Showing more than the 10 items in "Top 10 Topics (by Replies)"
« Reply #1 on: January 27, 2014, 05:57:19 PM »
Sources\Stats.php by default line 322 or find this:
Quote
   // Topic replies top 10.
   $topic_reply_result = $smcFunc['db_query']('', '
      SELECT m.subject, t.num_replies, t.id_board, t.id_topic, b.name
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
         AND b.id_board != {int:recycle_board}' : '') . ')
      WHERE {query_see_board}' . (!empty($topic_ids) ? '
         AND t.id_topic IN ({array_int:topic_list})' : ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '')) . '
      ORDER BY t.num_replies DESC
      LIMIT 10',
      array(
Keep in mind that this will affect to the height for other tables for example Top 10 Topics (by Views)
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,824
  • Gender: Male
    • Kindred-999 on GitHub
Re: Showing more than the 10 items in "Top 10 Topics (by Replies)"
« Reply #2 on: January 27, 2014, 09:11:40 PM »
Also keep in mind that, the more you add there, the more resources your page will consume.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Branko.

  • SMF Hero
  • ******
  • Posts: 3,330
  • Gender: Male
  • U zemlji slijepih, jednooki je kralj
    • SATForum
Re: Showing more than the 10 items in "Top 10 Topics (by Replies)"
« Reply #3 on: January 28, 2014, 09:14:44 AM »
I agree, top 10 is enough. Who needs more?  :)
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Showing more than the 10 items in "Top 10 Topics (by Replies)"
« Reply #4 on: January 28, 2014, 09:18:59 AM »
Not only that, but all stats shown there are listing 10 rows. So you will have unequal stats, which doesn't look so pretty ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline themavesite

  • Jr. Member
  • **
  • Posts: 183
Re: Showing more than the 10 items in "Top 10 Topics (by Replies)"
« Reply #5 on: January 29, 2014, 12:05:24 PM »
Sorry for the late reply, I was travelling abroad.

Thanks for the replies, the LIMIT 10 worked.

As to your concerns about the stats layout messing up now: I only needed to do this once, I set the limit to 100, took a screenshot and reverted my change.
I was just curious as to what the 100 most popular topics were  ;D
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php