MyBB Community Forums

Full Version: Who's Online Edit Help Pls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Back Again,

I'm trying to get my Board Statistics who's online to look like this:

[Image: 68747470733a2f2f692e696d6775722e636f6d2f...422e706e67]

Did this in Inspect Element so its a bit more difficult to do the actual thing, don't know how.

How instead of "Board Statistics" in the thead it's just "3 users active in the last 15 minutes" and then the "(1 Member, 0 Of Whom Are Hidden, And 2 Guests)" still above the username list for whose online.

Here's what I have now:

[Image: RuTSutY.png]


Not sure what to do, I tried editing the online.lang.php file and adding/changing what was already there to this:

$1['online_count2'] = "{1} {2} active in the past {3} minutes";
$l['online_count'] = "({4} {5}, {6} of whom {7} hidden, and {8} {9}).";

Then call on {$lang->online_count2} in the thead, and leave {$lang->online_count} where it was. But it isn't working, any idea why?  Huh
Can you post your current index_boardstats template?
(2018-01-05, 07:56 AM)chack1172 Wrote: [ -> ]Can you post your current index_boardstats template?

Here it is:

Index_boardstats
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
	<td class="trow1"><span class="smalltext"><strong style="color: #ffffff;font-size: 14px;">{$lang->online_note}</strong></span></td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
{$whosonline}
{$birthdays}
{$forumstats}
    <tr><td>{$footer}</td></tr>
    <tr>
    <td class="tfoot" style="text-align: center">
        <span class="smalltext">
                <a href="{$mybb->settings['homeurl']}">{$mybb->settings['homename']}</a> |
                <a href="#top">{$lang->bottomlinks_returntop}</a> |
                <a href="<archive_url>">{$lang->bottomlinks_litemode}</a> |
                <a href="{$mybb->settings['bburl']}/misc.php?action=markread{$post_code_string}">{$lang->bottomlinks_markread}</a> |
                <a href="{$mybb->settings['bburl']}/misc.php?action=syndication">{$lang->bottomlinks_syndication}</a> |
            {$logoutlink}
            <a href="showteam.php">{$lang->forumteam}</a>
            {$statspage}
        </span>
    </td>
</tr>

</tbody>
</table>
<br />
<br>

<div class="navmenubottom" style="background: #131313;color: #9c9c9c;margin-left: -11px;ma;margin-top: -7px;margin-bottom: -11px;margin-right: -11px;border: 1px solid #333333;border-bottom: 1px solid #333333;border-right: 1px solid #333333;/* border-top: 1px solid #333333; *;/* padding: 0px 8px; */padding: 0px 8px;">
<nav>
  <a style="display: inline-block;color: #fff;text-decoration: none;font-size: 14px;text-align: left;/* padding: 8px; */border-right: 1px solid #252525;"><navigation></a><a style="display: inline-block;color: #fff;text-decoration: none;font-size: 14px;padding: 8px;border-right: 1px solid #252525;">Powered by MyBB</a>
</nav></div>

I've found that I have to edit the index.lang.php file, but whenever I try to add $1['online_note2'] = "{1} {2} active in the past {3} minutes"; it makes the index page stop loading, not sure what to do. Hmm

Any ideas?
(2018-01-05, 08:31 PM)Kioshi Wrote: [ -> ]whenever I try to add $1['online_note2'] = "{1} {2} active in the past {3} minutes"; it makes the index page stop loading
It is $l not $1
(2018-01-06, 09:52 PM)chack1172 Wrote: [ -> ]
(2018-01-05, 08:31 PM)Kioshi Wrote: [ -> ]whenever I try to add $1['online_note2'] = "{1} {2} active in the past {3} minutes"; it makes the index page stop loading
It is $l not $1

Haha oh wow woops, okay so I sort of got it going now but it's giving me this problem now:

[Image: uUFkWVS.png]

Any idea why it's displaying {1} {2} etc instead of "x user active in the past xx minutes"
Because the string needs to be parsed, as you can see here:
https://github.com/mybb/mybb/blob/featur...x.php#L166
$lang->online_note = $lang->sprintf($lang->online_note, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbit, my_number_format($anoncount), $anonbit, my_number_format($guestcount), $guestbit);

You need to add this code to index.php at line 166:
$lang->online_note2 = $lang->sprintf($lang->online_note2, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins']);[
(2018-01-07, 11:01 AM)chack1172 Wrote: [ -> ]Because the string needs to be parsed, as you can see here:
https://github.com/mybb/mybb/blob/featur...x.php#L166
$lang->online_note = $lang->sprintf($lang->online_note, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbit, my_number_format($anoncount), $anonbit, my_number_format($guestcount), $guestbit);

You need to add this code to index.php at line 166:
$lang->online_note2 = $lang->sprintf($lang->online_note2, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins']);[

Ah okay got it working now, thanks!
(2018-01-07, 11:01 AM)chack1172 Wrote: [ -> ]Because the string needs to be parsed, as you can see here:
https://github.com/mybb/mybb/blob/featur...x.php#L166
$lang->online_note = $lang->sprintf($lang->online_note, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins'], my_number_format($membercount), $memberbit, my_number_format($anoncount), $anonbit, my_number_format($guestcount), $guestbit);

You need to add this code to index.php at line 166:
$lang->online_note2 = $lang->sprintf($lang->online_note2, my_number_format($onlinecount), $onlinebit, $mybb->settings['wolcutoffmins']);[

Hey! So, I managed to get it working but for some reason on every page besides the Index it says "{1} {2} active in the last {3} mins" instead of "1 user active in the last 15 mins" how can I fix this?

I have {$boardstats} displaying globally on every page.
The 2 language variables are parsed on index file, you have to parse them in global.php file.
(2018-01-11, 08:15 AM)chack1172 Wrote: [ -> ]The 2 language variables are parsed on index file, you have to parse them in global.php file.

and how do I go about doing that sir?