Example #1
0
             $ip4 = $single_ban_assoc['ip_octet4'];
         }
         $ip = ip2long($single_ban_assoc['ip_octet1'] . "." . $single_ban_assoc['ip_octet2'] . "." . $ip3 . "." . $ip4);
         // Get history for the IP
         $rawhist = $db->getiphistory($ip);
         if ($rawhist != null) {
             $banhistory = array();
             foreach ($rawhist as $hist) {
                 $banhistory[] = array("ip1" => $hist['ip_octet1'], "ip2" => $hist['ip_octet2'], "ip3" => $hist['ip_octet3'], "ip4" => $hist['ip_octet4'], "id" => $hist['id'], "publicreason" => $hist['publicreason'], "privatereason" => $hist['privatereason'], "adminreason" => $hist['adminreason'], "postdata" => $hist['postdata'], "duration" => $hist['duration'], "bantime" => $hist['bantime'], "bannedby" => $hist['bannedby'], "unbaninfo" => $hist['unbaninfo']);
             }
         } else {
             $banhistory = null;
         }
         $sm->assign("banhistory", $banhistory);
     } else {
         $rawbans = $db->getallbans();
         if ($rawbans != null) {
             $bans = array();
             foreach ($rawbans as $ban) {
                 $bans[] = array("ip1" => $ban['ip_octet1'], "ip2" => $ban['ip_octet2'], "ip3" => $ban['ip_octet3'], "ip4" => $ban['ip_octet4'], "id" => $ban['id'], "publicreason" => $ban['publicreason'], "privatereason" => $ban['privatereason'], "adminreason" => $ban['adminreason'], "postdata" => $ban['postdata'], "duration" => $ban['duration'], "bantime" => $ban['bantime'], "bannedby" => $ban['bannedby']);
             }
         } else {
             $bans = null;
         }
         $sm->assign("bans", $bans);
     }
     $sm->display("adminban.tpl");
 } elseif ($_GET['a'] == "t") {
     include "recentpics.php";
 } elseif ($_GET['a'] == "q") {
     include "recentposts.php";