MyBB Community Forums
Board Stats in Header not working - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Board Stats in Header not working (/thread-210219.html)



Board Stats in Header not working - Sharree - 2017-05-04

Hey guys. I'm using the latest MyBB release 1.8.11 and basic board stats on the header don't seem to work.

I'm trying to add board stats in my header such as:
{$stats['numposts']}
{$stats['numusers']}
etc.

However they don't seem to work in the new version but did work in the previous one I used. Is there a file I need to edit in my directory to make them appear globally?


RE: Board Stats in Header not working - .m. - 2017-05-04

they should work on the index template [below {$header}]


RE: Board Stats in Header not working - Sharree - 2017-05-04

(2017-05-04, 02:50 PM).m. Wrote: they should work on the index template [below {$header}]

Ya it looks like it's working on index however I wanted to use it gloabally and have it appear in the header block. Is there a file I need to edit to make it global, not only index.


RE: Board Stats in Header not working - .m. - 2017-05-04

it would be better to use a plugin for your requirement. this plugin can be helpful ..


RE: Board Stats in Header not working - Sharree - 2017-05-04

Got it .m. instead of the plugin I edited the the global.php file and under the $plugin hook I added

$stats = $cache->read("stats");
$total_users = my_number_format($stats['numusers']);