The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
php file editing for usergroups
Hi everyone, simple question I'm on 3.8.5
I'm wanting to edit a line in a .php file if ($vbulletin->userinfo['usergroupid'] == '6') Now if I want to add an additional usergroup in there, is it a simple matter of adding a comma, like this? if ($vbulletin->userinfo['usergroupid'] == '5,6') Thanks. |
#2
|
|||
|
|||
You would have to do another check, combined with an OR, like:
Code:
if ($vbulletin->userinfo['usergroupid'] == 5 OR $vbulletin->userinfo['usergroupid'] == 6) You can also use an array, if you have more than two (or if you just prefer how it looks) Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(5, 6))) There's also a vbulletin function for checking if a user is a member of a group: Code:
if (is_member_of($vbulletin->userinfo, 5, 6)) But that does something a little different, because it checks for additional groups as well as the main usergroupid. Sorry if this is confusing - the first one is fine. |
#3
|
||||
|
||||
Perfect, thank you very much.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|