|
From: Paul S. O. <ps...@us...> - 2001-12-11 02:21:54
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv27942
Modified Files:
modcp.php
Log Message:
More updates for Euclid, minor update to subSilver, fixed bug #490798
Index: modcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/modcp.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** modcp.php 2001/12/03 00:23:04 1.49
--- modcp.php 2001/12/11 02:21:51 1.50
***************
*** 490,566 ****
$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( $topic_list != "" )
{
! $topic_list .= ", ";
}
- $topic_list .= $topics[$i];
- }
! $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']) )
{
! // 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 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);
! }
! }
! // Sync the forum indexes
! sync("forum", $new_forum_id);
! sync("forum", $old_forum_id);
if( !empty($topic_id) )
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message = sprintf($lang['Click_return_topic'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
$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(
--- 490,575 ----
$new_forum_id = $HTTP_POST_VARS['new_forum'];
$old_forum_id = $forum_id;
! if( $new_forum_id != $old_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( $topic_list != "" )
! {
! $topic_list .= ", ";
! }
! $topic_list .= $topics[$i];
}
! $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']) )
! {
! // 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 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);
! }
}
! // Sync the forum indexes
! sync("forum", $new_forum_id);
! sync("forum", $old_forum_id);
! $message = $lang['Topics_Moved'] . "<br /><br />";
+ }
+ else
+ {
+ $message = $lang['No_Topics_Moved'] . "<br /><br />";
+ }
+
if( !empty($topic_id) )
{
$redirect_page = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
! $message .= sprintf($lang['Click_return_topic'], "<a href=\"$redirect_page\">", "</a>");
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
! $message .= sprintf($lang['Click_return_modcp'], "<a href=\"$redirect_page\">", "</a>");
}
! $message = $message . "<br \><br \>" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id") . "\">", "</a>");
$template->assign_vars(array(
***************
*** 568,572 ****
);
! message_die(GENERAL_MESSAGE, $lang['Topics_Moved'] . "<br /><br />" . $message);
}
else
--- 577,581 ----
);
! message_die(GENERAL_MESSAGE, $message);
}
else
***************
*** 609,613 ****
"L_NO" => $lang['No'],
! "S_FORUM_BOX" => make_forum_select("new_forum"),
"S_MODCP_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $hidden_fields)
--- 618,622 ----
"L_NO" => $lang['No'],
! "S_FORUM_BOX" => make_forum_select("new_forum", $forum_id),
"S_MODCP_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $hidden_fields)
***************
*** 740,744 ****
$new_topic_id = $db->sql_nextid();
! if($HTTP_POST_VARS['split_type_all'])
{
$post_id_sql = "";
--- 749,753 ----
$new_topic_id = $db->sql_nextid();
! if( $HTTP_POST_VARS['split_type_all'] )
{
$post_id_sql = "";
***************
*** 756,760 ****
WHERE post_id IN ($post_id_sql)";
}
! else if($HTTP_POST_VARS['split_type_beyond'])
{
$sql = "UPDATE " . POSTS_TABLE . "
--- 765,769 ----
WHERE post_id IN ($post_id_sql)";
}
! else if( $HTTP_POST_VARS['split_type_beyond'] )
{
$sql = "UPDATE " . POSTS_TABLE . "
***************
*** 819,827 ****
"L_SPLIT_AFTER" => $lang['Split_after'],
"L_POST_SUBJECT" => $lang['Post_subject'],
"S_SPLIT_ACTION" => append_sid("modcp.$phpEx"),
"S_HIDDEN_FIELDS" => $s_hidden_fields,
!
! "FORUM_INPUT" => make_forum_select("new_forum_id", $forum_id))
);
--- 828,841 ----
"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,
! "S_FORUM_SELECT" => make_forum_select("new_forum_id"))
);
***************
*** 870,874 ****
$message = make_clickable($message);
! if($board_config['allow_smilies'] && $postrow[$i]['enable_smilies'])
{
$message = smilies_pass($message);
--- 884,888 ----
$message = make_clickable($message);
! if( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] )
{
$message = smilies_pass($message);
***************
*** 1156,1158 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
--- 1170,1172 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
! ?>
\ No newline at end of file
|