MyBB Codes

Full Version: [Tip&trick]Hide the members in the online list from guests
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had make such a mod for another forum software and recently adjusted it for a friend of mine who converted from that forum to mybb.

First of all you must have the PHP in Templates and Template Conditionals plug in installed: (Nice plug in btw, very usefeul too)

http://community.mybboard.net/thread-31860.html

After you install that plug in, go to the Acp of your forum-Templates & Style-Templates-Default Templates-Index Page Templates-index_whosonline.

Replace the whole code in there with the following:

<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
<tr>
<td class="tcat"><span class="smalltext"><strong>Users on line disabled</strong></span></td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">Sorry guest but you are not authorised to view the online list.</span></td>
</tr>
<else>
<tr>
<td class="tcat"><span class="smalltext"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</span></td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
</tr>
</if>

You can see the result in the screenshot attached below. Instead of the line list, it will show the guests the following message:

Users on line disabled
Sorry guest but you are not authorised to view the online list.

It is very handy for the privacy.

The message is hard coded, but you can add the language strings in the language files if you want.

If this is in the wrong place, then I apologize in advance to the mods/admins and feel free to delete it.
Reference URL's