"; admincheck(); print adminlinkbar('admin-editmods.php'); $donotprint = false; if ($action) { // print "DEBUG: Asked to ".$action." a moderator of forum: ".${$action."modforum"}." and user: ".${$action."moduser"}; $donotprint = true; switch($action) { case "remove": $removemod = explode("|", $removemod); $removemoduser = $removemod[1]; $removemodforum = $removemod[0]; $sql->query("DELETE FROM forummods WHERE user='$removemoduser' AND forum='$removemodforum'"); if(($err=mysql_error()) != "") print "$tblstart$tccell1> ERROR: $err."; else { $sql->query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." removed mod $removemoduser from forum $removemodforum\", \"$userip\")"); print "$tblstart$tccell1> You successfully deleted user $removemoduser from forum $removemodforum.
".redirect("admin-editmods.php",'go back to Edit Mods',0); } break; case "add": $sql->query("INSERT INTO forummods VALUES('$addmodforum', '$addmoduser')"); if(($err=mysql_error()) != "") print "$tblstart$tccell1> ERROR: $err."; else { $sql->query("INSERT INTO actionlog (atime, adesc, aip) VALUES (".ctime().", \"User ".$loguserid." added mod $addmoduser to forum $addmodforum\", \"$userip\")"); print "$tblstart$tccell1> You successfully added user $addmoduser to forum $addmodforum.
".redirect("admin-editmods.php",'go back to Edit Mods',0); } break; default: print "No, doofus."; } } if (!$donotprint) { $forums=$sql->query("SELECT id,title,description,catid FROM forums ORDER BY catid"); $fa=""; $forumselect="\r\n"; $forumselectforrem = "\r\n"; while($forum=$sql->fetch($forums)) { $m=0; $modlist=""; $forumselect.=""; $mods=$sql->query("SELECT user FROM forummods WHERE forum=$forum[id]"); if($mods) { while($mod=$sql->fetch($mods)) { $usermod=$sql->fetchq("SELECT aka,sex,powerlevel,name,id from users where id=$mod[user]"); if($m) $modlist.=", "; $modlist .= getuserlink($usermod); $forumselectforrem.="\r\n"; $m++; } } if ($m) $fa.=" $forum[id] $forum[title] $modlist "; } $userlist = "\r\n"; $users1=$sql->query("SELECT `id`, `name` FROM `users` WHERE `powerlevel` > '0' ORDER BY `name`"); while($user=$sql->fetch($users1)) $userlist.="\r\n"; print " $tblstart ID Forum Name Moderators$fa$tblend
$inph=\"action\" value=\"add\">
$tblstart". /* $tccellh>$smallfont Delete a mod. $tccellh>$smallfont Add Moderator. $tccell1> User ID: $tccell1> User ID: $tccell1> Forum ID: $tccell1> Forum ID: $tccell1> $tccell1> */ "$tccellh colspan=\"2\">Add Moderator: $tccell1 width=15%>Forum:$tccell2l width=85%> $tccell1 width=15%>User:$tccell2l width=85%> $smallfont(note: this only shows Member+ and above) $tccell1 width=15%> $tccell2l width=85%>$inps=\"addmodsubmit\" value=\"Add Moderator\">$tblend" . /* $tccellh>$smallfont Delete a mod. $tccellh>$smallfont Add Moderator. $tccell1> User ID: $tccell1> User ID: $tccell1> Forum ID: $tccell1> Forum ID: $tccell1> $tccell1> */ ($forumselectforrem!=""?"
$inph=\"action\" value=\"remove\">$tblstart"."$tccellh colspan=\"2\">Remove Moderator: $tccell1 width=15%>Forum and Moderator:$tccell2l width=85%> $tccell1 width=15%> $tccell2l width=85%>$inps=\"removemodsubmit\" value=\"Remove Moderator\">$tblend
":""); } print $footer; printtimedif($startingtime); ?>