PDA

View Full Version : Adding forums to this check


Kihon Kata
07-04-2008, 02:39 PM
VB Coding Question: If I wanted to add more forums to this check, how would I do it? (novice coder here)


if ($foruminfo['forumid']=="57" AND $vbulletin->userinfo['hsa']!=YES)
{
standard_error("You Must Apply For Access To This Forum.<br />Go Here To Apply: <a href=http://www.XXXXXXXX.com/forums/verifyage.php>Click Here</a>");
}Would it be like this?

if ($foruminfo['forumid']=="57,167,168" AND $vbulletin->userinfo['hsa']!=YES)
{
standard_error("You Must Apply For Access To This Forum.<br />Go Here To Apply: <a href=http://www.XXXXXXXX.com/forums/verifyage.php>Click Here</a>");
}OR


if ($foruminfo['forumid']=="57" if ($foruminfo['forumid']=="167" if ($foruminfo['forumid']=="168" AND $vbulletin->userinfo['hsa']!=YES)
{
standard_error("You Must Apply For Access To This Forum.<br />Go Here To Apply: <a href=http://www.XXXXXXXX.com/forums/verifyage.php>Click Here</a>");
}OR


if ($foruminfo['forumid']=="57"
if ($foruminfo['forumid']=="167"
if ($foruminfo['forumid']=="168"
AND $vbulletin->userinfo['hsa']!=YES)
{
standard_error("You Must Apply For Access To This Forum.<br />Go Here To Apply: <a href=http://www.XXXXXXXX.com/forums/verifyage.php>Click Here</a>");
}Any help would be appreciated

MoT3rror
07-04-2008, 07:31 PM
if(in_array($foruminfo['forumid'], array(57, 167, 168)))
{
//error message
}

Dismounted
07-05-2008, 06:12 AM
Make sure you put in your other bit of code.
if (in_array($foruminfo['forumid'], array(57, 167, 168)) AND $vbulletin->userinfo['hsa'] != 'YES')
{
// error message
}

Kihon Kata
07-05-2008, 01:15 PM
Thanks, this worked!