?> </a> <?php } ?> <form action="action.php" method="GET"> <input type="hidden" name="action" value="3"> <input type="hidden" name="threads" value="<?php echo $i; ?> "> <select name="moveto"> <?php $categories = $forum_index->retrieveCategories(); foreach ($categories as $category) { $listing = $forum_index->retrieveSubForums($category['id']); echo '<option disabled="disabled">' . $category['title'] . '</option>'; foreach ($listing as $list_f) { echo '<option value="' . $list_f['id'] . '">' . $list_f['title'] . '</option>'; } } ?> </select> <input type="submit" value="Move"> </form> </div> <?php } ?> <br>
<select name="cat" class="button">'; foreach ($forum_index->retrieveCategories($rank) as $category) { $content .= '<option value="' . $category['id'] . '">' . $category['title'] . '</option>'; } $content .= '<input type="submit" value="Edit"></select></form>'; } else { //make sure it exists if (!$forum->catExists($_REQUEST['cat'])) { $content = 'No category exists with the given ID.'; } else { if (isset($_REQUEST['delete'])) { if (!isset($_REQUEST['confirm'])) { $content = 'Are you sure you wish to delete this category and all forums/threads/posts a long with it? <a href="?cat=' . $_REQUEST['cat'] . '&delete=1&confirm=1">Yes!</a> | <a href="?cat=' . $_REQUEST['cat'] . '">Back</a>'; } else { //delete the forums and all threads/posts within them that belong to this category foreach ($forum_index->retrieveSubForums($_REQUEST['cat']) as $a_forum) { $forum->deleteForum($a_forum['id']); } //delete the category itself $database->processQuery("DELETE FROM `cats` WHERE `id` = ?", array($_REQUEST['cat']), false); $content = 'Delete successful!'; } } else { $cat = $database->processQuery("SELECT `title`,`id`,`type`,`pos` FROM `cats` WHERE `id` = ?", array($_REQUEST['cat']), true); if (!isset($_POST['category'])) { $content = ' <form action="editcat.php?cat=' . $cat[0]['id'] . '" method="POST"> <table> <tr> <td>Category</td> <td><input type="text" name="category" class="button" value="' . $cat[0]['title'] . '"></td>
<div id="contentfrm"> <table> <tbody> <tr> <td width="4%"></td> <td width="45%" class="title"></td> <td width="10%" class="title num">Threads</td> <td width="10%" class="title num">Posts</td> <td width="26%" class="title">Last Post</td> </tr> <?php //retrieve our categories foreach ($forum_index->retrieveCategories($rank) as $category) { echo '<tr><td class="groupname" colspan="5">' . $category['title'] . '</td></tr>'; foreach ($forum_index->retrieveSubForums($category['id']) as $s_forum) { if ($forum->canView($s_forum['id'], $rank)) { //retrieve the forum's statistics $statistics = $forum_index->retrieveFStatistics($s_forum['id']); //get appropriate icon for the section if ($s_forum['type'] > 3) { $icon = $s_forum['type'] == 4 ? '<img src="../img/forum/icons/mod.png" border="0" alt="">' : '<img src="../img/forum/icons/a_mod.png" border="0" alt="">'; } else { $icon = $forum->getIcon($s_forum['icon']); } ?> <tr class="border item"> <td class="icon lefttd"><a href="viewforum.php?forum=<?php echo $s_forum['id']; ?>
$forum = new forum($database); $forum_index = new forum_index($database); $user = new user($database); $user->updateLastActive(); $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); if ($rank < 4) { $base->redirect('../index.php'); } if (!$_REQUEST['id']) { $content = ' <div id="blackfields"> <form action="editforum.php" method="GET"> <select name="id" class="button">'; foreach ($forum_index->retrieveCategories($rank) as $cat) { foreach ($forum_index->retrieveSubForums($cat['id']) as $forum) { $content .= '<option value="' . $forum['id'] . '">' . $forum['title'] . '</option>'; } } $content .= '</select> <input type="submit" value="Select" class="button"> </form> </div> '; } else { if ($forum->forumExists($_GET['id']) || $forum->forumExists($_POST['id'])) { if (!isset($_POST['id'])) { //forum details $f = $database->processQuery("SELECT `icon`,`title`,`type`,`description`,`parent`,`double_posting`,`pos` FROM `forums` WHERE `id` = ? LIMIT 1", array($_GET['id']), true); //save time $type = $f[0]['type'];