From dd9ad539fdab80badedf801a816b8a0beafbbf5c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 6 Jun 2006 20:53:46 +0000 Subject: ok, this one is rather large... the most important change: re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different apart from this, code cleanage, bug fixing, etc. git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_main.php | 45 ++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'phpBB/includes/mcp/mcp_main.php') diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 3f54a1edec..2e9c058bdd 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -15,8 +15,8 @@ */ class mcp_main { - var $p_master; + var $u_action; function mcp_main(&$p_master) { @@ -26,7 +26,7 @@ class mcp_main function main($id, $mode) { global $auth, $db, $user, $template, $action; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; $quickmod = ($mode == 'quickmod') ? true : false; @@ -175,14 +175,7 @@ class mcp_main mcp_post_details($id, $mode, $action); - if ($action == 'whois') - { - $this->tpl_name = 'mcp_whois'; - } - else - { - $this->tpl_name = 'mcp_post'; - } + $this->tpl_name = ($action == 'whois') ? 'mcp_whois' : 'mcp_post'; $this->page_title = 'MCP_MAIN_POST_DETAILS'; break; @@ -197,7 +190,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if ($action == 'lock' || $action == 'unlock') { @@ -268,7 +261,7 @@ function lock_unlock($action, $ids) */ function change_topic_type($action, $topic_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_')))) { @@ -374,7 +367,7 @@ function change_topic_type($action, $topic_ids) function mcp_move_topic($topic_ids) { global $auth, $user, $db, $template; - global $SID, $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_move'))) { @@ -508,8 +501,8 @@ function mcp_move_topic($topic_ids) $message = $user->lang[$success_msg]; $message .= '

' . sprintf($user->lang['RETURN_PAGE'], '', ''); - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], "", ''); - $message .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], "", ''); + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + $message .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); trigger_error($message); } @@ -520,7 +513,7 @@ function mcp_move_topic($topic_ids) */ function mcp_delete_topic($topic_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_delete'))) { @@ -566,8 +559,9 @@ function mcp_delete_topic($topic_ids) } else { - meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); - trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_FORUM'], '', '')); + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_FORUM'], '', '')); } } @@ -576,7 +570,7 @@ function mcp_delete_topic($topic_ids) */ function mcp_delete_post($post_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($post_ids, POSTS_TABLE, 'post_id', 'm_delete'))) { @@ -641,9 +635,9 @@ function mcp_delete_post($post_ids) $return_link = array(); if ($affected_topics == 1 && !$deleted_topics && $topic_id) { - $return_link[] = sprintf($user->lang['RETURN_TOPIC'], "", ''); + $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '', ''); } - $return_link[] = sprintf($user->lang['RETURN_FORUM'], "", ''); + $return_link[] = sprintf($user->lang['RETURN_FORUM'], '', ''); if (sizeof($post_ids) == 1) { @@ -696,7 +690,7 @@ function mcp_delete_post($post_ids) function mcp_fork_topic($topic_ids) { global $auth, $user, $db, $template, $config; - global $SID, $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_'))) { @@ -927,12 +921,13 @@ function mcp_fork_topic($topic_ids) } else { - meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); - $return_link = sprintf($user->lang['RETURN_FORUM'], '', ''); + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + $return_link = sprintf($user->lang['RETURN_FORUM'], '', ''); if ($forum_id != $to_forum_id) { - $return_link .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); + $return_link .= '

' . sprintf($user->lang['RETURN_NEW_FORUM'], '', ''); } trigger_error($user->lang[$success_msg] . '

' . $return_link); -- cgit v1.2.1