PDA

View Full Version : [solved] Is there a Top 10 most active forums mod?


Marris
02-24-2006, 04:01 AM
I want to list the top 10 most active forum categories in order on my index. (Active forums as determined by total number of posts.) Is there any existing mod that does this or something similar?

Thanks for your help.

Marris
02-25-2006, 05:17 PM
Here's what I came up with in case anyone else is looking for this type of thing.

*Note, this is meant to work as a vBAdvanced CMPS 2.x module.

<?php

$topforums = $db->query_read("SELECT forumid, title_clean
FROM " . TABLE_PREFIX . "forum AS forum
ORDER BY replycount DESC
LIMIT 10");
while($forum = $db->fetch_array($topforums))
{
eval('$topforumsbit .= "' . fetch_template('adv_portal_topforumsbit') . '";');
}

eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_topforums') . '";');

$db->free_result($forum);
unset($forum);
?>

two new templates:

adv_portal_topforumsbit:

<div>
<a href="$vboptions[bburl]/forumdisplay.php?f=$forum[forumid]">$forum[title_clean]</a></div>

adv_portal_topforums:

<tr>
<td class="$bgclass">
$topforumsbit
</td>
</tr>