fetchq("SELECT forum, closed, sticky,title,lastposter FROM threads WHERE id=$id");
// Stop this insanity. Never index newreply.
$meta['noindex'] = true;
// Give failed replies a last-chance to copy and save their work,
// as way too often you'll miss and then it's just gone forever
$lastchance = null;
$redirectTime = 3;
if (v($_POST['message']) !== null) {
$lastchance = "
You can copy and save what you were going to post, if you want:
";
$redirectTime = -1;
}
if (!$thread) {
require_once 'lib/layout.php';
boardmessage("You can't reply to threads that don't exist! ". redirect("index.php", "the forum index", $redirectTime) . $lastchance, "Error");
}
$forumid =intval($thread['forum']);
$forum =$sql->fetchq("SELECT title,minpower,minpowerreply,id,specialscheme FROM forums WHERE id=$forumid");
if ($forum['minpower'] && $power < $forum['minpower']) {
require_once 'lib/layout.php';
boardmessage("You aren't allowed to view this thread. ". redirect("index.php", "the forum index", $redirectTime) . $lastchance, "Error");
}
$specialscheme = $forum['specialscheme'];
$windowtitle = "$boardname -- $forum[title]: $thread[title] -- New reply";
$thread['title'] = str_replace('<','<',$thread['title']);
require_once 'lib/layout.php';
// Do access checks. Can't post while banned...
if ($power < $forum['minpowerreply'] || $banned) {
boardmessage("You aren't allowed to reply to this thread. ". redirect("thread.php?id=$id", "the thread", $redirectTime) . $lastchance, "Error");
}
// ...or in a closed thread
if ($thread['closed']) {
boardmessage("You can't reply to this thread because it is closed. ". redirect("thread.php?id=$id", "the thread", $redirectTime) . $lastchance, "Error");
}
// Check if we are a global moderator, or a local mod of this forum
$modoptions = "";
if ($ismod || mysql_num_rows($sql->query("SELECT user FROM forummods WHERE forum='$forumid' and user='$loguserid'"))) {
$ismod = 1;
$modoptions = "