View Full Version : custom page limited by usergroup?
Shin Shin
06-09-2008, 08:38 PM
How do I create a custom page to have something on (like a chat) and deny certian users from viewing it based on their usergroup?
Opserty
06-09-2008, 09:24 PM
if(is_member_of($vbulletin->userinfo, X, Y, Z)
{
echo 'Access denied';
exit();
}
X, Y, Z being a comma separated list of usergroup ids
Dismounted
06-10-2008, 09:26 AM
print_no_permission() displays a nicer error page :).
Shin Shin
06-11-2008, 09:16 PM
okay, now for the other part of the question...
where/how would i put that into https://vborg.vbsupport.ru/showthread.php?t=62164
I tried inserting it at the bottom of the php only to get an error.
Parse error: syntax error, unexpected '{' in some/domain/you/dont/need/to/know/forum/test.php on line 46
Dismounted
06-12-2008, 06:04 AM
Add this:
// check usergroup permission
if (is_member_of($vbulletin->userinfo, X, Y, Z))
{
print_no_permission();
}
BEFORE:
$navbits = array();
Opserty
06-12-2008, 09:03 AM
Then put between so you have something like:
// check usergroup permission
if (is_member_of($vbulletin->userinfo, X, Y, Z))
{
print_no_permission();
}
// PUT CUSTOM CODE HERE
$navbits = array();
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.