function userdelpost($posts, $board, $password) { // Get the threads deleted so we can clear their caches! $threads_deleted = array(); $threads_deleted = $this->mymultiarray("SELECT id,globalid FROM " . THthreads_table . " WHERE board=" . intval($board) . " " . "AND globalid IN (" . implode(",", $posts) . ") AND password='******' AND password IS NOT NULL"); if ($threads_deleted != null && count($threads_deleted) > 0) { foreach ($threads_deleted as $thread) { delimgs($this->delpost($thread['id'], true)); $this->touchreports($thread['globalid'], $board, 3); // Clear all reports for it smclearcache($board, -1, $thread['globalid']); // clear the cache } } $posts_deleted = array(); $posts_deleted = $this->myarray("SELECT id FROM " . THreplies_table . " WHERE board=" . intval($board) . " " . "AND globalid IN (" . implode(",", $posts) . ") AND password='******' AND password IS NOT NULL"); if ($posts_deleted != null && count($posts_deleted) > 0) { foreach ($posts_deleted as $post) { delimgs($this->delpost($post, false)); $this->touchreports($post, $board, 3); // Clear all reports for it } } // Return the total number of threads deleted return count($posts_deleted) + count($threads_deleted); }
$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>"; } } } } } $sm = sminit("popup.tpl"); $sm->assign("text", $message); $sm->assign("timeout", 5); // 5s $sm->assign("title", "Moderation action");
$datlink = ""; } else { $datlink = $_POST['link']; } $tnum = $db->putthread($usethese['nombre'], $usethese['trip'], $binfo['id'], $_POST['subj'], $_POST['body'], $datlink, ip2long($_SERVER['REMOTE_ADDR']), $mod, $pin, $lock, $permasage, $_POST['password']); movefiles($goodfiles, $tnum, true, $binfo, $db); $sm = smsimple(); $sm->clear_cache(null, $board); //$sm->clear_cache(null,"idx"); what /* if (isset($_POST['tedit'])==true) { $sm->clear_cache(null,"t".$_POST['tedit']); } */ if ($binfo['tmax'] != 0) { //Don't purge if max threads is set to 0 delimgs($db->purge(intval(1))); } //Cookie setting stuff here if ($_POST['mem'] == "on") { if ($_POST['nombre'] !== null) { setcookie(THcookieid . "-name", $_POST['nombre'], time() + THprofile_cookietime, THprofile_cookiepath); } if ($_POST['link'] != null) { setcookie(THcookieid . "-link", $_POST['link'], time() + THprofile_cookietime, THprofile_cookiepath); } setcookie(THcookieid . "-password", $_POST['password'], time() + THprofile_cookietime, THprofile_cookiepath); } // Initialize $location variable for HTTP redirects $location = "drydock.php"; // Default if (preg_match("/^(mailto:)?noko\$/", $_POST['link'])) {
} else { $diereturn = 'Post(s) deleted.<br /><a href="' . THurl . 'drydock.php?b=' . $boardname . '&i=' . $threadop . '">Return to thread</a>'; } } if ($_POST['moddo'] == "killpost") { smclearcache($board, -1, $thread); // clear the associated cache for this thread smclearcache($board, -1, -1); // AND the board delimgs($moddb->delpost($targetid, $targetisthread)); } elseif ($_POST['moddo'] == "killip") { delimgs($moddb->delipfrompost($targetid, $targetisthread, false)); // Indicate that an entire IP is getting its posts deleted $actionstring = $actionstring . "\tip:" . $ipstring; } elseif ($_POST['moddo'] == "killsub") { delimgs($moddb->delipfrompost($targetid, $targetisthread, true)); // Indicate that an entire subnet is getting its posts deleted // We do this by writing "sub" instead of "ip" and calling ipsub so that // the last octet will be a 0 $actionstring = $actionstring . "\tsub:" . long2ip(ipsub($postarray['ip'])); } // Write to the log writelog($actionstring, "moderator"); //Display our link back. THdie($diereturn); } elseif ($_POST['moddo'] != "nil") { THdie("You lack sufficient ability to delete this post!"); } } } // Attempt to move a thread (we can if we're an admin)
$db->deleteBCW(THbcw_blotter, $blot['id']); $actionstring = "Blotter delete\tid:" . $blot['id']; writelog($actionstring, "admin"); } else { $blotter_entry = array('id' => (int) $_POST['id' . $blot['id']], 'text' => $db->escape_string($_POST['post' . $blot['id']]), 'board' => $db->escape_string($_POST['postto' . $blot['id']])); $db->updateBCW(THbcw_blotter, $blotter_entry['id'], $blotter_entry['text'], $blotter_entry['board']); } } header("Location: " . THurl . "admin.php?a=bl"); } elseif ($_GET['t'] == "b") { //echo '<pre>' . var_export($_POST,true).'</code></pre>'; if (isset($_POST['boardselect'])) { $boardnumber = $db->getboardnumber($_POST['boardselect']); if (isset($_POST['delete' . $boardnumber]) && $_POST['delete' . $boardnumber] == TRUE) { // Remove associated images delimgs($db->fragboard($boardnumber)); // Remove the DB board entry $db->removeboard($boardnumber); $actionstring = "Board delete\tid:" . $boardnumber; writelog($actionstring, "admin"); $location = THurl . "admin.php?a=b"; } else { // We're going to make an array of boards to update (with size 1) containing // assoc-arrays with board information $boards_to_update = array(); $updated_board = array(); // Get ID stuff set up $updated_board['oldid'] = $boardnumber; $updated_board['id'] = $updated_board['oldid']; $oldid = $updated_board['oldid']; //$updated_board['globalid'] = $_POST['globalid'.$oldid];