PDA

View Full Version : Make stats module to show both forums stats


bonjurkes
07-16-2006, 07:56 AM
Hello,

I have 2 boards, they are at same database using different prefix. I want to show these two boards stats at main page totally.

For example (at first board)

Thread Count : 10

Post Count : 5


and at second board

Thread count : 2

post count : 1


so i want stats page to show it like


Thread count : 12

Post count : 6

I dont need it for top poster and last user.

I check the stats module and saw the code that i must change but dont know how to do


$getforumstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum');
while ($forum = $db->fetch_array($getforumstats))
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);

$db->free_result($getforumstats);
unset($forum);

if ($mod_options['portal_stats_updatefrequency'])
{
$topposter = unserialize($vbulletin->adv_portal_tpst);




I want to add second query to

$getforumstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum');


the second board's prefix is vb3_

so it must be something like

$getforumstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum' + 'SELECT threadcount, replycount FROM ' . 'vb3_forum');


But like i said the + is for the multiplying result of these two queries and not sure if that idea will work. So i need help...

bonjurkes
07-19-2006, 10:36 AM
bump