PDA

View Full Version : Total Threads and Posts in category bar


decipher442
04-10-2009, 04:29 AM
Hi,

I am trying to make my forum categoriy bars display the total threads and posts of its sub-forums. On my forum (http://promojunkie.com/forum) I have like 5 forum categories; each having a bunch of subforums.

I came accross this forum (http://webtalkforums.com) and see they did it and would like to do it to my forum also.

From my understanding this is the php code to call total threads and posts from the forums cache...


<?php

$totalthreads = 0;
$totalposts = 0;
if (is_array($vbulletin->forumcache))
{
foreach ($vbulletin->forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);
</a>

?>



Does anyone know how this code can be changed so I can create a plugin with it and add it to my (forumhome_forumbit_level1_nopost) template so that I can make my category bar(s) display the total threads and posts of its sub-forums.

EXAMPLE:

__________________________________________________ ______________________
[__Category_Title___________________________Threads : X,XXX, Posts: XX,XXX__[^]_]


** Threads: X,XXX, Posts: XX,XXX = Total amount of Threads and Post from all sub-forums of the category.
** [^] = category collapse image

Thanks in Advanced!