View Full Version : I want to hide $activeusers and $browsers from guests
Figment
01-17-2003, 10:52 PM
Searched high and low and cannot find a hack that would allow me to hide active user and browsing user information from specific user groups (in particular, guests)
Does anyone know of such a thing??
TIA
In index.php find:
eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
}
}
$DB_site->free_result($loggedins);
replace with:
eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
}
}
$DB_site->free_result($loggedins);
if ($bbuserinfo[userid]==0) {
$activeusers="";
}
now in forumdisplay.php fine:
}
eval("\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
}
}
and replace with:
}
eval("\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
}
}
if ($bbuserinfo[userid]==0) {
$browsers="";
}
that should do it..
Figment
01-18-2003, 08:07 PM
Thanks for the reply.
Sorry, I obviously didn't explain very clearly. Your solution does part of what I am trying to achieve. On the forum homepage, I want to hide the entire section (see attached) from guests
Edit: Unless I did something wrong (which I have checked many times) it seems to be working so the guests can see the loggedinusers template, whilst as admin I cannot !
Silenced Soul
01-20-2003, 01:08 PM
it should work, check and make sure that you didn't change on of the $bbuserinfo[userid]==0. Because if you set it to anything, such as 1 or such, then one of your members, in this case, you cannot see it whilst the guests can.
If that doesn't work, try putting:
eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
}
}
$DB_site->free_result($loggedins);
if ($bbuserinfo[userid]==0 && $bbuserinfo[usergroupid]==1]) {
$activeusers="";
}
}
eval("\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
}
}
if ($bbuserinfo[userid]==0 && $bbuserinfo[usergroupid]==1) {
$browsers="";
}
that might make the fix.
Figment
01-20-2003, 10:02 PM
Silenced soul.
Tried your version, got a parse error in index.php on the if...... line
Retried with Neos suggestion and the names of the logged in users and browsers are no longer visible to guests, but the forumhome_loggedinusers template is still visible (albeit without any names)
I could really do with this template not being visible to guests either, as it shows the number of members/guests online, which I would prefer them not to see.
Any more ideas?
TIA
index.php
find
if ($displayloggedin}
replace with
if ($displayloggedin and $bbuserinfo[userid] >= 1)
forumdisplay.php
find
if ($showforumusers)
replace with
if ($showforumusers and $bbuserinfo[userid] >= 1)
That's all folks. :D
Figment
01-21-2003, 06:18 AM
Thanks Nuno, that did the trick :) :)
Thanks to you other guys for your help too
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.