stats

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
sharky86
Registered User
Posts: 93
Joined: Sun Aug 19, 2007 10:25 am

stats

Post by sharky86 » Tue Apr 01, 2008 2:21 pm

hi all!


just a little question.

i have conencted a external page to the forums trough teh session magaement mod..

i would like to display some data on that page:

total users
total posts
latest user

is it possible?

thank you

igor

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: stats

Post by RMcGirr83 » Tue Apr 01, 2008 2:35 pm

The variable $board_config should have that information and is passed via session management.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

sharky86
Registered User
Posts: 93
Joined: Sun Aug 19, 2007 10:25 am

Re: stats

Post by sharky86 » Tue Apr 01, 2008 2:47 pm

great! thank you!


where can i find a list of the content of the variable?

regards

igor
Last edited by sharky86 on Tue Apr 01, 2008 3:00 pm, edited 1 time in total.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: stats

Post by RMcGirr83 » Tue Apr 01, 2008 3:00 pm

:oops:

Sorry, that was bum dope (I was thinking of categories hierarchy)...anyway.

You can use the function found in functions.php called get_db_stat. Something like this

Code: Select all

$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
Which will get you total_posts, total_users, newest_userdata, newest_user and newest_uid.

Delete the ones you don't want and parse the variables.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

sharky86
Registered User
Posts: 93
Joined: Sun Aug 19, 2007 10:25 am

Re: stats

Post by sharky86 » Tue Apr 01, 2008 3:05 pm

many many thanks

Post Reply

Return to “[2.0.x] MOD Writers Discussion”