MyBB Community Forums

Full Version: Boardstats Displayed Globally
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way that I could add {$boardstats} to every page. I figure it probably requires file edits as it appears to only be defined in the index.

Thanks in advance!
You have to add it into all the templates.

Example: Templates > Forum Display Template> Forum Display > Add it under {$threadslist} or whatever you want it to be.

You have to do this for ALL the templates
When {$boardstats} is placed anywhere else other than where it's supposed to be it won't display. I need to know how to make it so it will display. This is because it is only defined on the index.. Need to know what to add to what files so it works.
There is much code you'd need to add/move to global.php. Take a look at lines 59-337 in index.php (MyBB 1.6.10). That's the whole boardstats code if I'm not mistaken.
Here is a simple plugin that will show the stats in the footer.

Install to plugins folder, activate in ACP and put the word mystats somewhere in the footer template and it will show the basic board stats in a row.

It is called from cache so no queries.
@Leefish - Where's the template for your plugin located. I want to make adjustments so it suits my forum better.
There is no template - it is a find replace string in the plugin itself. Open the plugin and you will find it at the bottom of the file.
(2013-06-25, 07:49 PM)Miley Wrote: [ -> ]When {$boardstats} is placed anywhere else other than where it's supposed to be it won't display. I need to know how to make it so it will display. This is because it is only defined on the index.. Need to know what to add to what files so it works.

AH i think know why. You would have to edit the code of the plugin. Im not sure but check to see what's the addhook function is set up as.

Example
$plugins->add_hook("pre_output_page", "hello_world");

See what the 1st parameter is set up as.

_---------------------------
anyone still working on this? would like it in the category's subforum listing page, not on the index, way too crowded