MyBB Community Forums

Full Version: only show the who's online complete list to staff members
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
HI,
is there anyway to setup so only the forum staff or certain usergroup can access to complete list of the who's online feature ?

Thank you.
So it's the full Who's Online feature that you want to block? The small list on the index should be available to everyone?
Yes, I'd like to show the who's online list on the board statistics on the forum home page to all members - but the complete list only access by admin

ThankYou
1. Open the online.php file in a text editor.

2. Find:

if($mybb->usergroup['canviewonline'] == 0)
{
	error_no_permission();
}

3. Change to:

$list_exempt_groups = "1,2,3";
$exempt_groups = explode(",",$list_exempt_groups);

if($mybb->usergroup['canviewonline'] == 0 || !in_array($mybb->user['usergroup'],$exempt_groups))
{
	error_no_permission();
}

4. Replace 1,2,3 with the gid of the usergroups that you want to allow to use the full Who's Online feature.
Thank You very much
HI ,
I've changed the code as instructed

But when login as administrator, when click on the complete list, I've got an error message : " You do not have permission to access this page. ..."

Is there anyway to not even showing the text/link "complete List" to the not-allowed group ?

Thank You .
Replace above with this;
if($mybb->usergroup['canviewonline'] == 0 || in_array($mybb->user['usergroup'],array(1,2,5,7)))
{
	error_no_permission();
}
Now change 1,2,5,7 to the Usergroup IDs you do not want them to see complete online page.
My code works, I've tested it. You're just doing the opposite Yaldaram, and in my opinion it's a lot easier to indicate the usergroups you don't want to access it.

Is that what you did MayKim? Did you indicate the gid of the usergroups you don't want to access the page? Because if you added the admin's gid (4), then it will obviously block you.
Yes, I guess I did it wrong then - I had gid 4 in the the $list_exempt_groups
ThankYou

Is there anyway to even not display link for the "complete list" ?
Thank You
Yeah, you could do it, but do you really think that's necessary?
I guess it is not really necessary , just if it is better if the feature is not presented to the user than the user having an error message
Thanks
Pages: 1 2