Quick thing. Any particular reason you used the "+=" operand? I am a newbie so I am guessing, but on my home page, it doubles the value of all my statistics. So instead of 95 posts and 95 threads, the stats say 190 theads and posts. However, when the stat is reporting from a thread in the forums dir, then everything is fine. This is true for the member count stat as well.
Also, I had to change your "+=" operand to "=", and modified your mySQL query in order to get the correct values. Here is what I am using now:
Code:
// get total number of posts
$getstats = $db->query_read('SELECT SUM(replycount) AS sumreply FROM ' . TABLE_PREFIX . 'forum');
while ($forum = $db->fetch_array($getstats))
{
$totposts = $forum['sumreply'];
}
$totposts = vb_number_format($totposts);
In order to get the SUM() working, I had to seperate the threadcount and postcount queries, but I have it all working and reporting the right values now.