From 1e11060934f95a1e347179f95497544ddbc29592 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 11 Dec 2001 02:21:52 +0000 Subject: [PATCH] More updates for Euclid, minor update to subSilver, fixed bug #490798 git-svn-id: file:///svn/phpbb/trunk@1550 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 4 +- phpBB/language/lang_english/lang_main.php | 5 +- phpBB/modcp.php | 128 ++++++++++++---------- phpBB/templates/Euclid/modcp_split.tpl | 115 +++++++++++++------ phpBB/templates/subSilver/modcp_split.tpl | 10 +- 5 files changed, 162 insertions(+), 100 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8d5915368c..01ef706e13 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -200,7 +200,7 @@ function make_jumpbox($match_forum_id = 0) // // Simple version of jumpbox, just lists authed forums // -function make_forum_select($box_name) +function make_forum_select($box_name, $ignore_forum = false) { global $db, $userdata; @@ -217,7 +217,7 @@ function make_forum_select($box_name) $forum_list = ""; while( $row = $db->sql_fetchrow($q_forums) ) { - if( $is_auth_ary[$row['forum_id']]['auth_read'] ) + if( $is_auth_ary[$row['forum_id']]['auth_read'] && $ignore_forum != $row['forum_id'] ) { $forum_list .= ""; } diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index f7e8cd541c..815ef56dbf 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -46,7 +46,6 @@ $lang['Forum'] = "Forum"; $lang['Category'] = "Category"; $lang['Topic'] = "Topic"; $lang['Topics'] = "Topics"; -$lang['Reply'] = "Reply"; $lang['Replies'] = "Replies"; $lang['Views'] = "Views"; $lang['Post'] = "Post"; @@ -82,7 +81,6 @@ $lang['No'] = "No"; $lang['Enabled'] = "Enabled"; $lang['Disabled'] = "Disabled"; $lang['Error'] = "Error"; -$lang['Success'] = "Success"; $lang['Next'] = "Next"; $lang['Previous'] = "Previous"; @@ -305,7 +303,6 @@ $lang['Confirm_delete_poll'] = "Are you sure you want to delete this poll?"; $lang['Flood_Error'] = "You cannot make another post so soon after your last, please try again in a short while"; $lang['Empty_subject'] = "You must specify a subject when posting a new topic"; $lang['Empty_message'] = "You must enter a message when posting"; -$lang['Announce_and_sticky'] = "You cannot post a topic that is both an announcement and a sticky topic"; $lang['Forum_locked'] = "This forum is locked you cannot post, reply to or edit topics"; $lang['Topic_locked'] = "This topic is locked you cannot edit posts or make replies"; $lang['No_post_id'] = "You must select a post to edit"; @@ -715,7 +712,6 @@ $lang['You_been_banned'] = "You have been banned from this forum
Please con // // Viewonline // -$lang['Who_is_online'] = "Who is online"; $lang['Reg_users_online'] = "There are %d Registered and "; // There ae 5 Registered and $lang['Hidden_users_online'] = "%d Hidden users online"; // 6 Hidden users online $lang['Guest_users_online'] = "There are %d Guest users online"; // There are 10 Guest users online @@ -754,6 +750,7 @@ $lang['Topics_Removed'] = "The selected topics have been successfully removed fr $lang['Topics_Locked'] = "The selected topics have been locked"; $lang['Topics_Moved'] = "The selected topics have been moved"; $lang['Topics_Unlocked'] = "The selected topics have been unlocked"; +$lang['No_Topics_Moved'] = "No topics were moved"; $lang['Confirm_delete_topic'] = "Are you sure you want to remove the selected topic/s?"; $lang['Confirm_lock_topic'] = "Are you sure you want to lock the selected topic/s?"; diff --git a/phpBB/modcp.php b/phpBB/modcp.php index 0c3ed4d080..8ea50ae0a8 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -489,85 +489,94 @@ switch($mode) { $new_forum_id = $HTTP_POST_VARS['new_forum']; $old_forum_id = $forum_id; - $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id); - $topic_list = ""; - for($i = 0; $i < count($topics); $i++) + if( $new_forum_id != $old_forum_id ) { - if( $topic_list != "" ) + $topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id); + + $topic_list = ""; + for($i = 0; $i < count($topics); $i++) { - $topic_list .= ", "; + if( $topic_list != "" ) + { + $topic_list .= ", "; + } + $topic_list .= $topics[$i]; } - $topic_list .= $topics[$i]; - } - $sql_select = "SELECT * - FROM " . TOPICS_TABLE . " - WHERE topic_id IN ($topic_list)"; + $sql_select = "SELECT * + FROM " . TOPICS_TABLE . " + WHERE topic_id IN ($topic_list)"; - if( !$result = $db->sql_query($sql_select, BEGIN_TRANSACTION) ) - { - message_die(GENERAL_ERROR, "Could not select from topic table!", "Error", __LINE__, __FILE__, $sql_select); - } - - $row = $db->sql_fetchrowset($result); - - for($i = 0; $i < count($row); $i++) - { - $topic_id = $row[$i]['topic_id']; - - if( isset($HTTP_POST_VARS['move_leave_shadow']) ) + if( !$result = $db->sql_query($sql_select, BEGIN_TRANSACTION) ) { - // 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)"; + message_die(GENERAL_ERROR, "Could not select from topic table!", "Error", __LINE__, __FILE__, $sql_select); + } + + $row = $db->sql_fetchrowset($result); + + for($i = 0; $i < count($row); $i++) + { + $topic_id = $row[$i]['topic_id']; + + if( isset($HTTP_POST_VARS['move_leave_shadow']) ) + { + // 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 . " + SET forum_id = $new_forum_id + WHERE topic_id = $topic_id"; if( !$result = $db->sql_query($sql) ) { - message_die(GENERAL_ERROR, "Could not insert shadow topic", "Error", __LINE__, __FILE__, $sql); + message_die(GENERAL_ERROR, "Could not update old topic", "Error", __LINE__, __FILE__, $sql); + } + + $sql = "UPDATE " . POSTS_TABLE . " + SET forum_id = $new_forum_id + WHERE topic_id = $topic_id"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Could not update post topic ids", "Error", __LINE__, __FILE__, $sql); } } - $sql = "UPDATE " . TOPICS_TABLE . " - SET forum_id = $new_forum_id - WHERE topic_id = $topic_id"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Could not update old topic", "Error", __LINE__, __FILE__, $sql); - } + // Sync the forum indexes + sync("forum", $new_forum_id); + sync("forum", $old_forum_id); + + $message = $lang['Topics_Moved'] . "

