Hi Bill, thanks for the great hack. Ive managed to get vb working from within the codeigniter framework, so the possibilities are endless
Just thought I'd throw a little simpler code for you to get threadcount/postcount.
This:
PHP Code:
$getstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum');
while ($forum = $db->fetch_array($getstats))
{
$totthreads += $forum['threadcount'];
$totposts += $forum['replycount'];
}
$totthreads = vb_number_format($totthreads);
$totposts = vb_number_format($totposts);
Can be replaced with:
PHP Code:
$getstats = $db->query_read('SELECT SUM(replycount) AS replies, SUM(threadcount) as threads FROM ' . TABLE_PREFIX . 'forum');
$forum = $db->fetch_array($getstats);
$totthreads = vb_number_format($forum['threads']);
$totposts = vb_number_format($forum['replies']);
and let mysql do the calculations instead of php.