MyBB Community Forums

Full Version: Making Who's online For admin only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all

I was wondering how to make viewing who's online restricted only for admin
i don't think is possible, you can disable it from Configuration > Forum Home Options > Show Who's Online?
(2010-08-21, 10:00 AM)who rules Wrote: [ -> ]i don't think is possible, you can disable it from Configuration > Forum Home Options > Show Who's Online?
It is possible. Go to ACP --> Users & Groups --> Groups --> Select usergroup --> Miscellaneous tab.

And this?
http://community.mybb.com/online.php
Change the file and add new php code with group id permission. This is possible?
Open online.php

Find (Its at the top of the file):
$templatelist = "online,online_row,online_row_ip,online_today,online_today_row,online_iplookup,mostonline";
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_online.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
// Load global language phrases
$lang->load("online");

Add directly below:
if(in_array($mybb->user['usergroup'], array(1,2,5,7)))
{
    error_no_permission();
} 

This will stop everyone but the admin from viewing the online list.
(2010-08-21, 11:10 AM)Janota Wrote: [ -> ]Open online.php

Find (Its at the top of the file):
$templatelist = "online,online_row,online_row_ip,online_today,online_today_row,online_iplookup,mostonline";
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_online.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
// Load global language phrases
$lang->load("online");

Add directly below:
if(in_array($mybb->user['usergroup'], array(1,2,5,7)))
{
    error_no_permission();
} 

This will stop everyone but the admin from viewing the online list.

yup thanks it worked

i hope this code is safe :d
Yes it is safe lol, its only a simple php code.