The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I am hoping someone can help me out, i have searched around and could not find an answer.
I am using the $totalposts variable in my theme to display the current total posts for the forum which works just fine when viewing the forum index. However, when i go in and view a thread it shows how many posts there are in that thread and not the entire forum. I want it to show the total posts of the entire forum on every page, what can i do? ![]() Thanks in advance!
|
|
#2
|
|||
|
|||
|
I have a theme with stats in the header on one of my forums, total posts being one of them.
Create a plugin, hook being global_start, name it whatever you want. Code: PHP Code:
|
|
#3
|
|||
|
|||
|
While that option will work there's no need to use a query (and add to the server load) to get this stat.
The following attached will do just fine (or use the code below and create a plugin for global_start). Code:
require_once(DIR . '/includes/functions_forumlist.php');
cache_ordered_forums(1, 1);
$totalthreads = 0;
$totalposts = 0;
if (is_array($vbulletin->forumcache))
{
echo "yup";
foreach ($vbulletin->forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|