function _postLink($matches) { $post = postByID($matches[1]); if ($post) { return '<a href="res/' . ($post['parent'] == TINYIB_NEWTHREAD ? $post['id'] : $post['parent']) . '.html#' . $matches[1] . '">' . $matches[0] . '</a>'; } return $matches[0]; }
} } elseif (isset($_GET['moderate'])) { if ($_GET['moderate'] > 0) { $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'] = '';
} if (isset($_GET["delete"])) { $post = postByID($_GET['delete']); if ($post) { deletePostByID($post['id']); rebuildIndexes(); if ($post['parent'] > 0) { rebuildThread($post['parent']); } $text .= '<b>Post No.' . $post['id'] . ' successfully deleted.</b>'; } else { fancyDie("Sorry, there doesn't appear to be a post with that ID."); } } elseif (isset($_GET["moderate"])) { if ($_GET['moderate'] > 0) { $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["logout"])) { $_SESSION['tinyib'] = ''; session_destroy(); die('--> --> --><meta http-equiv="refresh" content="0;url=' . $returnlink . '?manage">'); } if ($text == '') {