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\">"; 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) ."\"> "; $subject=htmlspecialchars($subject); $question=htmlspecialchars($question); if ($nosmilies) $nosmilieschk = " checked"; if ($nohtml) $nohtmlchk = " checked"; if ($nolayout) $nolayoutchk = " checked"; $form=(!$poll?" $tccell1>Thread icon: $tccell2l>$posticonlist $tccell1>Thread title:$tccell2l>$inpt=subject SIZE=40 MAXLENGTH=100 VALUE=\"". stripslashes($subject) ."\"> $tccell1>Post: $tccell2l>".replytoolbar(2)."$txta=message ROWS=20 COLS=$numcols ".replytoolbar(3).">". stripslashes($message) ." $tccell1>Options:$tccell2l> $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"$nosmilieschk> - $inpc=\"nolayout\" id=\"nolayout\" value=\"1\"$nolayoutchk> - $inpc=\"nohtml\" id=\"nohtml\" value=\"1\"$nohtmlchk> $tccell1> $tccell2l> $inph=action VALUE=postthread> $inph=id VALUE=$id> $inps=submit VALUE=\"Submit thread\"> $inps=preview VALUE=\"Preview thread\"> ":" $tccell1>Poll icon: $tccell2l>$posticonlist $tccell1>Poll title: $tccell2l>$inpt=subject SIZE=40 MAXLENGTH=100 VALUE=\"". stripslashes($subject) ."\"> $tccell1>Question: $tccell2l>$inpt=question SIZE=60 MAXLENGTH=255 VALUE=\"". stripslashes($question) ."\"> $tccell1>Briefing: $tccell2l>$txta=briefing ROWS=2 COLS=$numcols>". stripslashes($briefing) ." $tccell1>Multi-voting:$tccell2l>$radio=mltvote value=0 $checked0> Disabled   $radio=mltvote value=1 $checked1> Enabled $tccell1>Choices: $tccell2l>$choices $tccell1>Post: $tccell2l>".replytoolbar(2)."$txta=message ROWS=20 COLS=$numcols ".replytoolbar(3).">". stripslashes($message) ." $tccell1>Options:$tccell2l> $inpc=\"nosmilies\" id=\"nosmilies\" value=\"1\"$nosmilieschk> - $inpc=\"nolayout\" id=\"nolayout\" value=\"1\"$nolayoutchk> - $inpc=\"nohtml\" id=\"nohtml\" value=\"1\"$nohtmlchk> $tccell1> $tccell2l> $inph=action VALUE=postthread> $inph=id VALUE=$id> $inph=poll VALUE=1> $inps=submit VALUE=\"Submit poll\"> $inps=preview VALUE=\"Preview poll\"> "); if(!$_POST[action] or $_POST[paction]){ print " $tblstart$tccell1s>$fonline$tblend $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{ print " $tccellh width=150> $tccellh>  $tccell1>User name: $tccell2l>$inpt=username VALUE=\"".htmlspecialchars($loguser[name])."\" SIZE=25 MAXLENGTH=25> $tccell1>Password: $tccell2l>$inpp=password VALUE=\"".htmlspecialchars($logpassword)."\" SIZE=13 MAXLENGTH=32> "; print $form; } print " $fonttag$boardname - ".$forum[title]." ".replytoolbar(4); } if($_POST[action]=='postthread' and !$_POST[paction]){ print "
$tblstart"; $userid=checkuser($username,$password); $user=mysql_fetch_array(mysql_query("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,$message); $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; $msg = doreplace($msg, $numposts, $numdays, $username); $rsign = doreplace($sign, $numposts, $numdays, $username); $rhead = doreplace($head, $numposts, $numdays, $username); $posticons = file('posticons.dat'); $posticon = $posticons[$iconid]; $currenttime = ctime(); $postnum = $user[posts] + 1; if($iconid == -1) $posticon=''; if($custposticon) $posticon = $custposticon; if($submit) { mysql_query("UPDATE `users` SET `posts` = `posts` + 1, `lastposttime` = '$currenttime' WHERE `id` = '$userid'"); $headid=getpostlayoutid($head); $signid=getpostlayoutid($sign); mysql_query("INSERT INTO `threads` (`forum`, `user`, `views`, `closed`, `title`, `icon`, `replies`, `lastpostdate`, `lastposter`) VALUES ('$id', '$userid', '0', '0', '$subject', '$posticon', '0', '$currenttime', '$userid')"); $t = mysql_insert_id(); mysql_query("INSERT INTO `posts` (`thread`, `user`, `date`, `ip`, `num`, `headid`, `signid`) VALUES ('$t', '$userid', '$currenttime', '$userip', '$postnum', '$headid', '$signid')"); $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 WHERE id=$id"); if(!$poll) print " $tccell1>Thread posted successfully!
".redirect("thread.php?id=$t", stripslashes($subject), 0).$tblend; 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; } }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'); $pollpreview=" $question $tccell2ls colspan=3>$briefing $pchoices $tccell2ls colspan=3>Multi-voting is $mlt. $tblend
$tblstart "; $subject = htmlspecialchars(stripslashes($subject)); $question = htmlspecialchars(stripslashes($question)); $briefing = htmlspecialchars(stripslashes($briefing)); } 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[text]=$message; $ppost[options] = $nosmilies . "|" . $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>  $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); ?>