MyBB Community Forums

Full Version: Global Statistics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I cannot find a way to display the statistics globally. I'd like to have them in the FOOTER TEMPLATE and appear throughout the board. But it seems to be impossible the way MyBB was written. Can anyone help me out?
Use the following variables (self explanatory):

For Most online you can use these variables:
{$recordcount} or {$mostonline['numusers']}
{$recorddate}
{$recordtime}

And for Who's Online you will be able to use:
{$onlinecount}

Some more:
{$membercount}
{$guestcount}
{$botcount}
{$onlinemembers}

Newest Member:
{$newestmember}

Unread PM
{$mybb->user['pms_unread']}

Variable to show user reputation count:
{$mybb->user['reputation']}

Showing total User & Total Post at Header: (thanks to Yaldaram for this)

ACP > Templates > Header Templates > header_welcomeblock_member > and find;
{$lang->welcome_pms_usage}
and add the following code just After that;
 | <span style="font-size: 11px;">Total Users: {$stats['numusers']} - Total Posts: {$stats['numposts']}</span>
Save the template.

Now open ./global.php and find;
$plugins->run_hooks("global_start");
and add the following code just Below that;
$stats = $cache->read("stats");
Save the file.
(2012-11-06, 02:43 AM)effone Wrote: [ -> ]Use the following variables (self explanatory):

For Most online you can use these variables:
{$recordcount} or {$mostonline['numusers']}
{$recorddate}
{$recordtime}

And for Who's Online you will be able to use:
{$onlinecount}

Some more:
{$membercount}
{$guestcount}
{$botcount}
{$onlinemembers}

Newest Member:
{$newestmember}

Unread PM
{$mybb->user['pms_unread']}

Variable to show user reputation count:
{$mybb->user['reputation']}

Showing total User & Total Post at Header: (thanks to Yaldaram for this)

ACP > Templates > Header Templates > header_welcomeblock_member > and find;
{$lang->welcome_pms_usage}
and add the following code just After that;
 | <span style="font-size: 11px;">Total Users: {$stats['numusers']} - Total Posts: {$stats['numposts']}</span>
Save the template.

Now open ./global.php and find;
$plugins->run_hooks("global_start");
and add the following code just Below that;
$stats = $cache->read("stats");
Save the file.

Worked great, thank you!