PDA

View Full Version : if($bbuserinfo['membergroupids'] == "") { How do i work this out?


VeoMorphine
02-13-2004, 02:43 PM
Im still not to good with php, but to allow my staff to only see some pages on my site, i included global.php and all the other needed vb3 files now, and used:

<?
if($bbuserinfo['usergroupid'] == "5") {
?>
Content
<?
}
?>

How can i change that so it searches membergroup id's also? I know there layed out in the Database with more then 1 id to a collumn so if a user was in 5 groups, there would be 5 ids

How would i change this line:
if($bbuserinfo['usergroupid'] == "5" OR $bbuserinfo['membergroupids'] == "5" OR $bbuserinfo['membergroupids'] == "6" OR $bbuserinfo['membergroupids'] == "7" OR $bbuserinfo['membergroupids'] == "9") {

So it would work on people with more then 1 ID in membergroupids?

NTLDR
02-13-2004, 02:55 PM
Use is_member_of()

if (is_member_of($bbuserinfo, 5)) {
// user is in usergroup 5 or has it as a membergroup
}


<if condition="is_member_of($bbuserinfo, 5)">
// user is in usergroup 5 or has it as a membergroup
</if>


For multiple group checking see the Mini-Mod my merk to allow checking unlimited groups in one call.