echo "</head><body>"; require "php/topbar.php"; // Get rid of error key so it won't interfere later $forumError = $forums[SP::ERROR]; unset($forums[SP::ERROR]); $threadError = $threads[SP::ERROR]; unset($threads[SP::ERROR]); foreach ($forums as $forum) { $topics[] = $forum[FORUM::TOPIC]; } $topics = array_unique($topics); $crumbs = array(); $crumbs[] = "<a href='index.php'>Home</a>"; $crumbs[] = "<a href='forumview.php'>Forums</a>"; if (isset($_GET['forumid'])) { $ancestryIDs = getForumAncestry($db, $_GET['forumid']); $ancestryError = $ancestryIDs[SP::ERROR]; unset($ancestryIDs[SP::ERROR]); for ($i = count($ancestryIDs) - 1; $i >= 0; --$i) { $info = getForumInfo($db, $_SESSION['id'], $ancestryIDs[$i]); $crumbs[] = "<a href='forumview.php?forumid=" . $info[FORUM::ID] . "'>" . $info[FORUM::NAME] . "</a>"; } } if ($curForumInfo != null) { $crumbs[] = $curForumInfo[FORUM::NAME]; } $breadcrumb = implode(" -> ", $crumbs); echo <<<EOT <div id='breadcrumb'> {$breadcrumb} </div><div class='maindiv'>
// Right now, we don't mind if the user's been logged out. This page doesn't require you to be logged in or anything. if ($loggedUserDetails[SP::ERROR] == ERR::OK) { $postsPerPage = $loggedUserDetails[USER::POSTS_PAGE]; } } $postIDs = getThreadPosts($db, $_GET['threadid']); $errorCode = $postIDs[SP::ERROR]; unset($postIDs[SP::ERROR]); $numPosts = count($postIDs); $parentForumInfo = getForumInfo($db, $_SESSION['id'], $threadInfo[THREAD::FORUM_ID]); $crumbs = array(); $crumbs[] = "<a href='index.php'>Home</a>"; $crumbs[] = "<a href='forumview.php'>Forums</a>"; $crumbs[] = "<a href='forumview.php?forumid=" . $parentForumInfo[FORUM::ID] . "'>" . $parentForumInfo[FORUM::NAME] . "</a>"; if (isset($threadInfo)) { $ancestryIDs = getForumAncestry($db, $threadInfo[THREAD::FORUM_ID]); $ancestryError = $ancestryIDs[SP::ERROR]; unset($ancestryIDs[SP::ERROR]); for ($i = count($ancestryIDs) - 1; $i >= 0; --$i) { $info = getForumInfo($db, $_SESSION['id'], $ancestryIDs[$i]); $crumbs[] = "<a href='forumview.php?forumid=" . $info[FORUM::ID] . "'>" . $info[FORUM::NAME] . "</a>"; } } $crumbs[] = $threadInfo[THREAD::TITLE]; $breadcrumb = implode(" -> ", $crumbs); echo <<<EOT <div id="breadcrumb"> {$breadcrumb} </div> <div class="maindiv"> \t<h2 class='title'>