MyBB Community Forums

Full Version: Online Today Plugin (CraKteR) Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,

I want to show the "who's online today" list, and it works ok but, I installed a new theme wich have very customized table layouts. So, I need to set the code {$online_today} in the "index_whosonline" template, but it doesn't work there. It looks like it only works in the "index" template.

Do you know how to make it work in the "index_whosonline" template?

And in general.. how to make work plugin variables in templates differents to those of what they've been designed to work in?

I really appreaciate your help. Thank you very much.
You can try this:
Open up onlinetoday.php
Find:
$plugins->add_hook('index_end', 'add_onlinetoday', 1000000);
Replace with:
$plugins->add_hook('index_start', 'add_onlinetoday', 1000000);

Find:
global $db, $mybb, $templates, $online_today, $lang, $theme;
Add below:
$lang->load('index');

EviLito Wrote:And in general.. how to make work plugin variables in templates differents to those of what they've been designed to work in?
Unfortunately, there isn't a "general" solution.
ZiNgA BuRgA Wrote:You can try this:
Open up onlinetoday.php
Find:
$plugins->add_hook('index_end', 'add_onlinetoday', 1000000);
Replace with:
$plugins->add_hook('index_start', 'add_onlinetoday', 1000000);

Find:
global $db, $mybb, $templates, $online_today, $lang, $theme;
Add below:
$lang->load('index');

EviLito Wrote:And in general.. how to make work plugin variables in templates differents to those of what they've been designed to work in?
Unfortunately, there isn't a "general" solution.

What i have done in the past with the themes that dont work with the online today mod is change the Board stats/whos online section back to the default via Templates-----Index page templates----Index. Usually those vB themes are the ones that dont work well with this mod because each part of the section is able to collapse. Birthday-Who's Online, Board Statistics each one of those collapse instead of the whole section. What happens when you add this mod to those type of themes is it screws up the whole section and throws it out of whack.
WOW! Thank you very much! Big Grin

That resolved the problem. Thanks again! Smile