MyBB Community Forums

Full Version: Adding BoardStats into the footer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to allow the board stats variable, or one that does somewhat similar to that in the footer template?

I'm creating and theme and want the footer to be like this: http://speedcap.net/sharing/files/a0/74/...8fd965.png

Is this possible?
{$stats['numposts']} Posts
{$stats['numthreads']} Threads
{$stats['numusers']} Members
{$newestmember} or {$stats['lastusername']} Newest Member
{$mostonline['numusers']} Most Online at {$recorddate}
Tried them, they don't work. /:
Missed that it should be for footer, those work only on index. There is no way to put them (or any other) globally without a plugin/core modification.

You can add something like that to global.php, below $navbits[0]['url'] for example:
$footer_stats = $cache->read("stats");
	
if(!$footer_stats['lastusername'])
{
	$footer_newestmember = "no-one";
}
	else
{
	$footer_newestmember = build_profile_link($footer_stats['lastusername'], $footer_stats['lastuid']);
}

$footer_mostonline = $cache->read("mostonline");
$footer_recorddate = my_date($mybb->settings['dateformat'], $footer_mostonline['time']);
$footer_recordtime = my_date($mybb->settings['timeformat'], $footer_mostonline['time']);

Then use {$footer_stats['lastusername']}, {$footer_recorddate}, {$footer_stats['numusers']}, {$footer_stats['numthreads']} etc. Tested and works.