MyBB Community Forums

Full Version: Display Statistic In Footer?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to display {$stats['numposts']}, {$stats ['numusers']}, {$stats ['numthreads']}, and {$newestmember} in the footer? I've tried to add the following syntax to global.php but it can not work.

// Build the forum statistics to show on the footer page.
$forumstats = '';
if($mybb->settings['showindexstats'] != 0)
{
	// First, load the stats cache.
	$stats = $cache->read('stats');

	// Check who's the newest member.
	if(!$stats['lastusername'])
	{
		$newestmember = $lang->nobody;;
	}
	else
	{
		$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
	}

	// Format the stats language.
	$lang->stats_posts_threads = $lang->sprintf($lang->stats_posts_threads, my_number_format($stats['numposts']), my_number_format($stats['numthreads']));
	$lang->stats_numusers = $lang->sprintf($lang->stats_numusers, my_number_format($stats['numusers']));
	$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember);

	eval('$forumstats = "'.$templates->get('global_start').'";');
}

#bump
#bump
Does this still work?
(2017-09-09, 07:06 PM)Dead-i Wrote: [ -> ]Does this still work?

I have not got the solution yet.
Solved try this.