Quote:
Originally Posted by Sarcoth
Usergroup Question
PHP Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
// 2 = Registered Users // 6 = Administrators // 11 = Lore Enthusiast // 12 = Lore_Room_01
////////////////////////////////////////////////////////////////////////////////////////////////////
if (!in_array($vbulletin->userinfo['usergroupid'], array(6,11))) print_no_permission();
////////////////////////////////////////////////////////////////////////////////////////////////////
As you can see, I have this set to allow usergroups 6 and 11 to view and to use this form. This only checks to see if they are in a Primary group though. I'd like the form to check to see if the user was in either of these groups as a Primary or Additional. Can anyone tell me how to do that?
Also, once the form is completed, I'd like to add a line at the end of the form to add them to a different "Additional Usergroup". Any help would be appreciated and I'll gladly send you $10 via paypal if you coding makes this work.
Thanks,
Nick
|
Let me know if this works. I wrote this for a prive hack and modifide it for you.
PHP Code:
$check1 = explode("|", '6|11');
$check3 = explode(",",$vbulletin->userinfo[membergroupids]);
foreach ($check1 AS $check2)
{
if ($check2 == $vbulletin->userinfo[usergroupid])
{
$is++;
}
foreach ($check3 AS $check4)
{
if ($check2 == $check4)
{
$is++;
}
}
}
if (!($is))
{
print_no_permission();
}