phpBB stats -Help Still needed-

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
No_Mercy
Registered User
Posts: 115
Joined: Mon Dec 11, 2006 8:33 pm

phpBB stats -Help Still needed-

Post 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.
Last edited by No_Mercy on Fri Jan 19, 2007 11:43 pm, edited 1 time in total.
Blankety Blank Man
Registered User
Posts: 881
Joined: Wed Mar 30, 2005 3:54 am

Post 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'
No_Mercy
Registered User
Posts: 115
Joined: Mon Dec 11, 2006 8:33 pm

Post by No_Mercy »

What do I do in the .html document to make them show up instead of just be that text.
Blankety Blank Man
Registered User
Posts: 881
Joined: Wed Mar 30, 2005 3:54 am

Post 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;
}
Locked

Return to “2.0.x Support Forum”