} 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) { // Let's assume this is a thread and only change if necessary $thread = $postarray['globalid']; // thread global ID for cache wiping $targetisthread = true; $targetid = $postarray['id']; // unique ID for post deletion if ($postarray['thread'] != 0) { $postdbi = new ThornPostDBI(); $fetched_thread = $postdbi->gettinfo($postarray['thread']); $thread = $fetched_thread['globalid']; $targetisthread = false; }
} } } if (isset($_POST['modban']) || isset($_POST['moddo'])) { if ($_POST['modban'] != "nil" || $_POST['moddo'] != "nil") { $moddb = new ThornModDBI(); //Get post $targetid = $postarray['id']; // Find out if this is a thread if ($postarray['thread'] != 0) { $targetisthread = false; } else { $targetisthread = true; } if ($_POST['modban'] == "banip") { $moddb->banipfrompost($targetid, $targetisthread, 0, $_POST['privatebanreason'], $_POST['publicbanreason'], $_POST['adminbanreason'], $_POST['banduration'], $_SESSION['username'] . " via mod panel"); } elseif ($_POST['modban'] == "bansub") { $moddb->banipfrompost($targetid, $targetisthread, 1, $_POST['privatebanreason'], $_POST['publicbanreason'], $_POST['adminbanreason'], $_POST['banduration'], $_SESSION['username'] . " via mod panel"); } elseif ($_POST['modban'] == "banthread" && $adminpowers > 0) { $moddb->banipfromthread($targetid, $_POST['privatebanreason'], $_POST['publicbanreason'], $_POST['adminbanreason'], $_POST['banduration'], $_SESSION['username'] . " via mod panel (threadban)"); } // Post deletion, if they have access if ($adminpowers > 0 && $_POST['moddo'] != "nil") { if ($targetisthread) { $actionstring = "delete\tt:" . $postarray['globalid'] . "\tb:" . $postarray['board']; if (THuserewrite) { $diereturn = 'Post(s) deleted.<br /><a href="' . THurl . $boardname . '">Return to board</a>'; } else { $diereturn = 'Post(s) deleted.<br /><a href="' . THurl . 'drydock.php?b=' . $boardname . '">Return to board</a>'; } } else {