I think this works:
Code:
cache_ordered_forums(1, 1);
$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);
using global start. You might want to change the variable names like BOP5 mentioned. The call to cache_ordered_forums() fills some of the cache fields, and calling it here means it will be done twice on some pages, [S]but it doesn't look like that includes any of the main pages like showthread or forumdisplay so maybe it's OK[/S] (see my later post).
For the total members you could do a query:
Code:
$members = $vbulletin->db->query_first("SELECT COUNT(*) AS users
FROM " . TABLE_PREFIX . "user");
$numbermembers = $members['users'];
The value is in the datastore but to get it you'd have to add userstats to $specialtemplates before including global.php (like is mentioned at the link BOP5 posted above), but that would mean editing the file for every page you wanted it to appear on, or maybe putting it in init.php (although I'm not sure what other issues that might cause).