fetchq("SELECT * FROM forums WHERE id=$id"); $windowtitle = "$boardname -- $forum[title] -- New Thread"; $specialscheme = $forum['specialscheme']; // Stop this insanity. Never index newthread. $meta['noindex'] = true; require 'lib/layout.php'; $forumid=$id; $fonline=fonlineusers($forumid); $header=makeheader($header1,$headlinks,$header2 ." $tblstart$tccell1s>$fonline$tblend"); $smilies=readsmilies(); replytoolbar(1); /* if (false && $id == 27) { //trash forum print "$header
$tblstart $tccell1> No. Stop that, you idiot. $tblend $footer"; die(); } if ($forum['nopolls'] && $poll) { print "$header
$tblstart $tccell1> A for effort, but F for still failing. $tblend $footer"; die(); } */ print $header; if($poll) { $c=1; $d=0; while($chtext[$c+$d] || $c < $_POST['count']) { if($remove[$c+$d]) $d++; else { $choices.="Choice $c: $inpt=chtext[$c] SIZE=30 MAXLENGTH=255 VALUE=\"".stripslashes(htmlspecialchars($chtext[$c+$d]))."\">   Color: $inpt=chcolor[$c] SIZE=7 MAXLENGTH=25 VALUE=\"".stripslashes(htmlspecialchars($chcolor[$c+$d]))."\">   Remove
"; $c++; } } $choices.="Choice $c: $inpt=chtext[$c] SIZE=30 MAXLENGTH=255>   Color: $inpt=chcolor[$c] SIZE=7 MAXLENGTH=25>
$inps=paction VALUE=\"Submit changes\"> and show $inpt=count size=4 maxlength=2 VALUE=\"".stripslashes(htmlspecialchars(($_POST['count']) ? $_POST['count'] : $c))."\"> options"; if($mltvote) $checked1='checked'; else $checked0='checked'; } $posticons=file('posticons.dat'); for($i=0;$posticons[$i];$i++) { if($iconid==$i) $checked='checked'; $posticonlist.="$radio=iconid value=$i $checked>    "; $checked=''; if(($i+1)%10==0) $posticonlist.='
'; } if(!$iconid or $iconid==-1) $checked='checked'; $posticonlist.="
$radio=iconid value=-1 $checked> None      Custom: $inpt=custposticon SIZE=40 MAXLENGTH=100 VALUE=\"". stripslashes($custposticon) ."\"> "; <<<<<<< Updated upstream $subject=htmlspecialchars($subject); $question=htmlspecialchars($question); ======= >>>>>>> Stashed changes if ($nosmilies) $nosmilieschk = " checked"; if ($nohtml) $nohtmlchk = " checked"; if ($nolayout) $nolayoutchk = " checked"; $form=(!$poll?" $tccell1>Thread icon: $tccell2l colspan=2>$posticonlist $tccell1>Thread title:$tccell2l colspan=2>$inpt=subject SIZE=40 MAXLENGTH=100 VALUE=\"". stripslashes($subject) ."\"> $tccell1>Post:$tccell2l width=800px valign=top>".replytoolbar(2)." $txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". stripslashes(htmlspecialchars($message)) ." $tccell2l width=*>".moodlist($moodid)." $tccell1> $tccell2l colspan=2> $inph=action VALUE=postthread> $inph=id VALUE=$id> $inps=submit VALUE=\"Submit thread\"> $inps=preview VALUE=\"Preview thread\"> $tccell1>Options:$tccell2l colspan=2> $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"$nosmilieschk> - $inpc=\"nolayout\" id=\"nolayout\" value=\"1\"$nolayoutchk> - $inpc=\"nohtml\" id=\"nohtml\" value=\"1\"$nohtmlchk> ":" $tccell1>Poll icon: $tccell2l colspan=2>$posticonlist $tccell1>Poll title: $tccell2l colspan=2>$inpt=subject SIZE=40 MAXLENGTH=100 VALUE=\"". htmlspecialchars(stripslashes($subject)) ."\"> $tccell1>Question: $tccell2l colspan=2>$inpt=question SIZE=60 MAXLENGTH=255 VALUE=\"". htmlspecialchars(stripslashes($question)) ."\"> $tccell1>Briefing: $tccell2l colspan=2>$txta=briefing ROWS=2 COLS=$numcols style=\"resize:vertical;\">". htmlspecialchars(stripslashes($briefing)) ." $tccell1>Multi-voting:$tccell2l colspan=2>$radio=mltvote value=0 $checked0> Disabled   $radio=mltvote value=1 $checked1> Enabled $tccell1>Choices: $tccell2l colspan=2>$choices $tccell1>Post:$tccell2l width=800px valign=top>".replytoolbar(2)." $txta=message ROWS=21 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars(stripslashes($message)) ." $tccell2l width=*>".moodlist($moodid)." $tccell1> $tccell2l colspan=2> $inph=action VALUE=postthread> $inph=id VALUE=$id> $inph=poll VALUE=1> $inps=submit VALUE=\"Submit poll\"> $inps=preview VALUE=\"Preview poll\"> $tccell1>Options:$tccell2l colspan=2> $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"$nosmilieschk> - $inpc=\"nolayout\" id=\"nolayout\" value=\"1\"$nolayoutchk> - $inpc=\"nohtml\" id=\"nohtml\" value=\"1\"$nohtmlchk> "); if(!$_POST['action'] or $_POST['paction']) { print " $fonttag$boardname - ".$forum[title]."
$tblstart "; if($log and $forums[$id][minpowerthread]>$power) { print "$tccell1>Sorry, but you are not allowed to post"; if($banned) print ", because you are banned from this board.
".redirect("forum.php?id=$id",'return to the forum',0); else print ' in this restricted forum.
'.redirect('index.php','return to the board',0); } else { if ($log) { $username=$loguser['name']; $passhint = 'Alternate Login:'; $altloginjs = "Use an alternate login "; } else { $username = ''; $passhint = 'Login Info:'; $altloginjs = ""; } print " $tccellh width=150> $tccellh colspan=2>  $tccell1>{$passhint} $tccell2l colspan=2> {$altloginjs} Username: $inpt=username VALUE=\"".htmlspecialchars($username)."\" SIZE=25 MAXLENGTH=25 autocomplete=\"off\"> Password: $inpp=password SIZE=13 MAXLENGTH=64 autocomplete=\"off\"> "; print $form; } print " $fonttag$boardname - ".$forum[title]." ".replytoolbar(4); } if($_POST['action']=='postthread' and !$_POST['paction']) { print "
$tblstart"; if ($log && !$password) $userid = $loguserid; else $userid = checkuser($username,$password); $user=$sql->fetchq("SELECT * FROM users WHERE id=$userid"); if($user['powerlevel']<0) $userid=-1; // can't be posting too fast now $limithit = $user['lastposttime'] < (ctime()-30); // can they post in this forum? $authorized = $user['powerlevel'] >= $forum['minpowerthread']; // does the forum exist? $forumexists = $forum['title']; if($userid!=-1 && $subject && $message && $forumexists && $authorized && $limithit) { $msg=$message; // squot(0,$msg); $sign=$user['signature']; $head=$user['postheader']; // improved post backgrounds if($user['postbg']) { $head = "
$head"; $sign = "$sign
"; } $numposts = $user['posts'] + 1; $numdays = (ctime()-$user['regdate'])/86400; $tags = array(); $msg = doreplace($msg, $numposts, $numdays, $username, $tags); $rsign = doreplace($sign, $numposts, $numdays, $username); $rhead = doreplace($head, $numposts, $numdays, $username); $tagval = $sql->escape(json_encode($tags)); $posticons = file('posticons.dat'); $posticon = $posticons[$iconid]; $currenttime = ctime(); $postnum = $numposts; if($iconid == -1) $posticon=''; if($custposticon) $posticon = $custposticon; if($submit) { mysql_query("UPDATE `users` SET `posts` = $numposts, `lastposttime` = '$currenttime' WHERE `id` = '$userid'"); if (filter_bool($nolayout)) { $headid = 0; $signid = 0; } else { $headid=getpostlayoutid($head); $signid=getpostlayoutid($sign); } mysql_query("INSERT INTO `threads` (`forum`, `user`, `views`, `closed`, `title`, `icon`, `replies`, `firstpostdate`, `lastpostdate`, `lastposter`) ". "VALUES ('$id', '$userid', '0', '0', '$subject', '$posticon', '0', '$currenttime', '$currenttime', '$userid')"); $t = mysql_insert_id(); mysql_query("INSERT INTO `posts` (`thread`, `user`, `date`, `ip`, `num`, `headid`, `signid`, `moodid`) VALUES ('$t', '$userid', '$currenttime', '$userip', '$postnum', '$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', '$msg', '$tagval', '$options')"); mysql_query("UPDATE `forums` SET `numthreads` = `numthreads` + 1, `numposts` = `numposts` + 1, `lastpostdate` = '$currenttime', `lastpostuser` = '$userid', `lastpostid` = '$pid' WHERE id=$id"); if(!$poll) { print " $tccell1>Thread posted successfully!
".redirect("thread.php?id=$t", stripslashes($subject), 0).$tblend; xk_ircout("thread", $user['name'], array( 'forum' => $forum['title'], 'fid' => $forum['id'], 'thread' => str_replace("<", "<", $subject), 'pid' => $pid, 'pow' => $forum['minpower'], )); } else { mysql_query("INSERT INTO `poll` (`question`, `briefing`, `closed`, `doublevote`) VALUES ('$question', '$briefing', '0', '$mltvote')"); $p=mysql_insert_id(); mysql_query("UPDATE `threads` SET `poll` = '$p' where `id` = '$t'"); $c=1; while($chtext[$c]){ mysql_query("INSERT INTO `poll_choices` (`poll`, `choice`, `color`) VALUES ('$p', '$chtext[$c]', '$chcolor[$c]')"); $c++; } print " $tccell1>Poll created successfully!
".redirect("thread.php?id=$t", stripslashes($subject), 0).$tblend; xk_ircout("poll", $user['name'], array( 'forum' => $forum['title'], 'fid' => $forum['id'], 'thread' => str_replace("<", "<", $subject), 'pid' => $pid, 'pow' => $forum['minpower'], )); } } else { if($posticon) $posticon1=""; if($poll) { for($c=1;$chtext[$c];$c++) { $chtext[$c]=stripslashes($chtext[$c]); $chcolor[$c]=stripslashes($chcolor[$c]); $hchoices.="$inph=chtext[$c] VALUE=\"".htmlspecialchars($chtext[$c])."\">$inph=chcolor[$c] VALUE=\"".htmlspecialchars($chcolor[$c]).'">'; $pchoices.=" $tccell1l width=20%>$chtext[$c] $tccell2l width=60%>
 
$tccell1 width=20%>$fonttag ? votes, ??.?% "; } $mlt=($mltvote?'enabled':'disabled'); $subject = htmlspecialchars(stripslashes($subject)); $question = htmlspecialchars(stripslashes($question)); $briefing = htmlspecialchars(stripslashes($briefing)); $pollpreview=" ". $question ." $tccell2ls colspan=3>". $briefing ." $pchoices $tccell2ls colspan=3>Multi-voting is $mlt. $tblend
$tblstart "; <<<<<<< Updated upstream $subject = htmlspecialchars(stripslashes($subject)); $question = htmlspecialchars(stripslashes($question)); $briefing = htmlspecialchars(stripslashes($briefing)); ======= >>>>>>> Stashed changes } loadtlayout(); $ppost=$user; $ppost['uid']=$userid; $ppost['num']=$postnum; $ppost['posts']++; $ppost['lastposttime']=$currenttime; $ppost['date']=$currenttime; //$ppost['headtext']=$rhead; //$ppost['signtext']=$rsign; if ($nolayout) { $ppost['headtext'] = ""; $ppost['signtext'] = ""; } else { $ppost['headtext']=$rhead; $ppost['signtext']=$rsign; } $ppost['moodid']=$_POST['moodid']; $ppost['text']=stripslashes($message); $ppost['options'] = $_POST['nosmilies'] . "|" . $_POST['nohtml']; if($isadmin) $ip=$userip; $threadtype=($poll?'poll':'thread'); print " $tccellh>".($poll?'Poll':'Thread')." preview $tblend$tblstart $pollpreview $tccell2l>$posticon1 ". stripslashes($subject) ." $tblend$tblstart ".threadpost($ppost,1)." $tblend
$tblstart
$tccellh width=150> $tccellh colspan=2>  $inph=username VALUE=\"".htmlspecialchars($username)."\"> $inph=password VALUE=\"".htmlspecialchars($password)."\"> $form
$tblend "; } } else { $reason = "You haven't entered your username and password correctly."; if (!$limithit) $reason = "You are trying to post too rapidly."; if (!$message) $reason = "You haven't entered a message."; if (!$subject) $reason = "You haven't entered a subject."; if (!$authorized) $reason = "You aren't allowed to post in this forum."; print " $tccell1>Couldn't post the thread. $reason
".redirect("forum.php?id=$id", $forum[title], 2).$tblend; } } print $footer; printtimedif($startingtime);