PDA

View Full Version : How does is_member_of() work?


James Birkett
03-17-2010, 03:00 PM
How does the is_member_of function work?

I can't seem to get this code to work:


if($vbulletin->options['username_manipulation_userid']){
$array = explode(';', $vbulletin->options['username_manipulation_userid']);
$exempt = $vbulletin->options['username_manipulation_shuffle_exempt'];
foreach($array as $usid){
if((!is_member_of($vbulletin->userinfo, $exempt)) && ($user['userid'] == $usid)){
// execute code here (i know this works)
}
}
}


It doesn't seem to recognize my exceptions, but executes the code anyway.

I would take a guess that the is_member_of() doesn't take userid parameters..
Thanks in advance.

encryption
07-31-2010, 07:48 PM
I'm also having problems with this function. James, did you ever figure this out?

--------------- Added 1280612775 at 1280612775 ---------------

I just figured out my problem. I was trying to execute my code from within a custom function, but the function didn't have access to the $vbulletin variable. I did a global $vbulletin; at the beginning of the function to bring it into scope and my code started working fine.


function is_djdb_editor() {
global $vbulletin;
$is_editor=FALSE;

if (is_member_of($vbulletin->userinfo,5,6,7,31,37)) $is_editor=TRUE;
return $is_editor;
}