コード例 #1
0
ファイル: misc.php プロジェクト: kamilpacaq/drydock
 }
 // Get the board name.
 $board_folder = trim($_GET['board']);
 // Check for local mod access or global mod/admin access.
 if (is_in_csl($board_folder, $_SESSION['mod_array']) != 1 && $_SESSION['admin'] != 1 && $_SESSION['mod_global'] != 1) {
     $message = "You are not permitted to moderate posts on this board";
 } else {
     // Set some stuff up.
     $board_id = $db->getboardnumber($board_folder);
     // Make sure we retrieved a valid board folder
     if ($board_folder == null) {
         $message = "That board does not exist!";
     } else {
         $postid = intval($_GET['post']);
         // SQL injection protection :]
         $postarray = $db->getsinglepost($postid, $board_id);
         // Make sure it exists
         if ($postarray == null) {
             $message = "Post with global ID of " . $postid . " and board /" . $board_folder . "/ does not exist.";
         } else {
             $message = "Moderation actions on post " . $postid . " in /" . $board_folder . "/ performed:";
             // Let's ban.  This is quicker mod, so we ban with default reason
             $reason = "USER WAS BANNED FOR THIS POST";
             $duration = 0;
             // perma
             $isthread = $postarray['thread'] == 0;
             // thread of 0 means it's a thread
             $db->banipfrompost($postarray['id'], $isthread, 0, $reason, "", $reason, $duration, $_SESSION['username'] . " via mod panel");
             $message = $message . "<br />Banning";
             // Delete, if they're an admin
             if ($_SESSION['admin'] == 1) {
コード例 #2
0
ファイル: reports.php プロジェクト: kamilpacaq/drydock
 $boardid = 0;
 $reports = array();
 $processed_reports = array();
 if ($board_folder && $db->getboardnumber($board_folder)) {
     $boardid = $db->getboardnumber($board_folder);
     // Filter by this boardid
     $reports = $db->gettopreports($boardid);
 } else {
     $board_folder = "";
     // Clear $board if the getboardnumber call failed
     $reports = $db->gettopreports();
 }
 // Populate each report with post and image information as well
 foreach ($reports as $report) {
     // Basic post information
     $report['post'] = $db->getsinglepost($report['postid'], $report['board']);
     // Add in the thread location (globalid)
     if ($report['post']['thread'] == 0) {
         $report['post']['thread_globalid'] = $report['post']['globalid'];
     } else {
         // Get the thread globalid
         $loc_array = $db->getpostlocation($report['post']['thread']);
         $report['post']['thread_globalid'] = $loc_array['thread_loc'];
     }
     // Add in images
     $report['post']['images'] = $db->getimgs($report['post']['imgidx']);
     // Round off report information
     $report['category'] = round($report['avg_category']);
     $processed_reports[] = $report;
 }
 // Get the boards array, to show a list for filtering