had CRLF for some reason. more error cleaning

This commit is contained in:
Xkeeper 2015-08-13 23:20:53 -07:00
parent b4e9133f5f
commit 6ec2907a62

View File

@ -1,354 +1,354 @@
<?php <?php
// die("Disabled."); // die("Disabled.");
require 'lib/function.php'; require 'lib/function.php';
$thread=$sql->fetchq("SELECT forum, closed, sticky,title,lastposter FROM threads WHERE id=$id"); $thread=$sql->fetchq("SELECT forum, closed, sticky,title,lastposter FROM threads WHERE id=$id");
// Stop this insanity. Never index newreply. // Stop this insanity. Never index newreply.
$meta['noindex'] = true; $meta['noindex'] = true;
if (!$thread) { if (!$thread) {
require_once 'lib/layout.php'; require_once 'lib/layout.php';
print " print "
$header<br>$tblstart $header<br>$tblstart
$tccell1>Nice try. Next time, wait until someone makes the thread <i>before</i> trying to reply to it.<br>".redirect("index.php", 'return to the index page', 0)." $tccell1>Nice try. Next time, wait until someone makes the thread <i>before</i> trying to reply to it.<br>".redirect("index.php", 'return to the index page', 0)."
$tblend$footer $tblend$footer
"; ";
printtimedif($startingtime); printtimedif($startingtime);
die(); die();
} }
$forumid=intval($thread[forum]); $forumid=intval($thread['forum']);
$forum=$sql->fetchq("SELECT title,minpower,minpowerreply,id,specialscheme FROM forums WHERE id=$forumid"); $forum=$sql->fetchq("SELECT title,minpower,minpowerreply,id,specialscheme FROM forums WHERE id=$forumid");
if ($forum['minpower'] && $power < $forum['minpower']) { if ($forum['minpower'] && $power < $forum['minpower']) {
$forum['title'] = ''; $forum['title'] = '';
$thread['title'] = '(restricted thread)'; $thread['title'] = '(restricted thread)';
} }
$specialscheme = $forum['specialscheme']; $specialscheme = $forum['specialscheme'];
$windowtitle="$boardname -- $forum[title]: $thread[title] -- New Reply"; $windowtitle="$boardname -- $forum[title]: $thread[title] -- New Reply";
$thread['title']=str_replace('<','&lt;',$thread['title']); $thread['title']=str_replace('<','&lt;',$thread['title']);
require_once 'lib/layout.php'; require_once 'lib/layout.php';
$smilies=readsmilies();
if(!$ppp) $ppp=(!$log?20:$loguser[postsperpage]); $smilies=readsmilies();
$fonline=fonlineusers($forumid); if(!filter_int($ppp)) $ppp=(!$log?20:$loguser['postsperpage']);
$header=makeheader($header1,$headlinks,$header2 ." $tblstart$tccell1s>$fonline$tblend"); $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;
if(mysql_num_rows($sql->query("SELECT user FROM forummods WHERE forum='$forumid' and user='$loguserid'"))) $ismod=1;
if ($ismod) {
if ($thread[sticky] == 1) $sticky = "checked"; $modoptions = "";
$modoptions = " <tr>$tccell1><b>Moderator Options:</b></td>$tccell2l colspan=2>
$inpc=\"close\" id=\"close\" value=\"1\"><label for=\"close\">Close</label> - if ($ismod) {
$inpc=\"stick\" id=\"stick\" value=\"1\" $sticky><label for=\"stick\">Sticky</label>"; if ($thread['sticky'] == 1) $sticky = "checked";
} $modoptions = " <tr>$tccell1><b>Moderator Options:</b></td>$tccell2l colspan=2>
$inpc=\"close\" id=\"close\" value=\"1\"><label for=\"close\">Close</label> -
if ($forum['minpowerreply'] > $power && $forum['minpowerreply'] > 0) $inpc=\"stick\" id=\"stick\" value=\"1\" $sticky><label for=\"stick\">Sticky</label>";
$restricted = true; }
$header = "$header if ($forum['minpowerreply'] > $power && $forum['minpowerreply'] > 0)
$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title]<form action=newreply.php name=replier method=post autocomplete=\"off\"> $tblstart"; $restricted = true;
replytoolbar(1);
$header = "$header
if($log) activitycheck($loguserid); $fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title]<form action=newreply.php name=replier method=post autocomplete=\"off\"> $tblstart";
// Post preview if($log) activitycheck($loguserid);
if (($power>=$forum['minpowerreply'] || $forum['minpowerreply']<1) && $id>0) { // Post preview
$postlist="<tr>$tccellh colspan=2 style=\"font-weight:bold;\">Thread history</tr><tr>$tccellh width=150>User</td>$tccellh width=*>Post</tr>"; if (($power>=$forum['minpowerreply'] || $forum['minpowerreply']<1) && $id>0) {
$qppp = $ppp + 1; $postlist="<tr>$tccellh colspan=2 style=\"font-weight:bold;\">Thread history</tr><tr>$tccellh width=150>User</td>$tccellh width=*>Post</tr>";
$posts=$sql->query("SELECT name,posts,sex,powerlevel,user,text,options,num FROM users u,posts p,posts_text WHERE thread=$id AND p.id=pid AND user=u.id ORDER BY p.id DESC LIMIT $qppp"); $qppp = $ppp + 1;
$i = 0; $posts=$sql->query("SELECT name,posts,sex,powerlevel,user,text,options,num FROM users u,posts p,posts_text WHERE thread=$id AND p.id=pid AND user=u.id ORDER BY p.id DESC LIMIT $qppp");
$i = 0;
while($post=$sql->fetch($posts)){
$bg = ((($i++) & 1) ? 'tdbg2' : 'tdbg1'); while($post=$sql->fetch($posts)){
if ($ppp-- > 0){ $bg = ((($i++) & 1) ? 'tdbg2' : 'tdbg1');
$postnum=($post[num]?"$post[num]/":''); if ($ppp-- > 0){
$tcellbg="<td class='tbl $bg font' valign=top>"; $postnum=($post['num']?"$post[num]/":'');
$namecolor=getnamecolor($post[sex],$post[powerlevel]); $tcellbg="<td class='tbl $bg font' valign=top>";
$postlist.="<tr> $namecolor=getnamecolor($post['sex'],$post['powerlevel']);
$tcellbg<a href=profile.php?id=$post[user]><font $namecolor>$post[name]</font></a>$smallfont<br> $postlist.="<tr>
Posts: $postnum$post[posts]</td> $tcellbg<a href=profile.php?id=$post[user]><font $namecolor>$post[name]</font></a>$smallfont<br>
$tcellbg".doreplace2(dofilters($post[text]), $post[options])."</tr> Posts: $postnum$post[posts]</td>
"; $tcellbg".doreplace2(dofilters($post['text']), $post['options'])."</tr>
} ";
else{ }
$tcellbg="<td bgcolor=$tablebg1 valign=top colspan=2"; else{
$postlist.="<tr>$tccellh colspan=2>This is a long thread. Click <a href=thread.php?id=$id>here</a> to view it.</td></tr>"; $tcellbg="<td bgcolor=$tablebg1 valign=top colspan=2";
} $postlist.="<tr>$tccellh colspan=2>This is a long thread. Click <a href=thread.php?id=$id>here</a> to view it.</td></tr>";
} }
} }
}
if(!$_POST['action'] && !$thread['closed'] && !($banned && $log)
&& ($power>=$forum[minpowerreply] || $forum[minpowerreply]<1) && $id>0) { if(!filter_string($_POST['action']) && !$thread['closed'] && !($banned && $log)
print $header; && ($power>=$forum['minpowerreply'] || $forum['minpowerreply']<1) && $id>0) {
print ""; print $header;
print "";
if ($log) {
$username=$loguser['name']; if ($log) {
$passhint = 'Alternate Login:'; $username=$loguser['name'];
$altloginjs = "<a href=\"#\" onclick=\"document.getElementById('altlogin').style.cssText=''; this.style.cssText='display:none'\">Use an alternate login</a> $passhint = 'Alternate Login:';
<span id=\"altlogin\" style=\"display:none\">"; $altloginjs = "<a href=\"#\" onclick=\"document.getElementById('altlogin').style.cssText=''; this.style.cssText='display:none'\">Use an alternate login</a>
} <span id=\"altlogin\" style=\"display:none\">";
else { }
$username = ''; else {
$passhint = 'Login Info:'; $username = '';
$altloginjs = "<span>"; $passhint = 'Login Info:';
} $altloginjs = "<span>";
}
if($postid){
$post=$sql->fetchq("SELECT user,text,thread FROM posts,posts_text WHERE id=$postid AND id=pid"); $quotemsg = "";
$post['text']=str_replace('<br>',$br,$post[text]); if(filter_int($postid)){
$u=$post['user']; $post=$sql->fetchq("SELECT user,text,thread FROM posts,posts_text WHERE id=$postid AND id=pid");
$users[$u]=loaduser($u,1); $post['text']=str_replace('<br>',$br,$post['text']);
if($post['thread']==$id) $quotemsg="[quote={$users[$u]['name']}]{$post['text']}[/quote]\r\n"; $u=$post['user'];
} $users[$u]=loaduser($u,1);
if($post['thread']==$id) $quotemsg="[quote={$users[$u]['name']}]{$post['text']}[/quote]\r\n";
print " }
<body>
$tccellh width=150>&nbsp</td>$tccellh colspan=2>&nbsp<tr> print "
$tccell1><b>{$passhint}</td> $tccell2l colspan=2> <body>
{$altloginjs} $tccellh width=150>&nbsp</td>$tccellh colspan=2>&nbsp<tr>
<b>Username:</b> $inpt=username VALUE=\"".htmlspecialchars($username)."\" SIZE=25 MAXLENGTH=25 autocomplete=\"off\"> $tccell1><b>{$passhint}</td> $tccell2l colspan=2>
<b>Password:</b> $inpp=password SIZE=13 MAXLENGTH=64 autocomplete=\"off\"> {$altloginjs}
</span><tr> <b>Username:</b> $inpt=username VALUE=\"".htmlspecialchars($username)."\" SIZE=25 MAXLENGTH=25 autocomplete=\"off\">
$tccell1><b>Reply:</td> <b>Password:</b> $inpp=password SIZE=13 MAXLENGTH=64 autocomplete=\"off\">
$tccell2l width=800px valign=top>".replytoolbar(2)." </span><tr>
$txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\" ".replytoolbar(3).">". htmlspecialchars($quotemsg, ENT_QUOTES, "ISO-8859-1") ."</TEXTAREA></td> $tccell1><b>Reply:</td>
$tccell2l width=*>".moodlist($moodid)."</td><tr> $tccell2l width=800px valign=top>".replytoolbar(2)."
<tr> $txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\" ".replytoolbar(3).">". htmlspecialchars($quotemsg, ENT_QUOTES) ."</TEXTAREA></td>
$tccell1>&nbsp</td>$tccell2l colspan=2> $tccell2l width=*>".moodlist(filter_int($moodid))."</td><tr>
$inph=action VALUE=postreply> <tr>
$inph=id VALUE=$id> $tccell1>&nbsp</td>$tccell2l colspan=2>
$inph=valid value=\"". md5($_SERVER['REMOTE_ADDR'] . $id ."sillysaltstring") ."\"> $inph=action VALUE=postreply>
$inps=submit VALUE=\"Submit reply\"> $inph=id VALUE=$id>
$inps=preview VALUE=\"Preview reply\"></td> $inph=valid value=\"". md5($_SERVER['REMOTE_ADDR'] . $id ."sillysaltstring") ."\">
<tr>$tccell1><b>Options:</b></td>$tccell2l colspan=2> $inps=submit VALUE=\"Submit reply\">
$inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"><label for=\"nosmilies\">Disable Smilies</label> - $inps=preview VALUE=\"Preview reply\"></td>
$inpc=\"nolayout\" id=\"nolayout\" value=\"1\"><label for=\"nolayout\">Disable Layout</label> - <tr>$tccell1><b>Options:</b></td>$tccell2l colspan=2>
$inpc=\"nohtml\" id=\"nohtml\" value=\"1\"><label for=\"nohtml\">Disable HTML</label></td></tr> $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"><label for=\"nosmilies\">Disable Smilies</label> -
$modoptions $inpc=\"nolayout\" id=\"nolayout\" value=\"1\"><label for=\"nolayout\">Disable Layout</label> -
$tblend $inpc=\"nohtml\" id=\"nohtml\" value=\"1\"><label for=\"nohtml\">Disable HTML</label></td></tr>
<br> $modoptions
$tblstart$postlist$tblend $tblend
</table> <br>
</form> $tblstart$postlist$tblend
$fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title] </table>
".replytoolbar(4); </form>
} elseif(!$_POST[action]) { $fonttag<a href=index.php>$boardname</a> - <a href=forum.php?id=$forumid>$forum[title]</a> - $thread[title]
print $header; ".replytoolbar(4);
print "$tccell1>You are not allowed to post in this thread. } elseif(!$_POST['action']) {
<br>".redirect("index.php", 'return to the index page', 0)."</table>"; print $header;
} print "$tccell1>You are not allowed to post in this thread.
<br>".redirect("index.php", 'return to the index page', 0)."</table>";
}
if($_POST[action]=='postreply' && !($banned && $log) && $id>0) {
if ($log && !$password)
$userid = $loguserid; if($_POST['action']=='postreply' && !($banned && $log) && $id>0) {
else if ($log && !$password)
$userid = checkuser($username,$password); $userid = $loguserid;
else
/* $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'"); if (stripos($message, "i hate metal man!!") !== false) {
$sql -> query("INSERT INTO `ipbans` SET `ip` = '". $_SERVER['REMOTE_ADDR'] ."', `date` = '". ctime() ."', `reason` = 'NO BONUS'"); 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() .").");
die("Winners don't do drugs!"); $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."; $error='';
else{ if($userid==-1)
$user=@$sql->fetchq("SELECT * FROM users WHERE id=$userid"); $error="Either you didn't enter an existing username, or you haven't entered the right password for the username.";
// if($thread[lastposter]==$userid && $user[powerlevel]<=2) else{
// $error='You already have the last reply in this thread.'; $user=@$sql->fetchq("SELECT * FROM users WHERE id=$userid");
if($thread[closed]) // if($thread['lastposter']==$userid && $user['powerlevel']<=2)
$error='The thread is closed and no more replies can be posted.'; // $error='You already have the last reply in this thread.';
if($user[powerlevel]<$forum[minpowerreply]) if($thread['closed'])
$error='Replying in this forum is restricted, and you are not allowed to post in this forum.'; $error='The thread is closed and no more replies can be posted.';
if(!$message) if($user['powerlevel']<$forum['minpowerreply'])
$error="You didn't enter anything in the post."; $error='Replying in this forum is restricted, and you are not allowed to post in this forum.';
} if(!$message)
if(!$error){ $error="You didn't enter anything in the post.";
activitycheck($userid); }
$sign=$user[signature];
$head=$user[postheader]; if (!$error) {
if($user[postbg]) $head="<div style=background:url($user[postbg]);height=100%>$head"; activitycheck($userid);
$numposts=$user[posts]+ 1; $sign =$user['signature'];
$head =$user['postheader'];
$numdays=(ctime()-$user[regdate])/86400; if($user['postbg']) $head="<div style=background:url($user[postbg]);height=100%>$head";
$tags = array();
$message=doreplace($message,$numposts,$numdays,$username, $tags); $numposts = $user['posts']+ 1;
$tagval = $sql->escape(json_encode($tags));
$rsign=doreplace($sign,$numposts,$numdays,$username); $numdays = (ctime()-$user['regdate'])/86400;
$rhead=doreplace($head,$numposts,$numdays,$username); $tags = array();
$currenttime=ctime(); $message = doreplace($message,$numposts,$numdays,$username, $tags);
if($submit){ $tagval = $sql->escape(json_encode($tags));
$rsign = doreplace($sign,$numposts,$numdays,$username);
if (!(!$x_hacks['host'] && $userid == 715) || true) { $rhead = doreplace($head,$numposts,$numdays,$username);
$currenttime = ctime();
$sql->query("UPDATE `users` SET `posts` = $numposts, `lastposttime` = '$currenttime' WHERE `id` = '$userid'"); if (filter_string($_POST['submit'])) {
if ($nolayout) { if (!(!$x_hacks['host'] && $userid == 715) || true) {
$headid = 0;
$signid = 0; $sql->query("UPDATE `users` SET `posts` = $numposts, `lastposttime` = '$currenttime' WHERE `id` = '$userid'");
} else {
$headid=getpostlayoutid($head); if ($nolayout) {
$signid=getpostlayoutid($sign); $headid = 0;
} $signid = 0;
} else {
$headid=getpostlayoutid($head);
if ($ismod) { $signid=getpostlayoutid($sign);
if ($close) $close = "`closed` = '1',"; }
else $close = "`closed` = '0',";
if ($stick) $stick = "`sticky` = '1',";
else $stick = "`sticky` = '0',"; if ($ismod) {
} if ($close) $close = "`closed` = '1',";
else $close = "`closed` = '0',";
$sql->query("INSERT INTO posts (thread,user,date,ip,num,headid,signid,moodid) VALUES ($id,$userid,$currenttime,'$userip',$numposts,$headid,$signid,'". $_POST['moodid'] ."')"); if ($stick) $stick = "`sticky` = '1',";
$pid=mysql_insert_id(); else $stick = "`sticky` = '0',";
}
$options = intval($nosmilies) . "|" . intval($nohtml);
$sql->query("INSERT INTO posts (thread,user,date,ip,num,headid,signid,moodid) VALUES ($id,$userid,$currenttime,'$userip',$numposts,$headid,$signid,'". $_POST['moodid'] ."')");
if($pid) $sql->query("INSERT INTO `posts_text` (`pid`,`text`,`tagval`, `options`) VALUES ('$pid','$message','$tagval', '$options')"); $pid=mysql_insert_id();
if (in_array($id, array(3424, 3425, 3426, 3816, 4907)) && !$x_hacks['host']) { $options = intval($nosmilies) . "|" . intval($nohtml);
$lastgmpost = $sql -> resultq("SELECT MAX(`id`) FROM `posts` WHERE `user` = '24' AND `thread` = '$id'");
if($pid) $sql->query("INSERT INTO `posts_text` (`pid`,`text`,`tagval`, `options`) VALUES ('$pid','$message','$tagval', '$options')");
if ($id == 3424) {
$inarray = "49, 203, 41, 29"; if (in_array($id, array(3424, 3425, 3426, 3816, 4907)) && !$x_hacks['host']) {
} elseif ($id == 3425) { $lastgmpost = $sql -> resultq("SELECT MAX(`id`) FROM `posts` WHERE `user` = '24' AND `thread` = '$id'");
$inarray = "3, 25, 14, 22";
} elseif ($id == 3426) { if ($id == 3424) {
$inarray = "61, 1, 18, 555"; $inarray = "49, 203, 41, 29";
} elseif ($id == 3816) { } elseif ($id == 3425) {
$inarray = "4, 10, 66, 125"; $inarray = "3, 25, 14, 22";
} elseif ($id == 4907) { } elseif ($id == 3426) {
$inarray = "18, 19, 21, 2"; $inarray = "61, 1, 18, 555";
} } elseif ($id == 3816) {
$inarray = "4, 10, 66, 125";
$playerposts = $sql -> resultq("SELECT COUNT(DISTINCT `user`) FROM `posts` WHERE `user` IN ($inarray) AND `thread` = '$id' AND `id` > '$lastgmpost'"); } elseif ($id == 4907) {
if ($playerposts >= 4) $stick .= " `icon` = 'images/piticon-ok.png',"; $inarray = "18, 19, 21, 2";
else $stick .= " `icon` = 'images/piticon-wait.png',"; }
} $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',";
$sql->query("UPDATE `threads` SET $close $stick `replies` = `replies` + 1, `lastpostdate` = '$currenttime', `lastposter` = '$userid' WHERE `id`='$id'"); else $stick .= " `icon` = 'images/piticon-wait.png',";
$sql->query("UPDATE `forums` SET `numposts` = `numposts` + 1, `lastpostdate` = '$currenttime', `lastpostuser` ='$userid', `lastpostid` = '$pid' WHERE `id`='$forumid'");
}
$sql->query("UPDATE `threadsread` SET `read` = '0' WHERE `tid` = '$id'");
$sql->query("REPLACE INTO threadsread SET `uid` = '$userid', `tid` = '$id', `time` = ". ctime() .", `read` = '1'"); $sql->query("UPDATE `threads` SET $close $stick `replies` = `replies` + 1, `lastpostdate` = '$currenttime', `lastposter` = '$userid' WHERE `id`='$id'");
$sql->query("UPDATE `forums` SET `numposts` = `numposts` + 1, `lastpostdate` = '$currenttime', `lastpostuser` ='$userid', `lastpostid` = '$pid' WHERE `id`='$forumid'");
/* $sql->query("UPDATE `threadsread` SET `read` = '0' WHERE `tid` = '$id'");
print " $sql->query("REPLACE INTO threadsread SET `uid` = '$userid', `tid` = '$id', `time` = ". ctime() .", `read` = '1'");
$tccell1>Reply posted successfully!
<br>".redirect("thread.php?pid=$pid#$pid", $thread[title], 0) .$tblend;
*/ xk_ircout("reply", $user['name'], array(
xk_ircout("reply", $user['name'], array( 'forum' => $forum['title'],
'forum' => $forum['title'], 'fid' => $forumid,
'fid' => $forumid, 'thread' => str_replace("&lt;", "<", $thread['title']),
'thread' => str_replace("&lt;", "<", $thread['title']), 'pid' => $pid,
'pid' => $pid, 'pow' => $forum['minpower'],
'pow' => $forum['minpower'], ));
));
if (in_array($id, array(3426, 4907, 6358)) && !$x_hacks['host'] && false) {
if (in_array($id, array(3426, 4907, 6358)) && !$x_hacks['host'] && false) {
relay_vgg($id, $userid, $username, $message);
relay_vgg($id, $userid, $username, $message);
}
}
return header("Location: thread.php?pid=$pid#$pid");
return header("Location: thread.php?pid=$pid#$pid");
} else {
} else { print "
print " $tccell1>Reply posted successfully!
$tccell1>Reply posted successfully! <br>".redirect("thread.php?id=$id", $thread['title'], 0) .$tblend;
<br>".redirect("thread.php?id=$id", $thread[title], 0) .$tblend; }
} }else{
}else{
loadtlayout(); loadtlayout();
$message = stripslashes($message); $message = stripslashes($message);
$ppost=$user; $ppost=$user;
$ppost[uid]=$userid; $ppost['uid']=$userid;
$ppost[num]=$numposts; $ppost['num']=$numposts;
$ppost[posts]++; $ppost['posts']++;
$ppost[lastposttime]=$currenttime; $ppost['lastposttime']=$currenttime;
$ppost[date]=$currenttime; $ppost['date']=$currenttime;
$ppost[moodid]=$_POST['moodid']; $ppost['moodid']=$_POST['moodid'];
if ($nolayout) { if (filter_bool($nolayout)) {
$ppost[headtext] = ""; $ppost['headtext'] = "";
$ppost[signtext] = ""; $ppost['signtext'] = "";
} else { } else {
$ppost[headtext]=$rhead; $ppost['headtext']=$rhead;
$ppost[signtext]=$rsign; $ppost['signtext']=$rsign;
} }
$ppost[text]=$message; $ppost['text']=$message;
$ppost[options] = $nosmilies . "|" . $nohtml; $ppost['options'] = filter_int($nosmilies) . "|" . filter_int($nohtml);
if($isadmin) $ip=$userip; if($isadmin) $ip=$userip;
$chks = array(); $chks = array("", "", "");
if ($nosmilies) $chks[0] = "checked"; if ($nosmilies) $chks[0] = "checked";
if ($nolayout) $chks[1] = "checked"; if ($nolayout) $chks[1] = "checked";
if ($nohtml) $chks[2] = "checked"; if ($nohtml) $chks[2] = "checked";
print "$header print "$header
<body onload=window.document.REPLIER.message.focus()> <body onload=window.document.REPLIER.message.focus()>
$tccellh>Post preview $tccellh>Post preview
$tblend$tblstart $tblend$tblstart
".threadpost($ppost,1)." ".threadpost($ppost,1)."
$tblend<br>$tblstart $tblend<br>$tblstart
<FORM ACTION=newreply.php NAME=REPLIER METHOD=POST> <FORM ACTION=newreply.php NAME=REPLIER METHOD=POST>
$tccellh width=150>&nbsp</td>$tccellh colspan=2>&nbsp<tr> $tccellh width=150>&nbsp</td>$tccellh colspan=2>&nbsp<tr>
$tccell1><b>Reply:</td> $tccell1><b>Reply:</td>
$tccell2l width=800px valign=top>$txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars($message, ENT_QUOTES, "ISO-8859-1") ."</TEXTAREA></td> $tccell2l width=800px valign=top>$txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars($message, ENT_QUOTES, "ISO-8859-1") ."</TEXTAREA></td>
$tccell2l width=*>".moodlist($moodid)."</td><tr> $tccell2l width=*>".moodlist($moodid)."</td><tr>
$tccell1>&nbsp</td>$tccell2l colspan=2> $tccell1>&nbsp</td>$tccell2l colspan=2>
$inps=submit VALUE=\"Submit reply\"> $inps=submit VALUE=\"Submit reply\">
$inps=preview VALUE=\"Preview reply\"></td> $inps=preview VALUE=\"Preview reply\"></td>
$inph=username VALUE=\"".htmlspecialchars($username)."\"> $inph=username VALUE=\"".htmlspecialchars($username)."\">
$inph=password VALUE=\"".htmlspecialchars($password)."\"> $inph=password VALUE=\"".htmlspecialchars($password)."\">
$inph=valid value=\"". md5($_SERVER['REMOTE_ADDR'] . $id ."sillysaltstring") ."\"> $inph=valid value=\"". md5($_SERVER['REMOTE_ADDR'] . $id ."sillysaltstring") ."\">
$inph=action VALUE=postreply> $inph=action VALUE=postreply>
$inph=id VALUE=$id> $inph=id VALUE=$id>
<tr>$tccell1><b>Options:</b></td>$tccell2l colspan=2> <tr>$tccell1><b>Options:</b></td>$tccell2l colspan=2>
$inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\" $chks[0]><label for=\"nosmilies\">Disable Smilies</label> - $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\" $chks[0]><label for=\"nosmilies\">Disable Smilies</label> -
$inpc=\"nolayout\" id=\"nolayout\" value=\"1\" $chks[1]><label for=\"nolayout\">Disable Layout</label> - $inpc=\"nolayout\" id=\"nolayout\" value=\"1\" $chks[1]><label for=\"nolayout\">Disable Layout</label> -
$inpc=\"nohtml\" id=\"nohtml\" value=\"1\" $chks[2]><label for=\"nohtml\">Disable HTML</label></td></tr> $inpc=\"nohtml\" id=\"nohtml\" value=\"1\" $chks[2]><label for=\"nohtml\">Disable HTML</label></td></tr>
$modoptions $modoptions
$tblend $tblend
</FORM> </FORM>
$tblstart$postlist$tblend $tblstart$postlist$tblend
</td></FORM> </td></FORM>
"; ";
} }
}else }else
print "$header$tccell1>Couldn't enter the post. $error<br>".redirect("thread.php?id=$id", $thread['title'], 0); print "$header$tccell1>Couldn't enter the post. $error<br>".redirect("thread.php?id=$id", $thread['title'], 0);
} }
if($thread[closed]) if($thread['closed'])
print " print "
$tccell1>Sorry, but this thread is closed, and no more replies can be posted in it. $tccell1>Sorry, but this thread is closed, and no more replies can be posted in it.
<br>".redirect("thread.php?id=$id",$thread[title],0); <br>".redirect("thread.php?id=$id",$thread['title'],0);
if($banned and $log) if($banned and $log)
print " print "
$tccell1>Sorry, but you are banned from the board, and can not post. $tccell1>Sorry, but you are banned from the board, and can not post.
<br>".redirect("thread.php?id=$id",$thread[title],0); <br>".redirect("thread.php?id=$id",$thread['title'],0);
print $footer; print $footer;
printtimedif($startingtime); printtimedif($startingtime);
function activitycheck($userid){ function activitycheck($userid){
global $id,$thread,$header,$tblstart,$tccell1,$tblend,$footer,$loguser,$sql; global $id,$thread,$header,$tblstart,$tccell1,$tblend,$footer,$loguser,$sql;
$activity=$sql->resultq("SELECT count(*) FROM posts WHERE user=$userid AND thread=$id AND date>".(ctime()-86400),0,0); $activity=$sql->resultq("SELECT count(*) FROM posts WHERE user=$userid AND thread=$id AND date>".(ctime()-86400),0,0);
// if($activity>=(stristr($thread[title],'ACS ')?5:5000)) // if($activity>=(stristr($thread['title'],'ACS ')?5:5000))
// die("$tblstart$tccell1>You have posted enough in this thread today. Come back later!$tblend$footer"); // die("$tblstart$tccell1>You have posted enough in this thread today. Come back later!$tblend$footer");
$activity=$sql->resultq("SELECT count(*) FROM posts WHERE user=$userid AND date>".(ctime()-300),0,0); $activity=$sql->resultq("SELECT count(*) FROM posts WHERE user=$userid AND date>".(ctime()-300),0,0);
if($activity && $userid == 1079) if($activity && $userid == 1079)
die("$header$tblstart$tccell1>You can only post once every five minutes! Make it count!$tblend$footer"); die("$header$tblstart$tccell1>You can only post once every five minutes! Make it count!$tblend$footer");
} }