".$locale['459']."

".$locale['402']."

".$locale['403']."

\n"; closetable(); } if ($step == "delete") { opentable($locale['400']); echo "

\n"; if (!isset($_POST['deletethread'])) { echo "
".$locale['404']."



\n"; } else { $tdata2 = dbarray(dbquery("SELECT thread_id,thread_lastpost,thread_lastuser FROM ".$db_prefix."threads WHERE thread_id='$thread_id'")); $threads_count = dbcount("(forum_id)", "threads", "forum_id='$forum_id'") - 1; $result = dbquery("DELETE FROM ".$db_prefix."posts WHERE thread_id='$thread_id'"); $result = dbquery("DELETE FROM ".$db_prefix."threads WHERE thread_id='$thread_id'"); $result = dbquery("DELETE FROM ".$db_prefix."thread_notify WHERE thread_id='$thread_id'"); $result = dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE thread_id='$thread_id'"); if (dbrows($result) != 0) { while ($attach = dbarray($result)) { unlink(FORUM."attachments/".$attach['attach_name']); } } $result = dbquery("DELETE FROM ".$db_prefix."forum_attachments WHERE thread_id='$thread_id'"); if ($threads_count > 0) { $result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id' AND forum_lastpost='".$tdata2['thread_lastpost']."' AND forum_lastuser='".$tdata2['thread_lastuser']."'"); if (dbrows($result)) { $result = dbquery("SELECT forum_id,post_author,post_datestamp FROM ".$db_prefix."posts WHERE forum_id='$forum_id' ORDER BY post_datestamp DESC LIMIT 1"); $pdata2 = dbarray($result); $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$pdata2['post_datestamp']."', forum_lastuser='".$pdata2['post_author']."' WHERE forum_id='$forum_id'"); } } else { $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='0', forum_lastuser='0' WHERE forum_id='$forum_id'"); } echo $locale['401']."

".$locale['402']."

".$locale['403']."

\n"; } echo "
\n"; closetable(); } if ($step == "lock") { $result = dbquery("UPDATE ".$db_prefix."threads SET thread_locked='1' WHERE thread_id='$thread_id'"); opentable($locale['410']); echo "

".$locale['411']."

".$locale['402']."

".$locale['403']."

\n
\n"; closetable(); } if ($step == "unlock") { $result = dbquery("UPDATE ".$db_prefix."threads SET thread_locked='0' WHERE thread_id='$thread_id'"); opentable($locale['420']); echo "

".$locale['421']."

".$locale['402']."

".$locale['403']."

\n
\n"; closetable(); } if ($step == "sticky") { $result = dbquery("UPDATE ".$db_prefix."threads SET thread_sticky='1' WHERE thread_id='$thread_id'"); opentable($locale['430']); echo "

".$locale['431']."

".$locale['402']."

".$locale['403']."

\n
\n"; closetable(); } if ($step == "nonsticky") { $result = dbquery("UPDATE ".$db_prefix."threads SET thread_sticky='0' WHERE thread_id='$thread_id'"); opentable($locale['440']); echo "

".$locale['441']."

".$locale['402']."

".$locale['403']."

\n"; closetable(); } if ($step == "move") { opentable($locale['450']); if (isset($_POST['move_thread'])) { $new_forum_id = $_POST['new_forum_id']; if (!isset($new_forum_id) || !isNum($new_forum_id)) fallback("../index.php"); $tdata2 = dbarray(dbquery("SELECT thread_id,thread_lastpost,thread_lastuser FROM ".$db_prefix."threads WHERE thread_id='$thread_id'")); $threads_count_old = dbcount("(forum_id)", "threads", "forum_id='$forum_id'") - 1; $threads_count_new = dbcount("(forum_id)", "threads", "forum_id='$new_forum_id'") + 1; $result = dbquery("UPDATE ".$db_prefix."threads SET forum_id='$new_forum_id' WHERE thread_id='$thread_id'"); $result = dbquery("UPDATE ".$db_prefix."posts SET forum_id='$new_forum_id' WHERE thread_id='$thread_id'"); if ($threads_count_old > 0) { $result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id' AND forum_lastpost='".$tdata2['thread_lastpost']."' AND forum_lastuser='".$tdata2['thread_lastuser']."'"); if (dbrows($result)) { $result = dbquery("SELECT forum_id,post_author,post_datestamp FROM ".$db_prefix."posts WHERE forum_id='$forum_id' ORDER BY post_datestamp DESC LIMIT 1"); $pdata2 = dbarray($result); $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$pdata2['post_datestamp']."', forum_lastuser='".$pdata2['post_author']."' WHERE forum_id='$forum_id'"); } } else { $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='0', forum_lastuser='0' WHERE forum_id='$forum_id'"); } if ($threads_count_old > 1) { $result = dbquery("SELECT forum_lastpost FROM ".$db_prefix."forums WHERE forum_id='$new_forum_id'"); $fdata2 = dbarray($result); if ($tdata2['thread_lastpost'] > $fdata['forum_lastpost']) { $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$tdata2['thread_lastpost']."', forum_lastuser='".$tdata2['thread_lastuser']."' WHERE forum_id='$new_forum_id'"); } } else { $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$tdata2['thread_lastpost']."', forum_lastuser='".$tdata2['thread_lastuser']."' WHERE forum_id='$new_forum_id'"); } echo "

".$locale['452']."

".$locale['403']."

\n
\n"; } else { $move_list = ""; $sel = ""; $result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='0' ORDER BY forum_order"); if (dbrows($result) != 0) { while ($data = dbarray($result)) { $result2 = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_cat='".$data['forum_id']."' ORDER BY forum_order"); if (dbrows($result2) != 0) { $move_list .= "\n"; while ($data2 = dbarray($result2)) { if ($forum_id == $data2['forum_id']) { $sel = " selected"; } else { $sel = ""; } $move_list .= "\n"; } $move_list .= "\n"; } } } echo "
".$locale['451']."
\n"; } closetable(); } require_once BASEDIR."side_right.php"; require_once BASEDIR."footer.php"; ?>