lol, that was a long time ago, and I just noticed that you asked about $totalposts and I gave you code that calculates total threads. If you were trying $totalposts in your template, then try this:
PHP Code:
if (is_array($vbulletin->forumcache))
{
$totalposts = 0;
foreach ($vbulletin->forumcache AS $forum)
{
$totalposts += $forum['replycount'];
}
}
$totalposts = vb_number_format($totalposts);