$fonthead"; print $header; replytoolbar(1); $forumid=$id; if(!$action and $forumid>-1){ print "$fonttag$boardname - ".$forums[$forumid][title]."
"; $posticons=file("posticons.dat"); $i=0; while($posticons[$i]){ $posticonlist.="$radio=iconid value=$i>    "; $i++; if (round($i/10)==($i/10)) {$posticonlist.="
";} } $posticonlist.="
$radio=iconid value=-1 checked=1> None      Custom: $inpt=custposticon SIZE=40 MAXLENGTH=100> "; if($logpwenc and $loguserid and $forums[$id][minpowerthread]>$loguser[7]){ print "$tccell1 Sorry, but you are not allowed to post"; if($loguser[7]==-1) 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 " $tccellha width=150$tccellhb $tccellh  $tccell1User name: $tccell2l$inpt=username VALUE=\"$loguser[2]\" SIZE=25 MAXLENGTH=25> $tccell1Password: $tccell2l$inpp=password VALUE=\"$logpassword\" SIZE=13 MAXLENGTH=32> $tccell1Thread title: $tccell2l$inpt=subject SIZE=40 MAXLENGTH=100> $tccell1Thread icon: $tccell2l$posticonlist $tccell1Post: $tccell2l".replytoolbar(2)."$txta=message ROWS=20 COLS=$numcols ".replytoolbar(3)."> $tccell1 $tccell2l $inph=action VALUE=postthread> $inph=id VALUE=$id> $inps=submitth VALUE=\"The thread is done, now for the poll \"> $inps=preview VALUE=\"Preview thread\"> "; } print "
$fonttag$boardname - ".$forums[$forumid][title]." ".replytoolbar(4); } if($action=="postthread"){ print "
"; $userid=checkuser($username,$password); $user=$users[$userid]; if($user[powerlevel]<0) $userid=-1; if($userid!=-1 and $subject and $message and $user[powerlevel]>=$forums[$forumid][minpowerthread] and $forums[$forumid][title]){ $message=str_replace("\x22",""",$message); $msg=$message; $message=str_replace(""","\x22",$message); $posticons=file("posticons.dat"); $posticon=$posticons[$iconid]; if($iconid==-1) $posticon=""; if($custposticon) $posticon=$custposticon; if($user[signature]) $sign="

--------------------
$user[signature]"; if($user[postheader]) $head=$user[postheader]; if($user[postbg]) $head="
".$head; $numposts=$user[posts]+1; $numdays=(ctime()-$user[regdate])/86400; $head=doreplace($head,$numposts,$numdays,$username); $message=doreplace($message,$numposts,$numdays,$username); $sign=doreplace($sign,$numposts,$numdays,$username); $t--; $s=0; while($smilies[$s][0]){ $smilie=$smilies[$s]; $smile=$smilie[0]; $message=str_replace($smile,"",$message); $head=str_replace($smile,"",$head); $sign=str_replace($smile,"",$sign); $s++; } $message=str_replace($br,"
",$message); if($submit){ $currenttime=ctime(); $postnum=$user[posts]+1; if ($doublevote == "yes") { $doublevote = 1; } else { $doublevote=0; } mysql_query("UPDATE users SET posts=posts+1,lastposttime=$currenttime WHERE id=$userid"); mysql_query("INSERT INTO poll (id,question,briefing,closed,doublevote) VALUES (NULL,'".addslashes($pollquestion)."','".addslashes($pollbriefing)."',0,$doublevote)"); $p=mysql_insert_id(); foreach ($pollchoices as $chid => $data) { $ccolor = $data[color]; print ""; $cname = $data[choice]; mysql_query("INSERT INTO poll_choices (id,poll,choice,color) VALUES (NULL,$p,'".addslashes($cname)."','".addslashes($ccolor)."')"); $moo = mysql_affected_rows(); print ""; } mysql_query("INSERT INTO threads (id,forum,user,views,closed,title,icon,replies,lastpostdate,lastposter,pollid) VALUES (NULL,$id,$userid,0,0,'".addslashes($subject)."','".addslashes($posticon)."',0,$currenttime,$userid,$p)"); $t=mysql_insert_id(); mysql_query("INSERT INTO posts (id,thread,user,date,ip,text,num,headtext,signtext) VALUES (NULL,$t,$userid,$currenttime,'".addslashes($userip)."','".addslashes($message)."',$postnum,'".addslashes($head)."','".addslashes($sign)."')"); mysql_query("UPDATE forums SET numthreads=numthreads+1,numposts=numposts+1,lastpostdate=$currenttime,lastpostuser=$userid WHERE id=$id"); print " $tccell1 Thank you, $user[name], for submitting your new thread and poll.
".redirect("thread.php?id=$t","go to the thread",0)."
"; }elseif($preview){ if($posticon) $posticon1=""; print " $tccell1 This is a preview of your post. Once you're done previewing the post, go back to the previous page to make changes to it, or click on the button below to go on to preparing the poll. $tccell2l$posticon1 $subject
$head$message$sign $tccell1
$inph=username VALUE=\"$username\"> $inph=password VALUE=\"$password\"> $inph=subject VALUE=\"$subject\"> $inph=message VALUE=\"$msg\"> $inph=iconid VALUE=$iconid> $inph=custposticon VALUE=\"$custposticon\"> $inph=action VALUE=postthread> $inph=id VALUE=$id> $inps=submitth VALUE=\"Submit thread and setup the poll\">
"; }elseif($submitth || $removechoice || $addchoice){ // $foo=array_keys($pollchoices); if ($addchoice) { $pollchoices[] = array('color' => $polladdcolor, 'choice' => $polladdchoice); } if ($removechoice) { $pc2 = $pollchoices; foreach($pc2 as $ccid=>$data) { if ($ccid != $torem) { $pc3[$ccid] = $data; } } $pollchoices = $pc3; /* $key_index = array_keys(array_keys($pollchoices), array_pop($removechoice)); array_splice($pollchoices, $key_index[0], 1); */ } print " $tccellha width=250$tccellhb $tccellh  $tccell1a colspan=2>$fonttag Now the thread itself is ready for posting, but before you do that, you will have to enter a few details about the poll and enter choices.
$inph=username VALUE=\"$username\"> $inph=password VALUE=\"$password\"> $inph=subject VALUE=\"$subject\"> $inph=message VALUE=\"$msg\"> $inph=iconid VALUE=$iconid> $inph=torem VALUE=\"\"> $inph=custposticon VALUE=\"$custposticon\"> $inph=action VALUE=postthread> $inph=id VALUE=$id>"; if ($polldbl == "yes") { $doublevote = "$radio=polldbl VALUE=\"yes\" CHECKED> Allow double voting $radio=polldbl VALUE=\"no\"> Don't allow double voting"; } else { $doublevote = "$radio=polldbl VALUE=\"yes\"> Allow double voting $radio=polldbl VALUE=\"no\" CHECKED> Don't allow double voting"; } $tcheader = "$tccellha colspan=2 $tccellhb"; $halfcols = $numcols/2; print "$tcheader Poll setup $tccell1Poll question: $tccell2l$inpt=pollquestion VALUE=\"".aslash($pollquestion)."\"> $tccell1Poll briefing: $tccell2l$txta=pollbriefing ROWS=10 COLS=".$halfcols.">$pollbriefing $tccell1Poll options: $tccell2l$doublevote $tcheader Choice setup"; if (is_array($pollchoices)) { $m = 0; foreach($pollchoices as $cid => $data) { $m++; $choicescode .= "$tccell1Choice ".$m."$tccell2l$inpt=\"pollchoices[$cid][choice]\" VALUE=\"".aslash($data['choice'])."\"> Color: $inpt=\"pollchoices[$cid][color]\" VALUE=\"".aslash($data['color'])."\"> $inps=\"removechoice\" onClick=\"window.document.REPLIER.torem.value='$cid';\" VALUE=\"Remove\">"; } } print "$choicescode $tccell1Add choice$tccell2l$inpt=\"polladdchoice\" VALUE=\"\"> Color: $inpt=\"polladdcolor\" VALUE=\"\"> $inps=addchoice VALUE=\"Add choice\"> $tccell1 $tccell2l$inps=submit VALUE=\"Submit poll and thread\">"; } }else{ print " $tccell1 Couldn't enter the post. Either you didn't enter an existing username, or you haven't entered the right password for the username, or you haven't entered a subject.
".redirect("forum.php?id=$id","return to the forum",0).""; } } print $footer; printtimedif($startingtime); ?>