PDA

View Full Version : Ignore Mods, but not Admins


MetroSports82
05-27-2003, 09:25 PM
yea, so i'm trying to figure out how to set this up, where i can have users ignore moderators, but not the admins, while having the "Ignore Moderators" enabled. I've serached the DB, and couldn't really find anything to this matter. I'm wondering if there is a way to have the admins bypass this? Any how, here is the block of code I've been working on. thanx. ;)

member2.php

// ############################### start update list ###############################
if ($HTTP_POST_VARS['action']=="updatelist") {
$templatesused = "redirect_updatelist";
include("./global.php");
//check usergroup of user to see if they can use Profile
if ($bbuserinfo[userid]==0) {
show_nopermission();
}

if ($userlist!="buddy") {
$userlist="ignore";
}
$var=$userlist."list";

$listids="";
while (list($key,$val)=each($listbits)) {
if ($userid=$DB_site->query_first("SELECT usergroupid, user.userid, moderator.userid as moduserid
FROM user
LEFT JOIN moderator ON (user.userid = moderator.userid)
WHERE username='".addslashes(htmlspecialchars($val))."'")) {
if ($var=='ignorelist' and !$ignoremods and ($userid[usergroupid]==6 or $userid[usergroupid]==5 or $userid[moduserid]) and $bbuserinfo[usergroupid] != 6) {
$username=htmlspecialchars($val);
eval("standarderror(\"".gettemplate("error_listignoreuser")."\");");
exit;
} else if ($bbuserinfo['userid'] == $userid['userid']) {
eval("standarderror(\"".gettemplate("error_cantlistself")."\");");
exit;
} else {
$listids.=" $userid[userid]";
}
} else {
if (trim($val)!="") {
$username=htmlspecialchars($val);
eval("standarderror(\"".gettemplate("error_listbaduser")."\");");
exit;
}
}
}

$listids=trim($listids);

$DB_site->query("UPDATE user SET $var='".addslashes($listids)."' WHERE userid=$bbuserinfo[userid]");

eval("standardredirect(\"".gettemplate("redirect_updatelist")."\",\"usercp.php?s=$session[sessionhash]\");");

}

EDIT: nevermind, I think I figured it out. :)