/** * Look up a quotereply link, and convert it to the necessary anchor * tag equivalent if necessary. * * @param int $bid The board ID * @param string $bfold The board folder name * @param int $threadid The (unique) ID for this thread * @param int $threadglob The global ID for this thread * @param int $pulledvalue The parsed value (i.e. would be 2 for ">>2") * * @return string The anchor link (or just ">>$pulledvalue" if it was invalid) */ function lookup_qr_link($bid, $bfold, $threadid, $threadglob, $pulledvalue) { $db = new ThornPostDBI(); // Default to not finding anything of use. $link = $link = ">>" . $pulledvalue; // This abstracts so much stuff for us. $postinfo = $db->getsinglepost($pulledvalue, $bid); if ($postinfo != null) { if ($postinfo['thread'] == 0) { // Just add an anchor tag and go if (THuserewrite) { $link = '<a href="' . THurl . $bfold . "/thread/" . $pulledvalue . '#' . $pulledvalue . '">>>' . $pulledvalue . "</a>"; } else { $link = '<a href="' . THurl . 'drydock.php?b=' . $bfold . '&i=' . $pulledvalue . '#' . $pulledvalue . '">>>' . $pulledvalue . "</a>"; } } else { if ($postinfo['thread'] == $threadid) { if (THuserewrite) { $link = "<a href=\"" . THurl . $bfold . "/thread/" . $threadglob . "#" . $pulledvalue . "\">>>" . $pulledvalue . "</a>"; } else { $link = "<a href=\"" . THurl . 'drydock.php?b=' . $bfold . '&i=' . $threadglob . "#" . $pulledvalue . "\">>>" . $pulledvalue . "</a>"; } } else { // We need to look up the global ID. $threadinfo = $db->gettinfo($postinfo['thread']); // Was it a valid lookup? if ($threadinfo != null) { $threadop = $threadinfo['globalid']; if (THuserewrite) { $link = "<a href=\"" . THurl . $bfold . "/thread/" . $threadop . "#" . $pulledvalue . "\">>>" . $pulledvalue . "</a>"; } else { $link = "<a href=\"" . THurl . 'drydock.php?b=' . $bfold . '&i=' . $threadop . "#" . $pulledvalue . "\">>>" . $pulledvalue . "</a>"; } } } } } return $link; }
// 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; } smclearcache($board_folder, -1, $thread); // clear the associated cache for this thread smclearcache($board_folder, -1, -1); // AND the board delimgs($db->delpost($targetid, $targetisthread)); // Write to the log writelog("delete\tt:" . $postarray['globalid'] . "\tb:" . $postarray['board'], "moderator"); $message = $message . "<br />Post deletion"; } else { $message = $message . "<br /><i><b>Post deletion failed (insufficient access)</i></b>"; } }
$_POST['email'] (spambot string) $_FILES (for images) */ $mod = $_SESSION['moderator'] || $_SESSION['admin']; //quick fix //var_dump($_POST); //This should be for CAPTCHA if (THvc == 1) { checkvc(); } $db = new ThornPostDBI(); if ($db->checkban()) { THdie("PObanned"); } // Get thread and board info $thread = $db->gettinfo($_POST['thread']); $binfo = $db->getbinfo($db->getboardnumber($_POST['board'])); // Die if the board doesn't exist. if ($binfo == null) { die("Specified board does not exist."); } else { if ($thread == null) { die("Specified thread does not exist."); } } //check for banned keywords if ($mod == false) { // First, flood protection $longip = ip2long($_SERVER['REMOTE_ADDR']); if ($db->postedwithintime($longip) == true) { THdie("You must wait a while before making another post.");