PDA

View Full Version : call to undefined function, why?


sabret00the
11-28-2003, 01:11 PM
ok this has baffled me, i was suggested using this method to get it to pick between user groups, only problem is, is that it doesn't seem to know the array, i thought the user group array would've been defined in the global, how else can i go about getting it to work? if ($confessionid!='') {
$clause="WHERE confessionid = $confessionid ";
$num=0;
$limit='LIMIT 1';
if ($bbuserinfo[usergroupid] == 6) {
eval("\$adminoptions = \"".gettemplate("confession_adminoptions",1,0)."\";");
eval("\$report = \"".gettemplate("confession_report",1,0)."\";");
eval("\$rate = \"".gettemplate("confession_rate",1,0)."\";");
} else if($bbuserinfo[usergroupid("2","5","7","12")]) {
eval("\$report = \"".gettemplate("confession_report",1,0)."\";");
eval("\$rate = \"".gettemplate("confession_rate",1,0)."\";");
} else {
eval("\$report = \"".gettemplate("confession_report",1,0)."\";");
}
}


ps. this is the line that seems to be messing everything up } else if($bbuserinfo[usergroupid("2","5","7","12")]) {

assassingod
11-28-2003, 02:33 PM
Try using elseif rather than else if.
Also, I don't believe that

$bbuserinfo[usergroupid("2","5","7","12")]

will work unless you use an array properly

NTLDR
11-28-2003, 02:36 PM
} elseif (in_array($bbuserinfo['usergroupid'], array(2, 5, 7, 12))) {

assassingod
11-28-2003, 02:37 PM
} elseif (in_array($bbuserinfo[usergroupid], array(2, 5, 7, 12))) {
You beat me too it:(;)

sabret00the
11-28-2003, 03:52 PM
refreshed the page, works fine now :)

stupid cache :)

MindTrix
11-28-2003, 04:03 PM
How comes the ' ' marks around the usergroupid dissapeared when it was quoted? hmm

assassingod
11-28-2003, 04:05 PM
How comes the ' ' marks around the usergroupid dissapeared when it was quoted? hmm
Good point

MindTrix
11-28-2003, 04:07 PM
BUG ALERT BUG ALERT!!! lol, go post it assassingod :p

sabret00the
11-28-2003, 04:37 PM
lol, thanks alot everyone, you really helped me, it's working perfectly now, special thanks to NTLDR :)

MindTrix
12-13-2003, 03:51 PM
Just a quick note on an old thread :)

else if is the same as elseif