[sql]
select * from datastore where title='userstats'
[/sql]
Unserialize this and you will have an array with entries numbermembers, newusername and newuserid.
[sql]
select * from datastore where title='forumcache'
[/sql]
Unserialize this which will give you an multi-dimensional associative array with all forum information. Loop through this array and accumulate threadcount and replycount.
'Who is online' is a bit more complicated. Take a look at index.php after
PHP Code:
// ### LOGGED IN USERS #################################################
to see how vBulletin does it.