<?php require_once "configuration/main.php"; if (!$permissions['viewforum']) { redirect("errors/permissions.html"); } $mQuery = $mysql->query("SELECT * FROM `categories` WHERE `id` = '" . escape($_GET['id']) . "'"); if ($mQuery->num_rows) { $mData = $mQuery->fetch_assoc(); setPageNavigation("category", $_GET['id']); setPageInfo($mData['name'], $mData['description']); } else { die("You have followed an invalid link."); } echo "<div class='categoryTitle'>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td width='540'>\n\t\t\t\t\t" . $mData['name'] . "\n\t\t\t\t</td>\n\n\t\t\t\t<td width='100'>\n\t\t\t\t\tStatistics\n\t\t\t\t</td>\n\n\t\t\t\t<td>\n\t\t\t\t\tLast Post\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"; if ($mData['description']) { echo "<div class='categoryDescription'>\n\t\t\t" . $mData['description'] . "\n\t\t</div>"; } $sectionQuery = $mysql->query("SELECT * FROM `sections` WHERE `category` = '" . escape($_GET['id']) . "' AND `parent` IS NULL ORDER BY `order` ASC"); while ($sectionData = $sectionQuery->fetch_assoc()) { $threadAmount = 0; $commentAmount = 0; if ($permissions['viewotherthreads']) { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "'"); } else { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "' AND `hidden` != '1'"); } } else { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "' AND `poster` = '" . $_SESSION['accountid'] . "'");
redirect("errors/permissions.html"); } if (!$_GET['id']) { die("You have followed an invalid link."); } $mQuery = $mysql->query("SELECT * FROM `threads` WHERE `id` = '" . escape($_GET['id']) . "'"); $mData = $mQuery->fetch_assoc(); if (!$permissions['viewotherthreads'] && $mData['poster'] != $_SESSION['accountid']) { redirect("errors/permissions.html"); } if ($mData['hidden'] && !$permissions['viewhiddenthreads']) { redirect("errors/permissions.html"); } $threadLocked = $mData['locked']; $threadPoster = $mData['poster']; setPageNavigation("thread", $_GET['id']); setPageInfo($mData['title'], "" . $mData['views'] . " views"); $mysql->query("UPDATE `threads` SET `views` = `views` + '1' WHERE `id` = '" . escape($_GET['id']) . "'"); if ($_SESSION['accountid']) { $readQuery = $mysql->query("SELECT `id` FROM `read` WHERE `thread` = '" . escape($_GET['id']) . "' AND `user` = '" . $_SESSION['accountid'] . "'"); if (!$readQuery->num_rows) { $mysql->query("INSERT INTO `read` (`thread`, `user`) VALUES ('" . escape($_GET['id']) . "', '" . $_SESSION['accountid'] . "')"); } if (!$threadLocked) { echo "<button id='commentScrollPost' class='commentScrollPost boxButton'>Comment</button>"; } } echo "<br>"; if ($permissions['votepolls'] && $_POST['votepoll']) { $pollQuery = $mysql->query("SELECT `id`, `voters` FROM `polls` WHERE `thread` = '" . escape($_GET['id']) . "'"); $pollData = $pollQuery->fetch_assoc();
<?php require_once "configuration/main.php"; setPageNavigation("index"); setPageInfo("Lawless Boards", "The new and revolutionary way of creating your forums."); if ($permissions['viewforum']) { $mQuery = $mysql->query("SELECT * FROM `categories` ORDER BY `order` ASC"); while ($mData = $mQuery->fetch_assoc()) { echo "<div class='categoryTitle'>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width='540'>\n\t\t\t\t\t\t\t<a href='category?id=" . $mData['id'] . "'>\n\t\t\t\t\t\t\t\t" . $mData['name'] . "\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td width='130'>\n\t\t\t\t\t\t\tStatistics\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td width='256'>\n\t\t\t\t\t\t\tLast Post\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td data-category='" . $mData['id'] . "' class='hidden categoryCollapse noselect'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</td>\n\t\t\t\t</table>\n\t\t\t</div>"; if ($mData['description']) { echo "<div class='categoryDescription'>\n\t\t\t\t\t" . $mData['description'] . "\n\t\t\t\t</div>"; } echo "<div id='CATEGORY-" . $mData['id'] . "'>"; $sectionQuery = $mysql->query("SELECT * FROM `sections` WHERE `category` = '" . $mData['id'] . "' AND `parent` IS NULL ORDER BY `order` ASC"); while ($sectionData = $sectionQuery->fetch_assoc()) { $threadAmount = 0; $commentAmount = 0; if ($permissions['viewotherthreads']) { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "'"); } else { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "' AND `hidden` != '1'"); } } else { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "' AND `poster` = '" . $_SESSION['accountid'] . "'"); } else { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $sectionData['id'] . "' AND `poster` = '" . $_SESSION['accountid'] . "' AND `hidden` != '1'"); } } while ($threadData = $threadQuery->fetch_assoc()) {
<?php require_once "configuration/main.php"; if (!$permissions['viewforum']) { redirect("errors/permissions.html"); } $mQuery = $mysql->query("SELECT `name`, `description` FROM `sections` WHERE `id` = '" . escape($_GET['id']) . "'"); if ($mQuery->num_rows) { $mData = $mQuery->fetch_assoc(); setPageNavigation("section", $_GET['id']); setPageInfo($mData['name'], $mData['description']); } else { die("You have followed an invalid link."); } $mQuery = $mysql->query("SELECT * FROM `sections` WHERE `parent` = '" . escape($_GET['id']) . "' ORDER BY `order` ASC"); if ($mQuery->num_rows) { echo "<div class='categoryTitle'>\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width='540'>\n\t\t\t\t\t\tSub-Sections\n\t\t\t\t\t</td>\n\n\t\t\t\t\t<td width='100'>\n\t\t\t\t\t\tStatistics\n\t\t\t\t\t</td>\n\n\t\t\t\t\t<td>\n\t\t\t\t\t\tLast Post\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>"; while ($mData = $mQuery->fetch_assoc()) { $threadAmount = 0; $commentAmount = 0; if ($permissions['viewotherthreads']) { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $mData['id'] . "'"); } else { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $mData['id'] . "' AND `hidden` != '1'"); } } else { if ($permissions['viewhiddenthreads']) { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $mData['id'] . "' AND `poster` = '" . $_SESSION['accountid'] . "'"); } else { $threadQuery = $mysql->query("SELECT `id` FROM `threads` WHERE `section` = '" . $mData['id'] . "' AND `poster` = '" . $_SESSION['accountid'] . "' AND `hidden` != '1'");