Log in

View Full Version : if ($vbulletin->userinfo['userid'] == 2 ) for more users


kafi
09-10-2007, 01:28 PM
I am trying to make conditional for more than 1 user.

The conditional for 1 user is :

if ($vbulletin->userinfo['userid'] == 2 )

Is this a best way for he conditional with 2 or more users?

if (in_array($vbulletin->userinfo['userid'], array(2,8)))

If there is a better solution, please suggest/explain (I am trying to learn something .-)

Paul M
09-10-2007, 05:17 PM
That way seems as good as any for a smallish number. Larger numbers would be better done by creating a secondary usergroup, adding them to that, and checking if they are a member.