PDA

View Full Version : Simple stats on non-VB page


JohnK
09-02-2004, 01:17 PM
I am looking for a way to show the number of members and total posts on a non-VB php page.

I have looked at various hacks here, but none seem to do this (or if they do it's in with a whole bunch of other stuff!).

Ideally I would just like to be able to easily include the values so that I can have some text that simply says "In the forums we have xxxxx registered members who have posted xxxxxx messages".

Any help would be appreciated!

Thanks
John

Logikos
09-02-2004, 01:21 PM
Something like this should work.


$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);


And use

$totalthreads $totalposts $numbermembers,

In the templates...

JohnK
09-02-2004, 02:18 PM
Thanks for that. What would I need to do to use this in a non-VB page though?

John