Page 1 of 1

phpBB stats -Help Still needed-

Posted: Fri Jan 19, 2007 10:13 pm
by No_Mercy
Where do I extract the stats from the index.php to put on a external website?

Like so it shows newest users, and stuff.

Posted: Fri Jan 19, 2007 10:31 pm
by Blankety Blank Man
Using SQL queries...

Our users have posted a total of # articles:

Code: Select all

SELECT COUNT(post_id) FROM phpbb_posts
We have # registered users:

Code: Select all

SELECT COUNT(user_id) FROM phpbb_users
The newest registered user is SOANDSO:

Code: Select all

SELECT username FROM phpbb_users ORDER BY user_id DESC LIMIT 0,1
In total there is # user online :: # Registered, # Hidden and # Guests:

Code: Select all

SELECT COUNT(session_id) FROM phpbb_sessions WHERE sessions_logged_in = 1
Most users ever online was # on DATE:

Code: Select all

SELECT config_value FROM phpbb_config WHERE config_name = 'record_online_users' OR config_name = 'record_online_date'

Posted: Fri Jan 19, 2007 11:39 pm
by No_Mercy
What do I do in the .html document to make them show up instead of just be that text.

Posted: Sat Jan 20, 2007 12:01 am
by Blankety Blank Man
You can't do it with HTML. You have to use PHP, or some other server-side scripting language that can access your phpBB database.

If you use PHP, you can just start with the blank webpage template and use

Code: Select all

$sql = "SQL QUERY";
if(!($result = $db->sql_query($sql)))
{
   message_die(GENERAL_ERROR,'My query failed! D:','',__LINE__,__FILE__,$sql);
}

$stuff = array();
while(($temp = $db->sql_fetchrow($result)) != null)
{
   $stuff[] = $temp;
}