fetchq("SELECT forum, closed, sticky,title,lastposter FROM threads WHERE id=$id");
// Stop this insanity. Never index newreply.
$meta['noindex'] = true;
if (!$thread) {
require_once 'lib/layout.php';
print "
$header $tblstart
$tccell1>Nice try. Next time, wait until someone makes the thread before trying to reply to it. ".redirect("index.php", 'return to the index page', 0)."
$tblend$footer
";
printtimedif($startingtime);
die();
}
$forumid=intval($thread['forum']);
$forum=$sql->fetchq("SELECT title,minpower,minpowerreply,id,specialscheme FROM forums WHERE id=$forumid");
if ($forum['minpower'] && $power < $forum['minpower']) {
$forum['title'] = '';
$thread['title'] = '(restricted thread)';
}
$specialscheme = $forum['specialscheme'];
$windowtitle="$boardname -- $forum[title]: $thread[title] -- New Reply";
$thread['title']=str_replace('<','<',$thread['title']);
require_once 'lib/layout.php';
$smilies=readsmilies();
if(!filter_int($ppp)) $ppp=(!$log?20:$loguser['postsperpage']);
$fonline=fonlineusers($forumid);
$header=makeheader($header1,$headlinks,$header2 ." $tblstart$tccell1s>$fonline$tblend");
if(mysql_num_rows($sql->query("SELECT user FROM forummods WHERE forum='$forumid' and user='$loguserid'"))) $ismod=1;
$modoptions = "";
if ($ismod) {
if ($thread['sticky'] == 1) $sticky = "checked";
$modoptions = "
$modoptions
$tblend
$tblstart$postlist$tblend
$fonttag$boardname - $forum[title] - $thread[title]";
} elseif(!$_POST['action']) {
print $header;
print "$tccell1>You are not allowed to post in this thread.
".redirect("index.php", 'return to the index page', 0)."";
}
if ($_POST['action'] == 'postreply' && !($banned && $log) && $id > 0) {
if ($log && !$password)
$userid = $loguserid;
else
$userid = checkuser($username,$password);
$error='';
if ($userid == -1) {
$error = "Either you didn't enter an existing username, or you haven't entered the right password for the username.";
} else {
$user = @$sql->fetchq("SELECT * FROM users WHERE id='$userid'");
if ($thread['closed'])
$error = 'The thread is closed and no more replies can be posted.';
if ($user['powerlevel']<$forum['minpowerreply'])
$error = 'Replying in this forum is restricted, and you are not allowed to post in this forum.';
if (!$message)
$error = "You didn't enter anything in the post.";
}
if (!$error) {
$sign = $user['signature'];
$head = $user['postheader'];
// @TODO: Remove this code
if($user['postbg']) $head="