The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#5
|
|||
|
|||
![]()
You're right, it doesn't work on all pages because the information isn't always in the forum cache. Sorry, my mistake. You could change the code to something like this:
Code:
global $vbulletin; $totalthreads = 0; $totalposts = 0; if (is_array($vbulletin->forumcache)) { foreach ($vbulletin->forumcache AS $forum) { $totalthreads += $forum['threadcount']; $totalposts += $forum['replycount']; } } if ($totalthreads == 0) { $result = $vbulletin->db->query_first_slave("SELECT SUM(threadcount) AS threadcount, SUM(replycount) AS replycount FROM " . TABLE_PREFIX . "forum"); if (!empty($result)) { $totalthreads = $result['threadcount']; $totalposts = $result['replycount']; } } $totalthreads = vb_number_format($totalthreads); $totalposts = vb_number_format($totalposts); vB_Template::preRegister('header', array('totalthreads' => $totalthreads, 'totalposts' => $totalposts)); but you should be aware that this will add a query to each page that didn't already have the information, which could be significant if your forum is busy. It would be better to set something up to cache the information periodically, but that's a little more complicated. |
Благодарность от: | ||
glennybee |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|