Well it's really just a matter of querying the database for the relevant information.
Place the following at the very top of the pages you're displaying information on; make sure they're PHP files as well.
Code:
<?php
chdir('/path/to/forum');
require_once('/path/to/global.php');
?>
Then you're free to use the DB class to retrieve information.
Example:
Code:
$stats = $db->query_read("SELECT threadcount, replycount FROM " . TABLE_PREFIX . "forum");
while ($forum = $db->fetch_array($stats))
{
$threads += $forum['threadcount'];
$posts += $forum['replycount'];
}
$threads = vb_number_format($threads);
$posts = vb_number_format($posts);