$tblstart"; if ($_POST['action'] == "trashthread") { if ($ismod || $mods) { mysql_query("UPDATE threads SET sticky=0, closed = 1, forum = 27 WHERE id = '$id'"); $numposts = $thread[replies] + 1; $t1 = mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=$forumid ORDER BY lastpostdate DESC LIMIT 1")); $t2 = mysql_fetch_array(mysql_query("SELECT lastpostdate,lastposter FROM threads WHERE forum=27 ORDER BY lastpostdate DESC LIMIT 1")); mysql_query("UPDATE forums SET numposts=numposts-$numposts,numthreads=numthreads-1,lastpostdate=$t1[lastpostdate],lastpostuser=$t1[lastposter] WHERE id=$forumid"); mysql_query("UPDATE forums SET numposts=numposts+$numposts,numthreads=numthreads+1,lastpostdate=$t2[lastpostdate],lastpostuser=$t2[lastposter] WHERE id=$trashid"); print "THREAD DELETED~! (note to self: add better confirmation page... eventually.)".redirect("thread.php?id=$id", "herp and derp", 0); } } if ($_GET['action'] == 'trashthread') { if ($ismod || $mods) { print "
"; } } if(@mysql_num_rows($mods)) $ismod=1; if(!$action && $ismod) { $thread[icon]=str_replace("\n","",$thread[icon]); $customicon=$thread[icon]; for($i=0;$posticons[$i];){ $posticons[$i]=str_replace($br,"",$posticons[$i]); if($thread[icon]==$posticons[$i]){ $checked='checked=1'; $customicon=''; } $posticonlist.="