Mood avatar: $tccell2l>". moodlist() ."
$tccell1> $tccell2l>
$inph=action VALUE=postreply>
$inph=id VALUE=$id>
$inph=valid value=\"". md5($_SERVER['REMOTE_ADDR'] . $id ."sillysaltstring") ."\">
$inps=submit VALUE=\"Submit reply\">
$inps=preview VALUE=\"Preview reply\">
$tccell1>Options: $tccell2l>
$inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\">Disable Smilies -
$inpc=\"nolayout\" id=\"nolayout\" value=\"1\">Disable Layout -
$inpc=\"nohtml\" id=\"nohtml\" value=\"1\">Disable HTML
$modoptions
$tblend
$tblstart$postlist$tblend
$fonttag$boardname - $forum[title] - $thread[title]
".replytoolbar(4);
} elseif(!$_POST[action]) {
print $header;
print "$tccell1>You are not allowed to post in this thread.";
}
if($_POST[action]=='postreply' && !($banned && $log) && $id>0) {
$userid=checkuser($username,$password);
if (stripos($message, "i hate metal man!!") !== false) {
xk_ircsend("1|". xk(4) ."NO BONUS!". xk() ." Seems that ". xk(11) ."'$username'". xk() ." is another rereg, so I've banned his account (". xk(11) ."$userid". xk() .") and IP (". xk(11) ."$userip". xk() .").");
$sql -> query("UPDATE `users` SET `power` = '-1', `title` = 'Get out.' WHERE `id` = '$userid'");
$sql -> query("INSERT INTO `ipbans` SET `ip` = '". $_SERVER['REMOTE_ADDR'] ."', `date` = '". ctime() ."', `reason` = 'NO BONUS'");
die("Winners don't do drugs!");
}
$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=@mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$userid"));
// if($thread[lastposter]==$userid && $user[powerlevel]<=2)
// $error='You already have the last reply in this thread.';
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){
activitycheck($userid);
$sign=$user[signature];
$head=$user[postheader];
if($user[postbg]) $head=" $head";
$numposts=$user[posts]+1;
$numdays=(ctime()-$user[regdate])/86400;
$message=doreplace($message,$numposts,$numdays,$username);
$rsign=doreplace($sign,$numposts,$numdays,$username);
$rhead=doreplace($head,$numposts,$numdays,$username);
$currenttime=ctime();
if($submit){
if (!(!$x_hacks['host'] && $userid == 715) || true) {
mysql_query("UPDATE `users` SET `posts` = `posts` + 1, `lastposttime` = '$currenttime' WHERE `id` = '$userid'");
if ($nolayout) {
$headid = 0;
$signid = 0;
} else {
$headid=getpostlayoutid($head);
$signid=getpostlayoutid($sign);
}
if ($ismod) {
if ($close) $close = "`closed` = '1',";
else $close = "`closed` = '0',";
if ($stick) $stick = "`sticky` = '1',";
else $stick = "`sticky` = '0',";
}
mysql_query("INSERT INTO posts (thread,user,date,ip,num,headid,signid,moodid) VALUES ($id,$userid,$currenttime,'$userip',$numposts,$headid,$signid,'". $_POST['moodid'] ."')");
$pid=mysql_insert_id();
$options = intval($nosmilies) . "|" . intval($nohtml);
if($pid) mysql_query("INSERT INTO `posts_text` (`pid`,`text`,`tagval`, `options`) VALUES ('$pid','$message','$tagval', '$options')");
if (in_array($id, array(3424, 3425, 3426, 3816, 4907)) && !$x_hacks['host']) {
$lastgmpost = $sql -> resultq("SELECT MAX(`id`) FROM `posts` WHERE `user` = '24' AND `thread` = '$id'");
if ($id == 3424) {
$inarray = "49, 203, 41, 29";
} elseif ($id == 3425) {
$inarray = "3, 25, 14, 22";
} elseif ($id == 3426) {
$inarray = "61, 1, 18, 555";
} elseif ($id == 3816) {
$inarray = "4, 10, 66, 125";
} elseif ($id == 4907) {
$inarray = "18, 19, 21, 2";
}
$playerposts = $sql -> resultq("SELECT COUNT(DISTINCT `user`) FROM `posts` WHERE `user` IN ($inarray) AND `thread` = '$id' AND `id` > '$lastgmpost'");
if ($playerposts >= 4) $stick .= " `icon` = 'images/piticon-ok.png',";
else $stick .= " `icon` = 'images/piticon-wait.png',";
}
mysql_query("UPDATE `threads` SET $close $stick `replies` = `replies` + 1, `lastpostdate` = '$currenttime', `lastposter` = '$userid' WHERE `id`='$id'");
mysql_query("UPDATE `forums` SET `numposts` = `numposts` + 1, `lastpostdate` = '$currenttime', `lastpostuser` ='$userid', `lastpostid` = '$pid' WHERE `id`='$forumid'");
mysql_query("UPDATE `threadsread` SET `read` = '0' WHERE `tid` = '$id'");
mysql_query("REPLACE INTO threadsread SET `uid` = '$userid', `tid` = '$id', `time` = ". ctime() .", `read` = '1'");
/*
print "
$tccell1>Reply posted successfully!
".redirect("thread.php?pid=$pid#$pid", $thread[title], 0) .$tblend;
*/
xk_ircout("reply", $user['name'], array(
'forum' => $forum['title'],
'fid' => $forumid,
'thread' => str_replace("<", "<", $thread['title']),
'pid' => $pid,
'pow' => $forum['minpower'],
));
if (in_array($id, array(3426, 4907, 6358)) && !$x_hacks['host'] && false) {
relay_vgg($id, $userid, $username, $message);
}
return header("Location: thread.php?pid=$pid#$pid");
} else {
print "
$tccell1>Reply posted successfully!
".redirect("thread.php?id=$id", $thread[title], 0) .$tblend;
}
}else{
loadtlayout();
$message = stripslashes($message);
$ppost=$user;
$ppost[uid]=$userid;
$ppost[num]=$numposts;
$ppost[posts]++;
$ppost[lastposttime]=$currenttime;
$ppost[date]=$currenttime;
$ppost[moodid]=$_POST['moodid'];
if ($nolayout) {
$ppost[headtext] = "";
$ppost[signtext] = "";
} else {
$ppost[headtext]=$rhead;
$ppost[signtext]=$rsign;
}
$ppost[text]=$message;
$ppost[options] = $nosmilies . "|" . $nohtml;
if($isadmin) $ip=$userip;
if ($nosmilies) $nosmilieschk = " checked";
if ($nohtml) $nohtmlchk = " checked";
if ($nolayout) $nolayoutchk = " checked";
print "$header
$tccellh>Post preview
$tblend$tblstart
".threadpost($ppost,1)."
$tblend $tblstart