$post = postByID($_GET['moderate']); if ($post) { $text .= manageModeratePost($post); } else { fancyDie("Sorry, there doesn't appear to be a post with that ID."); } } else { $onload = manageOnLoad('moderate'); $text .= manageModeratePostForm(); } } elseif (isset($_GET['sticky']) && isset($_GET['setsticky'])) { if ($_GET['sticky'] > 0) { $post = postByID($_GET['sticky']); if ($post && $post['parent'] == TINYIB_NEWTHREAD) { stickyThreadByID($post['id'], intval($_GET['setsticky'])); threadUpdated($post['id']); $text .= manageInfo('Thread No.' . $post['id'] . ' ' . (intval($_GET['setsticky']) == 1 ? 'stickied' : 'un-stickied') . '.'); } else { fancyDie("Sorry, there doesn't appear to be a thread with that ID."); } } else { fancyDie("Form data was lost. Please go back and try again."); } } elseif (isset($_GET["rawpost"])) { $onload = manageOnLoad("rawpost"); $text .= manageRawPostForm(); } elseif (isset($_GET["logout"])) { $_SESSION['tinyib'] = ''; session_destroy(); die('--> --> --><meta http-equiv="refresh" content="0;url=' . $returnlink . '?manage">'); }
} else { rebuildThread($post['id']); } echo 'Updating thread index...<br>'; rebuildIndexes(); // Check if the request is to delete a post and/or its associated image } elseif (isset($_GET['delete']) && !isset($_GET['manage'])) { if (isset($_POST['delete'])) { $post = postByID($_POST['delete']); if ($post) { if ($post['password'] != '' && md5(md5($_POST['password'])) == $post['password']) { deletePostByID($post['id']); if ($post['parent'] == 0) { threadUpdated($post['id']); } else { threadUpdated($post['parent']); } echo 'Post successfully deleted.'; } else { fancyDie('Invalid password.'); } } else { fancyDie('Sorry, an invalid post identifier was sent. Please go back, refresh the page, and try again.'); } } else { fancyDie('Tick the box next to a post and click "Delete" to delete it.'); } $redirect = false; // Check if the request is to access the management area } elseif (isset($_GET["manage"])) { $text = "";