"; - $sql = "UPDATE " . POSTS_TABLE . " - SET forum_id = $new_forum_id - WHERE topic_id = $topic_id"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Could not update post topic ids", "Error", __LINE__, __FILE__, $sql); - } } - - // Sync the forum indexes - sync("forum", $new_forum_id); - sync("forum", $old_forum_id); + else + { + $message = $lang['No_Topics_Moved'] . "

"; + } if( !empty($topic_id) ) { $redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); - $message = sprintf($lang['Click_return_topic'], "", ""); + $message .= sprintf($lang['Click_return_topic'], "", ""); } else { $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id"); - $message = sprintf($lang['Click_return_modcp'], "", ""); + $message .= sprintf($lang['Click_return_modcp'], "", ""); } - $return_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id"); - $returnforum = sprintf($lang['Click_return_forum'], "", ""); - $message = $message . "

$returnforum"; + $message = $message . "

" . sprintf($lang['Click_return_forum'], "", ""); $template->assign_vars(array( "META" => '') ); - message_die(GENERAL_MESSAGE, $lang['Topics_Moved'] . "

" . $message); + message_die(GENERAL_MESSAGE, $message); } else { @@ -608,7 +617,7 @@ switch($mode) "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], - "S_FORUM_BOX" => make_forum_select("new_forum"), + "S_FORUM_BOX" => make_forum_select("new_forum", $forum_id), "S_MODCP_ACTION" => append_sid("modcp.$phpEx"), "S_HIDDEN_FIELDS" => $hidden_fields) ); @@ -739,7 +748,7 @@ switch($mode) $new_topic_id = $db->sql_nextid(); - if($HTTP_POST_VARS['split_type_all']) + if( $HTTP_POST_VARS['split_type_all'] ) { $post_id_sql = ""; for($i = 0; $i < count($posts); $i++) @@ -755,7 +764,7 @@ switch($mode) SET topic_id = $new_topic_id WHERE post_id IN ($post_id_sql)"; } - else if($HTTP_POST_VARS['split_type_beyond']) + else if( $HTTP_POST_VARS['split_type_beyond'] ) { $sql = "UPDATE " . POSTS_TABLE . " SET topic_id = $new_topic_id @@ -818,11 +827,16 @@ switch($mode) "L_SUBMIT" => $lang['Submit'], "L_SPLIT_AFTER" => $lang['Split_after'], "L_POST_SUBJECT" => $lang['Post_subject'], + "L_MARK_ALL" => $lang['Mark_all'], + "L_UNMARK_ALL" => $lang['Unmark_all'], + + "FORUM_NAME" => $forum_name, + + "U_VIEW_FORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), "S_SPLIT_ACTION" => append_sid("modcp.$phpEx"), "S_HIDDEN_FIELDS" => $s_hidden_fields, - - "FORUM_INPUT" => make_forum_select("new_forum_id", $forum_id)) + "S_FORUM_SELECT" => make_forum_select("new_forum_id")) ); for($i = 0; $i < $total_posts; $i++) @@ -869,7 +883,7 @@ switch($mode) $message = make_clickable($message); - if($board_config['allow_smilies'] && $postrow[$i]['enable_smilies']) + if( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] ) { $message = smilies_pass($message); } @@ -1155,4 +1169,4 @@ switch($mode) include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?> +?> \ No newline at end of file diff --git a/phpBB/templates/Euclid/modcp_split.tpl b/phpBB/templates/Euclid/modcp_split.tpl index f26f3b959f..4949f16ffd 100644 --- a/phpBB/templates/Euclid/modcp_split.tpl +++ b/phpBB/templates/Euclid/modcp_split.tpl @@ -1,12 +1,30 @@ -
+ + + + + +
- - + +
{SITENAME} {L_INDEX} -> {FORUM_NAME}
{L_INDEX} -> {FORUM_NAME}
- +
-
+ + + + + +
@@ -16,62 +34,97 @@ - + - - - - - - - +
{L_SPLIT_TOPIC}
{L_SPLIT_TOPIC_EXPLAIN}
{L_SPLIT_FORUM}{FORUM_INPUT}{S_FORUM_SELECT}
- - - + + + +
 
+ + -
{L_AUTHOR}
+
+
+ + + +
{L_MESSAGE}
{L_AUTHOR}{L_MESSAGE}{L_SELECT}
+ + + + +
- - + - +
+ - - - - + + + +
- +
{postrow.POSTER_NAME}
{postrow.POSTER_NAME}
- +
- - - - +
Post image icon{L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT}

{L_POST_SUBJECT}: {postrow.POST_SUBJECT}
{postrow.MESSAGE}
{postrow.MESSAGE}
  
+ + +
- - + + + + +
  {postrow.POST_DATE}
+ +
{L_SELECT}:
+ + + + + +
+ + + +
 
-{S_HIDDEN_FIELDS} + + + + +
{L_MARK_ALL} :: {L_UNMARK_ALL}
{S_TIMEZONE}
+ +{S_HIDDEN_FIELDS} + + diff --git a/phpBB/templates/subSilver/modcp_split.tpl b/phpBB/templates/subSilver/modcp_split.tpl index b61505e65c..6cca35f5a6 100644 --- a/phpBB/templates/subSilver/modcp_split.tpl +++ b/phpBB/templates/subSilver/modcp_split.tpl @@ -21,7 +21,7 @@
{L_SPLIT_FORUM}{FORUM_INPUT}{S_FORUM_SELECT}
@@ -48,19 +48,17 @@ - + {postrow.MESSAGE}
Post image icon{L_POSTED}: + Post image icon{L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT}

- {postrow.MESSAGE}
  - -  
.