aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_ban.php7
-rw-r--r--phpBB/includes/mcp/mcp_forum.php29
-rw-r--r--phpBB/includes/mcp/mcp_front.php31
-rwxr-xr-xphpBB/includes/mcp/mcp_logs.php3
-rw-r--r--phpBB/includes/mcp/mcp_main.php49
-rwxr-xr-xphpBB/includes/mcp/mcp_notes.php12
-rw-r--r--phpBB/includes/mcp/mcp_post.php52
-rw-r--r--phpBB/includes/mcp/mcp_queue.php52
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php43
-rw-r--r--phpBB/includes/mcp/mcp_topic.php49
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php55
11 files changed, 182 insertions, 200 deletions
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index cb6211abda..7289644d39 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -26,12 +26,11 @@ class mcp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Include the admin banning interface...
- include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/acp/acp_ban.' . PHP_EXT);
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
@@ -148,7 +147,7 @@ class mcp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=mcp_ban&field=ban'),
));
if ($mode != 'user')
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index eec428a70b..b0a1de8efa 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -21,12 +21,11 @@ if (!defined('IN_PHPBB'))
*/
function mcp_forum_view($id, $mode, $action, $forum_info)
{
- global $template, $db, $user, $auth, $cache, $module;
- global $phpEx, $phpbb_root_path, $config;
+ global $template, $db, $user, $auth, $cache, $module, $config;
$user->add_lang(array('viewtopic', 'viewforum'));
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
// merge_topic is the quickmod action, merge_topics is the mcp_forum action, and merge_select is the mcp_topic action
$merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false;
@@ -50,7 +49,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$url_extra .= ($GLOBALS['post_id']) ? '&p=' . $GLOBALS['post_id'] : '';
$url_extra .= ($GLOBALS['user_id']) ? '&u=' . $GLOBALS['user_id'] : '';
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?$url_extra");
+ $url = ($url_extra) ? append_sid('mcp', $url_extra) : append_sid('mcp');
// Resync Topics
switch ($action)
@@ -121,8 +120,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id),
'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id),
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
- 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=forum_logs&f=' . $forum_id) : '',
+ 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id),
+ 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid('mcp', 'i=logs&mode=forum_logs&f=' . $forum_id) : '',
'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&start=$start" . (($merge_select) ? $selected_ids : ''),
@@ -255,8 +254,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
if ($row['topic_status'] == ITEM_MOVED)
{
$topic_row = array_merge($topic_row, array(
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_moved_id']}"),
- 'U_DELETE_TOPIC' => ($auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&topic_id_list[]={$row['topic_id']}&mode=forum_view&action=delete_topic") : '',
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', "t={$row['topic_moved_id']}"),
+ 'U_DELETE_TOPIC' => ($auth->acl_get('m_delete', $forum_id)) ? append_sid('mcp', "i=$id&f=$forum_id&topic_id_list[]={$row['topic_id']}&mode=forum_view&action=delete_topic") : '',
'S_MOVED_TOPIC' => true,
'TOPIC_ID' => $row['topic_moved_id'],
));
@@ -272,12 +271,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$u_select_topic = $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids;
}
$topic_row = array_merge($topic_row, array(
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"),
+ 'U_VIEW_TOPIC' => append_sid('mcp', "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"),
'S_SELECT_TOPIC' => ($merge_select && !in_array($row['topic_id'], $source_topic_ids)) ? true : false,
'U_SELECT_TOPIC' => $u_select_topic,
'U_MCP_QUEUE' => $u_mcp_queue,
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid('mcp', 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '',
'TOPIC_ID' => $row['topic_id'],
'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? true : false,
));
@@ -293,7 +292,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
- global $auth, $db, $template, $phpEx, $user, $phpbb_root_path;
+ global $auth, $db, $template, $user;
if (!sizeof($topic_ids))
{
@@ -337,7 +336,7 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
if (!sizeof($topic_ids))
{
@@ -423,14 +422,14 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
// Link to the new topic
- $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, 'MERGE_TOPICS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -439,7 +438,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 707fe22685..4905640754 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_front_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $module;
+ global $template, $db, $user, $auth, $module, $config;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -98,12 +97,12 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_block_vars('unapproved', array(
- 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'i=main&amp;mode=forum_view&amp;f=' . $row['forum_id']) : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'i=main&amp;mode=topic_view&amp;f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['poster_id']),
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_ID' => $row['post_id'],
@@ -117,7 +116,7 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_vars(array(
- 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
+ 'S_MCP_QUEUE_ACTION' => append_sid('mcp', 'i=queue'),
));
if ($total == 0)
@@ -198,11 +197,11 @@ function mcp_front_view($id, $mode, $action)
}
$template->assign_block_vars('report', array(
- 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
- 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
- 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
- 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_POST_DETAILS' => append_sid('mcp', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id'] . "&amp;i=reports&amp;mode=report_details"),
+ 'U_MCP_FORUM' => (!$global_topic) ? append_sid('mcp', 'f=' . $row['forum_id'] . "&amp;i=$id&amp;mode=forum_view") : '',
+ 'U_MCP_TOPIC' => append_sid('mcp', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
+ 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
@@ -273,8 +272,8 @@ function mcp_front_view($id, $mode, $action)
);
}
- $template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));
- make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
+ $template->assign_var('S_MCP_ACTION', append_sid('mcp'));
+ make_jumpbox(append_sid('mcp', 'i=main&amp;mode=forum_view'), 0, false, 'm_', true);
}
?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 6c74e65f5b..3816d2eb17 100755
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -33,8 +33,7 @@ class mcp_logs
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$user->add_lang('acp/common');
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index f000bcc881..470a7f1a62 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -33,8 +33,7 @@ class mcp_main
function main($id, $mode)
{
- global $auth, $db, $user, $template, $action;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $action, $config;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -136,7 +135,7 @@ class mcp_main
switch ($mode)
{
case 'front':
- include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_front.' . PHP_EXT);
$user->add_lang('acp/common');
@@ -147,7 +146,7 @@ class mcp_main
break;
case 'forum_view':
- include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_forum.' . PHP_EXT);
$user->add_lang('viewforum');
@@ -170,7 +169,7 @@ class mcp_main
break;
case 'topic_view':
- include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_topic.' . PHP_EXT);
mcp_topic_view($id, $mode, $action);
@@ -179,7 +178,7 @@ class mcp_main
break;
case 'post_details':
- include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_post.' . PHP_EXT);
mcp_post_details($id, $mode, $action);
@@ -199,7 +198,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if ($action == 'lock' || $action == 'unlock')
{
@@ -265,7 +264,7 @@ function lock_unlock($action, $ids)
confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -284,7 +283,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
// For changing topic types, we only allow operations in one forum.
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'), true);
@@ -511,7 +510,7 @@ function change_topic_type($action, $topic_ids)
}
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -531,7 +530,6 @@ function change_topic_type($action, $topic_ids)
function mcp_move_topic($topic_ids)
{
global $auth, $user, $db, $template;
- global $phpEx, $phpbb_root_path;
// Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
@@ -730,7 +728,7 @@ function mcp_move_topic($topic_ids)
confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -743,8 +741,8 @@ function mcp_move_topic($topic_ids)
$message = $user->lang[$success_msg];
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id") . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$to_forum_id") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f=$forum_id") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', "f=$to_forum_id") . '">', '</a>');
trigger_error($message);
}
@@ -755,7 +753,7 @@ function mcp_move_topic($topic_ids)
*/
function mcp_delete_topic($topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
{
@@ -791,7 +789,7 @@ function mcp_delete_topic($topic_ids)
confirm_box(false, (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -800,7 +798,7 @@ function mcp_delete_topic($topic_ids)
}
else
{
- $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_url = append_sid('viewforum', 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
}
@@ -811,7 +809,7 @@ function mcp_delete_topic($topic_ids)
*/
function mcp_delete_post($post_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path;
+ global $auth, $user, $db;
if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_delete')))
{
@@ -833,7 +831,7 @@ function mcp_delete_post($post_ids)
{
if (!function_exists('delete_posts'))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
// Count the number of topics that are affected
@@ -877,9 +875,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'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
+ $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
}
- $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
+ $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
if (sizeof($post_ids) == 1)
{
@@ -912,7 +910,7 @@ function mcp_delete_post($post_ids)
confirm_box(false, (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -932,7 +930,6 @@ function mcp_delete_post($post_ids)
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
@@ -1202,7 +1199,7 @@ function mcp_fork_topic($topic_ids)
confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -1211,13 +1208,13 @@ function mcp_fork_topic($topic_ids)
}
else
{
- $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
+ $redirect_url = append_sid('viewforum', 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
$return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>');
if ($forum_id != $to_forum_id)
{
- $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $to_forum_id) . '">', '</a>');
+ $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $to_forum_id) . '">', '</a>');
}
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index b4804d56ea..5ca3d8f606 100755
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -33,8 +33,7 @@ class mcp_notes
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$action = request_var('action', array('' => ''));
@@ -49,8 +48,8 @@ class mcp_notes
{
case 'front':
$template->assign_vars(array(
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=notes&amp;mode=user_notes'),
'L_TITLE' => $user->lang['MCP_NOTES'],
));
@@ -72,8 +71,7 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -176,7 +174,7 @@ class mcp_notes
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 8d4ea46e31..e73c2d30ec 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -21,8 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth, $cache, $config;
$user->add_lang('posting');
@@ -40,7 +39,8 @@ function mcp_post_details($id, $mode, $action)
}
$post_info = $post_info[$post_id];
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $extra_url = extra_url();
+ $url = ($extra_url) ? append_sid('mcp', extra_url()) : append_sid('mcp') . '?';
switch ($action)
{
@@ -49,11 +49,11 @@ function mcp_post_details($id, $mode, $action)
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
$ip = request_var('ip', '');
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$template->assign_vars(array(
- 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
- 'U_RETURN_POST' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id"),
+ 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid('mcp', "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
+ 'U_RETURN_POST' => append_sid('mcp', "i=$id&amp;mode=$mode&amp;p=$post_id"),
'L_RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''),
'WHOIS' => user_ipwhois($ip),
));
@@ -130,7 +130,7 @@ function mcp_post_details($id, $mode, $action)
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -178,7 +178,7 @@ function mcp_post_details($id, $mode, $action)
$template->assign_vars(array(
'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1", // Use this for mode paramaters
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
- 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
@@ -191,19 +191,19 @@ function mcp_post_details($id, $mode, $action)
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'),
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp_chgposter&amp;field=username&amp;select_single=true'),
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
@@ -222,7 +222,7 @@ function mcp_post_details($id, $mode, $action)
'POST_ID' => $post_info['post_id'],
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&amp;i=$id&amp;mode=$mode&amp;lookup={$post_info['poster_ip']}#ip" : '',
- 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$post_info['poster_ip']}") : '',
+ 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$post_info['poster_ip']}") : '',
));
// Get User Notes
@@ -274,7 +274,7 @@ function mcp_post_details($id, $mode, $action)
'REASON_TITLE' => $row['reason_title'],
'REASON_DESC' => $row['reason_description'],
'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
- 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']) : '',
+ 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']) : '',
'USER_NOTIFY' => ($row['user_notify']) ? true : false,
'REPORT_TIME' => $user->format_date($row['report_time']),
'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text'])),
@@ -337,8 +337,8 @@ function mcp_post_details($id, $mode, $action)
'NUM_POSTS' => $user_row['postings'],
'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
- 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id),
- 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&amp;sr=topics'))
+ 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&amp;u=' . $user_id),
+ 'U_SEARCHPOSTS' => append_sid('search', 'author_id=' . $user_id . '&amp;sr=topics'))
);
}
}
@@ -367,7 +367,7 @@ function mcp_post_details($id, $mode, $action)
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&amp;i=$id&amp;mode=post_details&amp;rdns={$row['poster_ip']}#ip",
- 'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
+ 'U_WHOIS' => append_sid('mcp', "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
);
}
$db->sql_freeresult($result);
@@ -394,7 +394,7 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db, $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $config;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -467,9 +467,9 @@ function change_poster(&$post_info, $userdata)
// refresh search cache of this post
$search_type = basename($config['search_type']);
- if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ if (file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{
- require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ require(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT);
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 36e937897e..eea00e5660 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -34,9 +34,9 @@ class mcp_queue
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $action;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$forum_id = request_var('f', 0);
$start = request_var('start', 0);
@@ -47,7 +47,7 @@ class mcp_queue
{
case 'approve':
case 'disapprove':
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$post_id_list = request_var('post_id_list', array(0));
@@ -130,7 +130,7 @@ class mcp_queue
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -175,29 +175,29 @@ class mcp_queue
}
}
- $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
- $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']);
+ $post_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']);
+ $topic_url = append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']);
$template->assign_vars(array(
'S_MCP_QUEUE' => true,
- 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
+ 'U_APPROVE_ACTION' => append_sid('mcp', "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => $post_url,
'U_VIEW_TOPIC' => $topic_url,
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
- 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
+ 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid('mcp', 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
@@ -216,7 +216,7 @@ class mcp_queue
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
- 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
+ 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
));
break;
@@ -404,10 +404,10 @@ class mcp_queue
}
$template->assign_block_vars('postrow', array(
- 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
+ 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -452,7 +452,6 @@ class mcp_queue
function approve_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -655,8 +654,8 @@ function approve_post($post_id_list, $id, $mode)
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
- 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
- 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
+ 'U_VIEW_TOPIC' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
+ 'U_VIEW_POST' => generate_board_url() . '/viewtopic.' . PHP_EXT . "?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
);
$messenger->send($post_data['user_notify_type']);
@@ -685,7 +684,7 @@ function approve_post($post_id_list, $id, $mode)
if (sizeof($post_id_list) == 1)
{
$post_data = $post_info[$post_id_list[0]];
- $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
+ $post_url = append_sid('viewtopic', "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
}
unset($post_info);
@@ -723,7 +722,7 @@ function approve_post($post_id_list, $id, $mode)
confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -751,7 +750,6 @@ function approve_post($post_id_list, $id, $mode)
function disapprove_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -886,7 +884,7 @@ function disapprove_post($post_id_list, $id, $mode)
{
if (!function_exists('delete_posts'))
{
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
}
// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
@@ -951,7 +949,7 @@ function disapprove_post($post_id_list, $id, $mode)
}
else
{
- include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
display_reasons($reason_id);
@@ -980,7 +978,7 @@ function disapprove_post($post_id_list, $id, $mode)
confirm_box(false, 'DISAPPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index c837ff0e67..98d66aedff 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -34,9 +34,9 @@ class mcp_reports
function main($id, $mode)
{
global $auth, $db, $user, $template, $cache;
- global $config, $phpbb_root_path, $phpEx, $action;
+ global $config, $action;
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$forum_id = request_var('f', 0);
$start = request_var('start', 0);
@@ -47,7 +47,7 @@ class mcp_reports
{
case 'close':
case 'delete':
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
$report_id_list = request_var('report_id_list', array(0));
@@ -139,7 +139,7 @@ class mcp_reports
if ($post_info['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
@@ -186,28 +186,28 @@ class mcp_reports
$template->assign_vars(array(
'S_MCP_REPORT' => true,
- 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'S_CLOSE_ACTION' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'],
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
- 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
- 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
- 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
- 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
- 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
- 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
- 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
+ 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid('posting', "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '',
+ 'U_MCP_APPROVE' => append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
+ 'U_MCP_REPORTER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
+ 'U_MCP_USER_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
+ 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
+ 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid('mcp', 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
+ 'U_VIEW_POST' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
- 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
+ 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid('mcp', 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'REPORT_DATE' => $user->format_date($report['report_time']),
'REPORT_ID' => $report_id,
@@ -372,9 +372,9 @@ class mcp_reports
}
$template->assign_block_vars('postrow', array(
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
- 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
- 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
+ 'U_VIEWFORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '',
+ 'U_VIEWPOST' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
+ 'U_VIEW_DETAILS' => append_sid('mcp', "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -429,7 +429,6 @@ class mcp_reports
function close_report($report_id_list, $mode, $action)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path;
$sql = 'SELECT r.post_id
FROM ' . REPORTS_TABLE . ' r
@@ -616,7 +615,7 @@ function close_report($report_id_list, $mode, $action)
confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -629,12 +628,12 @@ function close_report($report_id_list, $mode, $action)
$return_forum = '';
if (sizeof($forum_ids == 1))
{
- $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}
$return_topic = '';
if (sizeof($topic_ids == 1))
{
- $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
}
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 2e7f60825d..5c4c1feaad 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -21,10 +21,9 @@ if (!defined('IN_PHPBB'))
*/
function mcp_topic_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth, $cache, $config;
- $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
+ $url = append_sid(PHPBB_ROOT_PATH. 'mcp.' . PHP_EXT . '?' . extra_url());
$user->add_lang('viewtopic');
@@ -77,9 +76,9 @@ function mcp_topic_view($id, $mode, $action)
// Approve posts?
if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id']))
{
- include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_queue.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
if (!sizeof($post_id_list))
{
@@ -140,7 +139,7 @@ function mcp_topic_view($id, $mode, $action)
if ($bbcode_bitfield !== '')
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
@@ -220,7 +219,7 @@ function mcp_topic_view($id, $mode, $action)
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
'POST_ID' => $row['post_id'],
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . $topic_id) . '">', '</a>'),
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
@@ -230,8 +229,8 @@ function mcp_topic_view($id, $mode, $action)
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details" . (($forum_id) ? "&amp;f=$forum_id" : ''),
- 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
+ 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid('mcp', 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid('mcp', 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
);
// Display not already displayed Attachments for this post, we already parsed them. ;)
@@ -253,7 +252,7 @@ function mcp_topic_view($id, $mode, $action)
if ($auth->acl_get('m_split', $topic_info['forum_id']))
{
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
$s_topic_icons = posting_gen_topic_icons('', $icon_id);
// Has the user selected a topic for merge?
@@ -283,10 +282,10 @@ function mcp_topic_view($id, $mode, $action)
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'],
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
+ 'U_VIEW_TOPIC' => append_sid('viewtopic', 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
'TO_TOPIC_ID' => $to_topic_id,
- 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
+ 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid('viewtopic', 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
'SPLIT_SUBJECT' => $subject,
'POSTS_PER_PAGE' => $posts_per_page,
@@ -314,11 +313,11 @@ function mcp_topic_view($id, $mode, $action)
'U_SELECT_TOPIC' => "$url&amp;i=$id&amp;mode=forum_view&amp;action=merge_select" . (($forum_id) ? "&amp;f=$forum_id" : ''),
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
- 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
+ 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
- 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
+ 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid('mcp', "i=$id&amp;t={$topic_info['topic_id']}&amp;mode=$mode&amp;action=$action&amp;to_topic_id=$to_topic_id&amp;posts_per_page=$posts_per_page&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir"), $total, $posts_per_page, $start),
'TOTAL_POSTS' => ($total == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total),
));
}
@@ -328,7 +327,7 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
@@ -492,14 +491,14 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Link back to both topics
- $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, ($action == 'split_all') ? 'SPLIT_TOPIC_ALL' : 'SPLIT_TOPIC_BEYOND', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -508,7 +507,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
@@ -518,7 +517,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $auth;
if (!$to_topic_id)
{
@@ -584,7 +583,7 @@ function merge_posts($topic_id, $to_topic_id)
if ($row)
{
- $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
+ $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
}
else
{
@@ -598,14 +597,14 @@ function merge_posts($topic_id, $to_topic_id)
}
// Link to the new topic
- $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
confirm_box(false, 'MERGE_POSTS', $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = request_var('redirect', 'index.' . PHP_EXT);
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -614,7 +613,7 @@ function merge_posts($topic_id, $to_topic_id)
}
else
{
- meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&amp;t=$to_topic_id"));
+ meta_refresh(3, append_sid('viewtopic', "f=$to_forum_id&amp;t=$to_topic_id"));
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 6751ef41bf..1ca40cb841 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -33,8 +33,7 @@ class mcp_warn
function main($id, $mode)
{
- global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx;
+ global $auth, $db, $user, $template, $config;
$action = request_var('action', array('' => ''));
@@ -76,12 +75,11 @@ class mcp_warn
*/
function mcp_warn_front_view()
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$template->assign_vars(array(
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
- 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user'),
+ 'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
+ 'U_POST_ACTION' => append_sid('mcp', 'i=warn&amp;mode=warn_user'),
));
// Obtain a list of the 5 naughtiest users....
@@ -94,12 +92,12 @@ class mcp_warn
foreach ($highest as $row)
{
$template->assign_block_vars('highest', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
@@ -116,12 +114,12 @@ class mcp_warn
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('latest', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'],
@@ -135,8 +133,7 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$user->add_lang('memberlist');
@@ -164,12 +161,12 @@ class mcp_warn
foreach ($users as $row)
{
$template->assign_block_vars('user', array(
- 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
+ 'U_NOTES' => append_sid('mcp', 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
- 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
+ 'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
@@ -184,7 +181,7 @@ class mcp_warn
'S_SELECT_SORT_DAYS' => $s_limit_days,
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination(append_sid('mcp', "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
));
}
@@ -194,8 +191,7 @@ class mcp_warn
*/
function mcp_warn_post_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
$post_id = request_var('p', 0);
$forum_id = request_var('f', 0);
@@ -260,7 +256,7 @@ class mcp_warn
{
$msg = $user->lang['FORM_INVALID'];
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -274,7 +270,7 @@ class mcp_warn
// Second parse bbcode here
if ($user_row['bbcode_bitfield'])
{
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/bbcode.' . PHP_EXT);
$bbcode = new bbcode($user_row['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
@@ -286,7 +282,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
@@ -306,7 +302,7 @@ class mcp_warn
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
- 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&amp;p=$post_id#p$post_id"),
+ 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&amp;p=$post_id#p$post_id"),
));
}
@@ -315,7 +311,7 @@ class mcp_warn
*/
function mcp_warn_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config, $module;
+ global $config, $module;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
@@ -362,7 +358,7 @@ class mcp_warn
{
$msg = $user->lang['FORM_INVALID'];
}
- $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
+ $redirect = append_sid('mcp', "i=notes&amp;mode=user_notes&amp;u=$user_id");
meta_refresh(2, $redirect);
trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
@@ -370,7 +366,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
}
$rank_title = $rank_img = '';
@@ -400,16 +396,15 @@ class mcp_warn
*/
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $config;
if ($send_pm)
{
- include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_privmsgs.' . PHP_EXT);
+ include_once(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
- $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
- include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
+ $user_row['user_lang'] = (file_exists(PHPBB_ROOT_PATH . 'language/' . $user_row['user_lang'] . '/mcp.' . PHP_EXT)) ? $user_row['user_lang'] : $config['default_lang'];
+ include(PHPBB_ROOT_PATH . 'language/' . basename($user_row['user_lang']) . '/mcp.' . PHP_EXT);
$message_parser = new parse_message();