MyBB Hacks

Full Version: Hide certain usergroups in whoisonline
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wanna like to hide certain usergroup members from being displayed to certain groups in "who is online" list.

is this possible?

for example, i created bot usergroup and installed all bots in this usergroup. if some bots visit the site, they will appear in who is online list and it will annoying if the number is huge to certain groups like members, elite members ....

so can we make the bot usergroup being displayed to certain usergroups like admin, supermod and/or mod?
I think you have to edit the index.php.
Find:

PHP Code:
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");

replace with:

PHP Code:
if($user['usergroup'] != "x") {
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
}


Replace "x" with the ID of usergroup you want to hide. Not tested...but should to be working.

I tried it but it is still showing.
That will affect the index page, not the online.php if that's what you're thinking.

Again, please state clearly what you did exactly and what exactly is showing.
I had created a usergroup bot which is having gid "13" and i added all the bots to that group. I gave the "Bot" group to view the forum and view the threads. Now i added all the bots to this group.

We see that when bots access the site, they are shown in who is online along with other members and its annoying to check who is member and who is bot.

Don't say that change the bot username style to different that you can find it easily Tongue

I dont want them to be appeared in who is online  for all groups. I just want the bots to visible by certain usergroups only, like Admin, SMod or Mod, so the staff can have a track of it on the live site.

I did the same as mentioned by tritop in index.php file from the host. But it didnt hided the bots.

I also tried by adding the <if statement to the fetch="bots" tag line, but it also failed.

Is there other way to achieve this?
Find the following in index.php and delete it:

PHP Code:
            $onlinemembers .= $comma.format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);
            $comma = ", ";


Haven't tested.

i mixed both your idead, tri and zinga. well i added the ($user['usergroup'] == "gid") in the elseif(bots){ --- } statement which is above the line specified by zinga. i'm waiting for a bot to access the site and i check it and inform here.
this may fulfill my requirement of the thread title.

Quote:so can we make the bot usergroup being displayed to certain usergroups like admin, supermod and/or mod?
mission accomplished. the bots stopped appearing from index, who is online list. Smile now it is appearing only in "who is online complete" list and i have the control of this list. Biggrin
Reference URL's