inthezone
02-27-2003, 12:12 AM
I am writing a basic PHP conditional script that uses vBulletin's global.php to display different messages for different user levels. I want to have the same message display for those who have userlevels 1 and 3. I know how to write it with elseif syntax, like:
if ($bbuserinfo['usergroupid']==1)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
elseif ($bbuserinfo['usergroupid']==3)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
is there a way to combine the two statements to eliminate the redundancy in that code, so that it will look something like:
//This code leads to a parse error, but I am trying to do something to this effect.
if ($bbuserinfo['usergroupid']==1) or if ($bbuserinfo['usergroupid']==3)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
Edit-accidentally left out a bit of the code.
if ($bbuserinfo['usergroupid']==1)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
elseif ($bbuserinfo['usergroupid']==3)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
is there a way to combine the two statements to eliminate the redundancy in that code, so that it will look something like:
//This code leads to a parse error, but I am trying to do something to this effect.
if ($bbuserinfo['usergroupid']==1) or if ($bbuserinfo['usergroupid']==3)
{
echo "You are not logged in, or you have not confirmed your e-mail address.";
}
Edit-accidentally left out a bit of the code.