diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/language/lang_english/lang_main.php | 3 | ||||
-rw-r--r-- | phpBB/modcp.php | 56 | ||||
-rw-r--r-- | phpBB/templates/subSilver/modcp_move.tpl | 1 |
3 files changed, 39 insertions, 21 deletions
diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index 560180c085..f5f9556be6 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -726,6 +726,7 @@ $lang['Confirm_lock_topic'] = "Are you sure you want to lock the selected topic/ $lang['Confirm_unlock_topic'] = "Are you sure you want to unlock the selected topic/s?"; $lang['Confirm_move_topic'] = "Are you sure you want to move the selected topic/s?"; $lang['Move_to_forum'] = "Move to forum"; +$lang['Leave_shadow_topic'] = "Leave shadow topic in old forum."; $lang['Split_Topic'] = "Split Topic Control Panel"; $lang['Split_Topic_explain'] = "Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post"; $lang['Split_title'] = "New topic title"; @@ -1290,4 +1291,4 @@ $lang['Cannot_remove_style'] = "The style you have selected is the current forum // That's all Folks! // ------------------------------------------------- -?>
\ No newline at end of file +?> diff --git a/phpBB/modcp.php b/phpBB/modcp.php index 5475128a22..599798ee19 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -264,23 +264,26 @@ switch($mode) message_die(GENERAL_ERROR, "Could not delete topics", "", __LINE__, __FILE__, $sql); } - $sql = "DELETE - FROM " . POSTS_TABLE . " - WHERE post_id IN ($post_id_sql)"; - if( !$result = $db->sql_query($sql) ) + if( $post_id_sql != '' ) { - message_die(GENERAL_ERROR, "Could not delete posts", "", __LINE__, __FILE__, $sql); - } + $sql = "DELETE + FROM " . POSTS_TABLE . " + WHERE post_id IN ($post_id_sql)"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Could not delete posts", "", __LINE__, __FILE__, $sql); + } - $sql = "DELETE - FROM " . POSTS_TEXT_TABLE . " - WHERE post_id IN ($post_id_sql)"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Could not delete posts text", "", __LINE__, __FILE__, $sql); + $sql = "DELETE + FROM " . POSTS_TEXT_TABLE . " + WHERE post_id IN ($post_id_sql)"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Could not delete posts text", "", __LINE__, __FILE__, $sql); + } } - if( $vote_id_sql != "" ) + if( $vote_id_sql != '' ) { $sql = "DELETE FROM " . VOTE_DESC_TABLE . " @@ -411,12 +414,16 @@ switch($mode) for($i = 0; $i < count($row); $i++) { $topic_id = $row[$i]['topic_id']; - - $sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_last_post_id, topic_moved_id) - VALUES ($old_forum_id, '" . addslashes($row[$i]['topic_title']) . "', '" . $row[$i]['topic_poster'] . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)"; - if( !$result = $db->sql_query($sql) ) + + if( isset($HTTP_POST_VARS['move_leave_shadow']) ) { - message_die(GENERAL_ERROR, "Could not insert new topic", "Error", __LINE__, __FILE__, $sql); + // Insert topic in the old forum that indicates that the forum has moved. + $sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_last_post_id, topic_moved_id) + VALUES ($old_forum_id, '" . addslashes($row[$i]['topic_title']) . "', '" . $row[$i]['topic_poster'] . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Could not insert shadow topic", "Error", __LINE__, __FILE__, $sql); + } } $sql = "UPDATE " . TOPICS_TABLE . " @@ -450,6 +457,10 @@ switch($mode) $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id"); $message = sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>"); } + $return_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id"); + $returnforum = sprintf($lang['Click_return_forum'], "<a href=\"$return_forum_url\">", "</a>"); + + $message = $message . "<br \><br \>$returnforum"; $template->assign_vars(array( "META" => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">') @@ -492,6 +503,7 @@ switch($mode) "MESSAGE_TEXT" => $lang['Confirm_move_topic'], "L_MOVE_TO_FORUM" => $lang['Move_to_forum'], + "L_LEAVESHADOW" => $lang['Leave_shadow_topic'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], @@ -1010,7 +1022,6 @@ switch($mode) WHERE t.forum_id = $forum_id AND t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id - AND t.topic_status <> " . TOPIC_MOVED . " ORDER BY t.topic_type DESC, p.post_time DESC LIMIT $start, " . $board_config['topics_per_page']; @@ -1060,6 +1071,7 @@ switch($mode) $topic_id = $topic_rowset[$i]['topic_id']; $topic_type = $topic_rowset[$i]['topic_type']; + $topic_status = $topic_rowset[$i]['topic_status']; if($topic_type == POST_ANNOUNCE) { @@ -1069,6 +1081,10 @@ switch($mode) { $topic_type = $lang['Topic_Sticky'] . " "; } + else if($topic_status == TOPIC_MOVED) + { + $topic_type = $lang['Topic_Moved'] . " "; + } else { $topic_type = ""; @@ -1117,4 +1133,4 @@ switch($mode) include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/templates/subSilver/modcp_move.tpl b/phpBB/templates/subSilver/modcp_move.tpl index 93cc1dc057..03ba6009ea 100644 --- a/phpBB/templates/subSilver/modcp_move.tpl +++ b/phpBB/templates/subSilver/modcp_move.tpl @@ -17,6 +17,7 @@ </tr> <tr> <td align="center"><span class="gen">{L_MOVE_TO_FORUM} {S_FORUM_BOX}<br /> + <input type="checkbox" name="move_leave_shadow" CHECKED>{L_LEAVESHADOW}<br /> <br /> {MESSAGE_TEXT}</span><br /> <br /> |