Log in

View Full Version : [help] TotalPosts and TotalThreads


LibHost
01-05-2007, 12:40 AM
Hello,

I've been having a little trouble with a script i've been developing for vBulletin. It's nearly done, but I thought I done one part correct, but it seems I did not. I need to get the PostCount and ThreadCount of the forum, I thought the following code worked:

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

But after testing, it seems the above method does not work at all... I just always get 0 on both and I have no idea why, i've seen it work on the index page, and as far as I can tell there is nothing else I can find.

If anyone knows of any way to get the forum post count, please let me know :D This has been bugging me for a few days now.

Thanks!
Richard

Dismounted
01-05-2007, 10:23 AM
You could always resort to SQL Queries...

Also, what's the hook location?