![]() |
php file editing for usergroups
Hi everyone, simple question :p 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. |
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. :) |
Perfect, thank you very much. :)
|
All times are GMT. The time now is 10:22 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|