Back to vBulletin 3 Articles

[How-To]Using Array conditionals with $vboptions
by Deaths 26 Mar 2005

I've seen a couple of people making this mistake (including me a couple of months ago), so I though I'd make a How-To.

Here we go:

Add a new setting (and optionally a new settinggroup).
You may choose which settings you use, aslong as you remember the variable you use. (In this case we're using $pmembergroups).

After you're added the setting, you can add this code as your conditional:

PHP Code:
$pmembergroups  $vboptions['pmembergroups'];
$pmembergroups explode(","$pmembergroups);

if (
in_array($bbuserinfo['usergroupid'], $pmembergroups)){
TEXT_TO_BE_DISPLAYED

That's it!

EDIT: If you want a guide on how to add a setting, just ask.

vblts.ru supports vBulletin®, 2022-2024