} $rFora = Query("select * from {forums} where id={0}", $fid); if (NumRows($rFora)) { $forum = Fetch($rFora); if ($forum['minpower'] > $pl) { if ($forum["id"] == Settings::get("hiddenTrashForum")) { Kill(__("This thread is deleted.")); } else { Kill(__("You are not allowed to browse this forum.")); } } } else { Kill(__("Unknown forum ID.")); } setUrlName("newreply", $tid, $thread["title"]); setUrlName("editthread", $tid, $thread["title"]); $threadtags = ParseThreadTags($thread['title']); $title = $threadtags[0]; Query("update {threads} set views=views+1 where id={0} limit 1", $tid); if (isset($_GET['from'])) { $fromstring = "from=" . (int) $_GET["from"]; } else { $fromstring = ""; } if (isset($_GET['vote'])) { AssertForbidden("vote"); if (!$loguserid) { Kill(__("You can't vote without logging in.")); } if ($thread['closed']) { Kill(__("Poll's closed!"));
} else { Kill("Unknown forum ID."); } $fid = $forum['id']; AssertForbidden("viewForum", $fid); $isHidden = (int) ($forum['minpower'] > 0); if ($forum['minpowerreply'] > $loguser['powerlevel']) { Kill(__("Your power is not enough.")); } if ($thread['closed'] && $loguser['powerlevel'] < 3) { Kill(__("This thread is locked.")); } $OnlineUsersFid = $fid; write("\n\t<script type=\"text/javascript\">\n\t\t\twindow.addEventListener(\"load\", hookUpControls, false);\n\t</script>\n"); $tags = ParseThreadTags($thread['title']); setUrlName("thread", $thread["id"], $thread["title"]); $crumbs = new PipeMenu(); makeForumCrumbs($crumbs, $forum); $crumbs->add(new PipeMenuHtmlEntry(makeThreadLink($thread))); $crumbs->add(new PipeMenuTextEntry(__("New reply"))); makeBreadcrumbs($crumbs); if (!$thread['sticky'] && Settings::get("oldThreadThreshold") > 0 && $thread['lastpostdate'] < time() - 2592000 * Settings::get("oldThreadThreshold")) { Alert(__("You are about to bump an old thread. This is usually a very bad idea. Please think about what you are about to do before you press the Post button.")); } if (isset($_POST['actionpreview'])) { $previewPost['text'] = $_POST["text"]; $previewPost['num'] = $loguser['posts'] + 1; $previewPost['posts'] = $loguser['posts'] + 1; $previewPost['id'] = "_"; $previewPost['options'] = 0; if ($_POST['nopl']) {
AssertForbidden("viewForum", $fid); $pl = $loguser['powerlevel']; if ($pl < 0) { $pl = 0; } $rFora = Query("select * from {forums} where id={0}", $fid); if (NumRows($rFora)) { $forum = Fetch($rFora); if ($forum['minpower'] > $pl) { Kill(__("You are not allowed to browse this forum.")); } } else { Kill(__("Unknown forum ID.")); } $title = $forum['title']; setUrlName("newthread", $fid, $forum["title"]); if ($loguserid) { $isIgnored = FetchResult("select count(*) from {ignoredforums} where uid={0} and fid={1}", $loguserid, $fid) == 1; if (isset($_GET['ignore'])) { if (!$isIgnored) { Query("insert into {ignoredforums} values ({0}, {1})", $loguserid, $fid); } redirectAction("forum", $fid); } else { if (isset($_GET['unignore'])) { if ($isIgnored) { Query("delete from {ignoredforums} where uid={0} and fid={1}", $loguserid, $fid); } redirectAction("forum", $fid); } }
function makeThreadLink($thread) { $tags = ParseThreadTags($thread["title"]); setUrlName("thread", $thread["id"], $tags[0]); $link = actionLinkTag($tags[0], "thread", $thread["id"], "", $tags[0]); $tags = $tags[1]; if (Settings::get("tagsDirection") === 'Left') { return $tags . " " . $link; } else { return $link . " " . $tags; } }
$name = FetchResult("SELECT title FROM {threads} WHERE id={0} LIMIT 1", (int) $_GET["id"]); } if ($page == "forum" || $page == "newthread") { $name = FetchResult("SELECT title FROM {forums} WHERE id={0} LIMIT 1", (int) $_GET["id"]); } $name = urlNamify($name); if ($name != $_GET["rewriteurlname"]) { $valid = false; } } // If URL is not valid, we have to redirect to the correct one! // Only if NOT POST request, though! if (strtoupper($_SERVER['REQUEST_METHOD']) != 'POST' && !$valid) { $params = ""; foreach ($_GET as $key => $val) { if ($key == "rewriteurlname" || $key == "rewritten" || $key == "page" || $key == "id") { continue; } if ($params != "") { $params .= "&"; } $params .= urlencode($key) . "=" . urlencode($val); } $newUrl = actionLink($page, $_GET["id"], $params, $name); header("HTTP/1.1 301 Moved Permanently"); header("Status: 301 Moved Permanently"); die(header("Location: " . $newUrl)); } if (isset($_GET["rewriteurlname"]) && $_GET["rewriteurlname"] != "") { setUrlName($_GET["page"], $_GET["id"], $_GET["rewriteurlname"]); }