This hack adds a special section to the Who's Online, that only mods and admins can see.
In that section, there are links to all usergroups you have set up on your forum, except for the COPPA group (I figured no one really needs it ).
When you click on each link, you will be taken to a new Who's Online page, that will only list users from the selected usergroup.
That's all basically. Very good to see what your mods are doing, where the banned people are trying to get, etc.
A screen shot of the page can be found in my next post.
I hope it explains everything, let me know if something remains mysterious.
I really tried to make this hack as good as it can get.
I hope I covered all aspects, so you shouldn't be getting any weird bugs or anything like that.
Sorry for not making a fancy installation script, I figured it's not really necessary for this hack.
Anyway, instructions are included in the text file attached.
You will need to edit one file (online.php), one template (whosonline) and add a new template (whosonline_usergrouplinks).
Have fun!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
function getusergrouplinks($current=0) {
global $DB_site, $usergrouplinks;
$linkbits='';
$allgroups=$DB_site->query("SELECT usergroupid,title FROM usergroup WHERE usergroupid<>'4' ORDER BY title");
while ($group=$DB_site->fetch_array($allgroups)) {
$groupid=$group[usergroupid];
$grouptitle=$group[title];
if ($linkbits)
$linkbits.=', ';
if ($groupid==$current)
$linkbits.='<b>[</b>'.$grouptitle.'<b>]</b>';
else
$linkbits.='<a href="online.php?s='.$session[sessionhash].'&what='.$groupid.'">'.$grouptitle.'</a>';
}
$linkbits.='.';
if ($bbuserinfo[usergroupid]!=5 and $bbuserinfo[usergroupid]!=6 and $bbuserinfo[usergroupid]!=7) {
unset($what);
} elseif (!isset($what) or $what=='') {
getusergrouplinks();
}
if ($what=="banned" and $bannedgroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE title LIKE '%banned%'")) {
$navbar='<a href="online.php?s='.$session[sessionhash].'">Who\'s Online</a> > '.$bannedgroup[title];
$tablehead='$numbervisible $bannedgroup[title]';
$condition='AND user.usergroupid='.$bannedgroup[usergroupid];
$formeta='&what='.$bannedgroup[usergroupid];
getusergrouplinks($bannedgroup[usergroupid]);
} elseif ($what=="awaiting") {
$navbar='<a href="online.php?s='.$session[sessionhash].'">Who\'s Online</a> > Users Awaiting Email Confirmation';
$tablehead='$numbervisible Users Awaiting Email Confirmation';
$condition='AND user.usergroupid=3';
$formeta='&what=awaiting';
getusergrouplinks(3);
} elseif ($what==1 or $what=="guest") {
$navbar='<a href="online.php?s='.$session[sessionhash].'">Who\'s Online</a> > Unregistered / Not Logged In';
$tablehead='$numbervisible Unregistered / Not Logged In';
$condition='AND session.userid=0';
$formeta='&what=1';
getusergrouplinks(1);
} elseif (isset($what) and $what!=='') {
$usergroupinfo=verifyid("usergroup",$what,1,1);
$navbar='<a href="online.php?s='.$session[sessionhash].'">Who\'s Online</a> > '.$usergroupinfo[title];
$tablehead='$numbervisible $usergroupinfo[title]';
$condition='AND user.usergroupid='.$usergroupinfo[usergroupid];
$formeta='&what='.$usergroupinfo[usergroupid];
getusergrouplinks($usergroupinfo[usergroupid]);
} else {
$navbar='Who\'s Online';
$tablehead='$numbervisible Members and $numberguests Guests';
$condition='';
$formeta='';
}
in the online.php file... I'm running 2.2.5
any help?