I've just viewed this thread
How do I hide a group from "who's online"?, so I'm giving the answer here to help all the others.
First of all we have to know in which pages MyBB generate a viewable list of users (except plugins), a quick search of '
while($user = $db->fetch_array($query))' will give a quick result (I've omitted the unimportant results):
MYBB_ROOT/
forumdisplay.php
Line 214 listing the users that browsing the same forum
MYBB_ROOT/
inc/functions_calendar.php
Line 523 listing the users that have a birthday today or in a calendar day
MYBB_ROOT/
index.php
Line 69 listing usernams of all online users
MYBB_ROOT/
memberlist.php
Line 215 members list...
MYBB_ROOT/
online.php
Line 166 the who's online list
MYBB_ROOT/
portal.php
Line 256 generally, like index.php
To control which user groups are shown just add in the top of the mentioned loop ('
while($user = $db->fetch_array($query))') of any of the pages above, a code like the following examples, that will check the user's usergroup and according to the condition skip the user:
For example, in 'online.php' we have this code:
while($user = $db->fetch_array($query))
{
$plugins->run_hooks("online_user");
we can change it to this:
while($user = $db->fetch_array($query))
{
//If the user is an administrator, don't tell the users what he's doing
if ($user['usergroup']==4) continue;
$plugins->run_hooks("online_user");
Of course if you'll make this, users still can see what an administrator is doing in the administrator's profile page
Another example, in 'memberlist.php' we have this code:
while($user = $db->fetch_array($query))
{
$plugins->run_hooks("memberlist_user");
we can change it to this:
while($user = $db->fetch_array($query))
{
//If the user is banned or awating activation, don't display him
if (in_array($user['usergroup'],array(5,7))) continue;
$plugins->run_hooks("memberlist_user");
Both of the examples above can be made in a plugin in the proper hook.