aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/modules/mcp
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-02-22 15:29:18 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-02-22 15:29:18 +0000
commit794c5749696c9fa2595ed3a1d7c836a0d984e11c (patch)
tree37aab2f0f965ddcaeb1d26af753095f59a6e025c /phpBB/modules/mcp
parent7aced345c5a2871f6eddfe316297b4ff9a0ebb76 (diff)
downloadforums-794c5749696c9fa2595ed3a1d7c836a0d984e11c.tar
forums-794c5749696c9fa2595ed3a1d7c836a0d984e11c.tar.gz
forums-794c5749696c9fa2595ed3a1d7c836a0d984e11c.tar.bz2
forums-794c5749696c9fa2595ed3a1d7c836a0d984e11c.tar.xz
forums-794c5749696c9fa2595ed3a1d7c836a0d984e11c.zip
remove global and change $user-> to phpbb::$user->
git-svn-id: file:///svn/phpbb/trunk@9334 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/modules/mcp')
-rw-r--r--phpBB/modules/mcp/mcp_ban.php32
-rw-r--r--phpBB/modules/mcp/mcp_forum.php52
-rw-r--r--phpBB/modules/mcp/mcp_front.php26
-rw-r--r--phpBB/modules/mcp/mcp_logs.php18
-rw-r--r--phpBB/modules/mcp/mcp_main.php84
-rw-r--r--phpBB/modules/mcp/mcp_notes.php28
-rw-r--r--phpBB/modules/mcp/mcp_post.php44
-rw-r--r--phpBB/modules/mcp/mcp_queue.php59
-rw-r--r--phpBB/modules/mcp/mcp_reports.php57
-rw-r--r--phpBB/modules/mcp/mcp_topic.php54
-rw-r--r--phpBB/modules/mcp/mcp_warn.php53
11 files changed, 226 insertions, 281 deletions
diff --git a/phpBB/modules/mcp/mcp_ban.php b/phpBB/modules/mcp/mcp_ban.php
index 35535711e2..a5680dcbff 100644
--- a/phpBB/modules/mcp/mcp_ban.php
+++ b/phpBB/modules/mcp/mcp_ban.php
@@ -25,8 +25,6 @@ class mcp_ban
function main($id, $mode)
{
- global $db, $user, $auth, $template;
-
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
// Include the admin banning interface...
@@ -36,7 +34,7 @@ class mcp_ban
$unbansubmit = phpbb_request::is_set_post('unbansubmit');
$current_time = time();
- $user->add_lang(array('acp/ban', 'acp/users'));
+ phpbb::$user->add_lang(array('acp/ban', 'acp/users'));
$this->tpl_name = 'mcp_ban';
// Ban submitted?
@@ -62,11 +60,11 @@ class mcp_ban
{
user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
- trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ trigger_error(phpbb::$user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . phpbb::$user->lang['BACK_TO_PREV'] . '</a>');
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ confirm_box(false, phpbb::$user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'mode' => $mode,
'ban' => $ban,
'bansubmit' => true,
@@ -88,11 +86,11 @@ class mcp_ban
{
user_unban($mode, $ban);
- trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ trigger_error(phpbb::$user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . phpbb::$user->lang['BACK_TO_PREV'] . '</a>');
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ confirm_box(false, phpbb::$user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'mode' => $mode,
'unbansubmit' => true,
'unban' => $ban)));
@@ -101,7 +99,7 @@ class mcp_ban
}
// Ban length options
- $ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -&gt; ');
+ $ban_end_text = array(0 => phpbb::$user->lang['PERMANENT'], 30 => phpbb::$user->lang['30_MINS'], 60 => phpbb::$user->lang['1_HOUR'], 360 => phpbb::$user->lang['6_HOURS'], 1440 => phpbb::$user->lang['1_DAY'], 10080 => phpbb::$user->lang['7_DAYS'], 20160 => phpbb::$user->lang['2_WEEKS'], 40320 => phpbb::$user->lang['1_MONTH'], -1 => phpbb::$user->lang['UNTIL'] . ' -&gt; ');
$ban_end_options = '';
foreach ($ban_end_text as $length => $text)
@@ -110,26 +108,26 @@ class mcp_ban
}
// Define language vars
- $this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
+ $this->page_title = phpbb::$user->lang[strtoupper($mode) . '_BAN'];
- $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN'];
- $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN'];
- $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN'];
- $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
- $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED'];
+ $l_ban_explain = phpbb::$user->lang[strtoupper($mode) . '_BAN_EXPLAIN'];
+ $l_ban_exclude_explain = phpbb::$user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN'];
+ $l_unban_title = phpbb::$user->lang[strtoupper($mode) . '_UNBAN'];
+ $l_unban_explain = phpbb::$user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
+ $l_no_ban_cell = phpbb::$user->lang[strtoupper($mode) . '_NO_BANNED'];
switch ($mode)
{
case 'user':
- $l_ban_cell = $user->lang['USERNAME'];
+ $l_ban_cell = phpbb::$user->lang['USERNAME'];
break;
case 'ip':
- $l_ban_cell = $user->lang['IP_HOSTNAME'];
+ $l_ban_cell = phpbb::$user->lang['IP_HOSTNAME'];
break;
case 'email':
- $l_ban_cell = $user->lang['EMAIL_ADDRESS'];
+ $l_ban_cell = phpbb::$user->lang['EMAIL_ADDRESS'];
break;
}
diff --git a/phpBB/modules/mcp/mcp_forum.php b/phpBB/modules/mcp/mcp_forum.php
index 346d29d34b..d1048a8803 100644
--- a/phpBB/modules/mcp/mcp_forum.php
+++ b/phpBB/modules/mcp/mcp_forum.php
@@ -21,9 +21,9 @@ if (!defined('IN_PHPBB'))
*/
function mcp_forum_view($id, $mode, $action, $forum_info)
{
- global $template, $db, $user, $auth, $module;
+ global $module;
- $user->add_lang(array('viewtopic', 'viewforum'));
+ phpbb::$user->add_lang(array('viewtopic', 'viewforum'));
include_once(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
@@ -105,10 +105,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'FORUM_NAME' => $forum_info['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($forum_info['forum_desc'], $forum_info['forum_desc_uid'], $forum_info['forum_desc_bitfield'], $forum_info['forum_desc_options']),
- 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
- 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
- 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
- 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
+ 'REPORTED_IMG' => phpbb::$user->img('icon_topic_reported', 'TOPIC_REPORTED'),
+ 'UNAPPROVED_IMG' => phpbb::$user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'LAST_POST_IMG' => phpbb::$user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+ 'NEWEST_POST_IMG' => phpbb::$user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id),
'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id),
@@ -130,7 +130,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'PAGINATION' => generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;sd=$sort_dir&amp;sk=$sort_key&amp;st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
- 'TOTAL_TOPICS' => ($forum_topics == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $forum_topics),
+ 'TOTAL_TOPICS' => ($forum_topics == 1) ? phpbb::$user->lang['VIEW_FORUM_TOPIC'] : sprintf(phpbb::$user->lang['VIEW_FORUM_TOPICS'], $forum_topics),
));
// Grab icons
@@ -140,7 +140,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
if (phpbb::$config['load_db_lastread'])
{
- $read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')';
+ $read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . phpbb::$user->data['user_id'] . ')';
$read_tracking_select = ', tt.mark_time';
}
else
@@ -222,13 +222,13 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
$topic_row = array(
- 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
- 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
- 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, 'src'),
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? phpbb::$user->img('icon_topic_attach', 'TOTAL_ATTACHMENTS') : '',
+ 'TOPIC_FOLDER_IMG' => phpbb::$user->img($folder_img, $folder_alt),
+ 'TOPIC_FOLDER_IMG_SRC' => phpbb::$user->img($folder_img, $folder_alt, 'src'),
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
+ 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? phpbb::$user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -243,10 +243,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title,
'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'],
- 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
- 'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
+ 'LAST_POST_TIME' => phpbb::$user->format_date($row['topic_last_post_time']),
+ 'FIRST_POST_TIME' => phpbb::$user->format_date($row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
- 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
+ 'LAST_VIEW_TIME' => phpbb::$user->format_date($row['topic_last_view_time']),
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
@@ -295,8 +295,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
- global $auth, $db, $template, $user;
-
if (!sizeof($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
@@ -324,12 +322,12 @@ function mcp_resync_topics($topic_ids)
}
$db->sql_freeresult($result);
- $msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
+ $msg = (sizeof($topic_ids) == 1) ? phpbb::$user->lang['TOPIC_RESYNC_SUCCESS'] : phpbb::$user->lang['TOPICS_RESYNC_SUCCESS'];
- $redirect = request_var('redirect', $user->data['session_page']);
+ $redirect = request_var('redirect', phpbb::$user->data['session_page']);
meta_refresh(3, $redirect);
- trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error($msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
return;
}
@@ -339,16 +337,14 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $auth;
-
if (!sizeof($topic_ids))
{
- $template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_TOPIC_SELECTED']);
return;
}
if (!$to_topic_id)
{
- $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
@@ -356,7 +352,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
if (!sizeof($topic_data))
{
- $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
@@ -382,7 +378,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
if (!sizeof($post_id_list))
{
- $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_POST_SELECTED']);
return;
}
@@ -425,7 +421,7 @@ 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('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf(phpbb::$user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
@@ -442,7 +438,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
else
{
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);
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/modules/mcp/mcp_front.php b/phpBB/modules/mcp/mcp_front.php
index ad30774e2f..95b12e9a7b 100644
--- a/phpBB/modules/mcp/mcp_front.php
+++ b/phpBB/modules/mcp/mcp_front.php
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_front_view($id, $mode, $action)
{
- global $template, $db, $user, $auth, $module;
+ global $module;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -108,11 +108,11 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']),
'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : phpbb::$user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_ID' => $row['post_id'],
'TOPIC_TITLE' => $row['topic_title'],
- 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
- 'POST_TIME' => $user->format_date($row['post_time']))
+ 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : phpbb::$user->lang['NO_SUBJECT'],
+ 'POST_TIME' => phpbb::$user->format_date($row['post_time']))
);
}
$db->sql_freeresult($result);
@@ -125,14 +125,14 @@ function mcp_front_view($id, $mode, $action)
if ($total == 0)
{
$template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => $user->lang['UNAPPROVED_POSTS_ZERO_TOTAL'],
+ 'L_UNAPPROVED_TOTAL' => phpbb::$user->lang['UNAPPROVED_POSTS_ZERO_TOTAL'],
'S_HAS_UNAPPROVED_POSTS' => false)
);
}
else
{
$template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => ($total == 1) ? $user->lang['UNAPPROVED_POST_TOTAL'] : sprintf($user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
+ 'L_UNAPPROVED_TOTAL' => ($total == 1) ? phpbb::$user->lang['UNAPPROVED_POST_TOTAL'] : sprintf(phpbb::$user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
'S_HAS_UNAPPROVED_POSTS' => true)
);
}
@@ -216,11 +216,11 @@ function mcp_front_view($id, $mode, $action)
'AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
'U_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : phpbb::$user->lang['GLOBAL_ANNOUNCEMENT'],
'TOPIC_TITLE' => $row['topic_title'],
- 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
- 'REPORT_TIME' => $user->format_date($row['report_time']),
- 'POST_TIME' => $user->format_date($row['post_time']),
+ 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : phpbb::$user->lang['NO_SUBJECT'],
+ 'REPORT_TIME' => phpbb::$user->format_date($row['report_time']),
+ 'POST_TIME' => phpbb::$user->format_date($row['post_time']),
));
}
}
@@ -228,14 +228,14 @@ function mcp_front_view($id, $mode, $action)
if ($total == 0)
{
$template->assign_vars(array(
- 'L_REPORTS_TOTAL' => $user->lang['REPORTS_ZERO_TOTAL'],
+ 'L_REPORTS_TOTAL' => phpbb::$user->lang['REPORTS_ZERO_TOTAL'],
'S_HAS_REPORTS' => false)
);
}
else
{
$template->assign_vars(array(
- 'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total),
+ 'L_REPORTS_TOTAL' => ($total == 1) ? phpbb::$user->lang['REPORT_TOTAL'] : sprintf(phpbb::$user->lang['REPORTS_TOTAL'], $total),
'S_HAS_REPORTS' => true)
);
}
@@ -261,7 +261,7 @@ function mcp_front_view($id, $mode, $action)
$template->assign_block_vars('log', array(
'USERNAME' => $row['username_full'],
'IP' => $row['ip'],
- 'TIME' => $user->format_date($row['time']),
+ 'TIME' => phpbb::$user->format_date($row['time']),
'ACTION' => $row['action'],
'U_VIEW_TOPIC' => (!empty($row['viewtopic'])) ? $row['viewtopic'] : '',
'U_VIEWLOGS' => (!empty($row['viewlogs'])) ? $row['viewlogs'] : '')
diff --git a/phpBB/modules/mcp/mcp_logs.php b/phpBB/modules/mcp/mcp_logs.php
index b91a7906b8..8c162d4d31 100644
--- a/phpBB/modules/mcp/mcp_logs.php
+++ b/phpBB/modules/mcp/mcp_logs.php
@@ -33,9 +33,7 @@ class mcp_logs
function main($id, $mode)
{
- global $auth, $db, $user, $template;
-
- $user->add_lang('acp/common');
+ phpbb::$user->add_lang('acp/common');
$action = request_var('action', array('' => ''));
@@ -134,7 +132,7 @@ class mcp_logs
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ confirm_box(false, phpbb::$user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'f' => $forum_id,
't' => $topic_id,
'start' => $start,
@@ -152,8 +150,8 @@ class mcp_logs
}
// Sorting
- $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
+ $limit_days = array(0 => phpbb::$user->lang['ALL_ENTRIES'], 1 => phpbb::$user->lang['1_DAY'], 7 => phpbb::$user->lang['7_DAYS'], 14 => phpbb::$user->lang['2_WEEKS'], 30 => phpbb::$user->lang['1_MONTH'], 90 => phpbb::$user->lang['3_MONTHS'], 180 => phpbb::$user->lang['6_MONTHS'], 365 => phpbb::$user->lang['1_YEAR']);
+ $sort_by_text = array('u' => phpbb::$user->lang['SORT_USERNAME'], 't' => phpbb::$user->lang['SORT_DATE'], 'i' => phpbb::$user->lang['SORT_IP'], 'o' => phpbb::$user->lang['SORT_ACTION']);
$sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
@@ -170,10 +168,10 @@ class mcp_logs
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, phpbb::$config['topics_per_page'], $start),
- 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
+ 'TOTAL' => ($log_count == 1) ? phpbb::$user->lang['TOTAL_LOG'] : sprintf(phpbb::$user->lang['TOTAL_LOGS'], $log_count),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, phpbb::$config['topics_per_page'], $start),
- 'L_TITLE' => $user->lang['MCP_LOGS'],
+ 'L_TITLE' => phpbb::$user->lang['MCP_LOGS'],
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -193,14 +191,14 @@ class mcp_logs
{
if (isset($row[$check]) && $row[$check])
{
- $data[] = '<a href="' . $row[$check] . '">' . $user->lang['LOGVIEW_' . strtoupper($check)] . '</a>';
+ $data[] = '<a href="' . $row[$check] . '">' . phpbb::$user->lang['LOGVIEW_' . strtoupper($check)] . '</a>';
}
}
$template->assign_block_vars('log', array(
'USERNAME' => $row['username_full'],
'IP' => $row['ip'],
- 'DATE' => $user->format_date($row['time']),
+ 'DATE' => phpbb::$user->format_date($row['time']),
'ACTION' => $row['action'],
'DATA' => (sizeof($data)) ? implode(' | ', $data) : '',
'ID' => $row['id'],
diff --git a/phpBB/modules/mcp/mcp_main.php b/phpBB/modules/mcp/mcp_main.php
index a3d5ae8a46..3fa38c7d1f 100644
--- a/phpBB/modules/mcp/mcp_main.php
+++ b/phpBB/modules/mcp/mcp_main.php
@@ -33,7 +33,7 @@ class mcp_main
function main($id, $mode)
{
- global $auth, $db, $user, $template, $action;
+ global $action;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -80,7 +80,7 @@ class mcp_main
break;
case 'move':
- $user->add_lang('viewtopic');
+ phpbb::$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
@@ -93,7 +93,7 @@ class mcp_main
break;
case 'fork':
- $user->add_lang('viewtopic');
+ phpbb::$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
@@ -106,7 +106,7 @@ class mcp_main
break;
case 'delete_topic':
- $user->add_lang('viewtopic');
+ phpbb::$user->add_lang('viewtopic');
$topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
@@ -119,7 +119,7 @@ class mcp_main
break;
case 'delete_post':
- $user->add_lang('posting');
+ phpbb::$user->add_lang('posting');
$post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0));
@@ -137,7 +137,7 @@ class mcp_main
case 'front':
include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_front.' . PHP_EXT);
- $user->add_lang('acp/common');
+ phpbb::$user->add_lang('acp/common');
mcp_front_view($id, $mode, $action);
@@ -148,7 +148,7 @@ class mcp_main
case 'forum_view':
include(PHPBB_ROOT_PATH . 'includes/mcp/mcp_forum.' . PHP_EXT);
- $user->add_lang('viewforum');
+ phpbb::$user->add_lang('viewforum');
$forum_id = request_var('f', 0);
@@ -198,8 +198,6 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db;
-
if ($action == 'lock' || $action == 'unlock')
{
$table = TOPICS_TABLE;
@@ -274,7 +272,7 @@ function lock_unlock($action, $ids)
else
{
meta_refresh(2, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
}
@@ -283,8 +281,6 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- 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);
@@ -494,12 +490,10 @@ function change_topic_type($action, $topic_ids)
if ($global_involved)
{
- global $template;
-
$template->assign_vars(array(
'S_FORUM_SELECT' => make_forum_select(request_var('f', $forum_id), false, false, true, true),
'S_CAN_LEAVE_SHADOW' => false,
- 'ADDITIONAL_MSG' => (sizeof($topic_ids) == 1) ? $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENT'] : $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENTS'])
+ 'ADDITIONAL_MSG' => (sizeof($topic_ids) == 1) ? phpbb::$user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENT'] : phpbb::$user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENTS'])
);
confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields), 'mcp_move.html');
@@ -520,7 +514,7 @@ function change_topic_type($action, $topic_ids)
else
{
meta_refresh(2, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
}
@@ -529,8 +523,6 @@ function change_topic_type($action, $topic_ids)
*/
function mcp_move_topic($topic_ids)
{
- global $auth, $user, $db, $template;
-
// Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
@@ -556,7 +548,7 @@ function mcp_move_topic($topic_ids)
if (!sizeof($forum_data))
{
- $additional_msg = $user->lang['FORUM_NOT_EXIST'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_EXIST'];
}
else
{
@@ -564,21 +556,21 @@ function mcp_move_topic($topic_ids)
if ($forum_data['forum_type'] != FORUM_POST)
{
- $additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_POSTABLE'];
}
else if (!$auth->acl_get('f_post', $to_forum_id))
{
- $additional_msg = $user->lang['USER_CANNOT_POST'];
+ $additional_msg = phpbb::$user->lang['USER_CANNOT_POST'];
}
else if ($forum_id == $to_forum_id)
{
- $additional_msg = $user->lang['CANNOT_MOVE_SAME_FORUM'];
+ $additional_msg = phpbb::$user->lang['CANNOT_MOVE_SAME_FORUM'];
}
}
}
else if (phpbb_request::is_set_post('confirm'))
{
- $additional_msg = $user->lang['FORUM_NOT_EXIST'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_EXIST'];
}
if ($to_forum_id && !$additional_msg && confirm_box(true))
@@ -733,10 +725,10 @@ function mcp_move_topic($topic_ids)
{
meta_refresh(3, $redirect);
- $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('viewforum', "f=$forum_id") . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', "f=$to_forum_id") . '">', '</a>');
+ $message = phpbb::$user->lang[$success_msg];
+ $message .= '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
+ $message .= '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f=$forum_id") . '">', '</a>');
+ $message .= '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid('viewforum', "f=$to_forum_id") . '">', '</a>');
trigger_error($message);
}
@@ -747,8 +739,6 @@ function mcp_move_topic($topic_ids)
*/
function mcp_delete_topic($topic_ids)
{
- global $auth, $user, $db;
-
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
{
return;
@@ -802,7 +792,7 @@ function mcp_delete_topic($topic_ids)
else
{
meta_refresh(3, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_' . $redirect_message], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_' . $redirect_message], '<a href="' . $redirect . '">', '</a>'));
}
}
@@ -811,8 +801,6 @@ function mcp_delete_topic($topic_ids)
*/
function mcp_delete_post($post_ids)
{
- global $auth, $user, $db;
-
if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_delete')))
{
return;
@@ -877,9 +865,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('viewtopic', "f=$forum_id&amp;t=$topic_id") . '">', '</a>');
+ $return_link[] = sprintf(phpbb::$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('viewforum', 'f=' . $forum_id) . '">', '</a>');
+ $return_link[] = sprintf(phpbb::$user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', 'f=' . $forum_id) . '">', '</a>');
if (sizeof($post_ids) == 1)
{
@@ -887,11 +875,11 @@ function mcp_delete_post($post_ids)
{
// We deleted the only post of a topic, which in turn has
// been removed from the database
- $success_msg = $user->lang['TOPIC_DELETED_SUCCESS'];
+ $success_msg = phpbb::$user->lang['TOPIC_DELETED_SUCCESS'];
}
else
{
- $success_msg = $user->lang['POST_DELETED_SUCCESS'];
+ $success_msg = phpbb::$user->lang['POST_DELETED_SUCCESS'];
}
}
else
@@ -899,11 +887,11 @@ function mcp_delete_post($post_ids)
if ($deleted_topics)
{
// Some of topics disappeared
- $success_msg = $user->lang['POSTS_DELETED_SUCCESS'] . '<br /><br />' . $user->lang['EMPTY_TOPICS_REMOVED_WARNING'];
+ $success_msg = phpbb::$user->lang['POSTS_DELETED_SUCCESS'] . '<br /><br />' . phpbb::$user->lang['EMPTY_TOPICS_REMOVED_WARNING'];
}
else
{
- $success_msg = $user->lang['POSTS_DELETED_SUCCESS'];
+ $success_msg = phpbb::$user->lang['POSTS_DELETED_SUCCESS'];
}
}
}
@@ -922,7 +910,7 @@ function mcp_delete_post($post_ids)
else
{
meta_refresh(3, $redirect);
- trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));
+ trigger_error($success_msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));
}
}
@@ -931,8 +919,6 @@ function mcp_delete_post($post_ids)
*/
function mcp_fork_topic($topic_ids)
{
- global $auth, $user, $db, $template;
-
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
return;
@@ -956,11 +942,11 @@ function mcp_fork_topic($topic_ids)
if (!sizeof($topic_ids))
{
- $additional_msg = $user->lang['NO_TOPIC_SELECTED'];
+ $additional_msg = phpbb::$user->lang['NO_TOPIC_SELECTED'];
}
else if (!sizeof($forum_data))
{
- $additional_msg = $user->lang['FORUM_NOT_EXIST'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_EXIST'];
}
else
{
@@ -968,17 +954,17 @@ function mcp_fork_topic($topic_ids)
if ($forum_data['forum_type'] != FORUM_POST)
{
- $additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_POSTABLE'];
}
else if (!$auth->acl_get('f_post', $to_forum_id))
{
- $additional_msg = $user->lang['USER_CANNOT_POST'];
+ $additional_msg = phpbb::$user->lang['USER_CANNOT_POST'];
}
}
}
else if (phpbb_request::is_set_post('confirm'))
{
- $additional_msg = $user->lang['FORUM_NOT_EXIST'];
+ $additional_msg = phpbb::$user->lang['FORUM_NOT_EXIST'];
}
if (!$additional_msg && confirm_box(true))
@@ -1206,14 +1192,14 @@ function mcp_fork_topic($topic_ids)
{
$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>');
+ $return_link = sprintf(phpbb::$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('viewforum', 'f=' . $to_forum_id) . '">', '</a>');
+ $return_link .= '<br /><br />' . sprintf(phpbb::$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);
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/modules/mcp/mcp_notes.php b/phpBB/modules/mcp/mcp_notes.php
index dbd61dfb40..02267aa817 100644
--- a/phpBB/modules/mcp/mcp_notes.php
+++ b/phpBB/modules/mcp/mcp_notes.php
@@ -33,8 +33,6 @@ class mcp_notes
function main($id, $mode)
{
- global $auth, $db, $user, $template;
-
$action = request_var('action', array('' => ''));
if (is_array($action))
@@ -51,14 +49,14 @@ class mcp_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'],
+ 'L_TITLE' => phpbb::$user->lang['MCP_NOTES'],
));
$this->tpl_name = 'mcp_notes_front';
break;
case 'user_notes':
- $user->add_lang('acp/common');
+ phpbb::$user->add_lang('acp/common');
$this->mcp_notes_user_view($action);
$this->tpl_name = 'mcp_notes_user';
@@ -71,8 +69,6 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
- global $template, $db, $user, $auth;
-
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
$start = request_var('start', 0);
@@ -147,7 +143,7 @@ class mcp_notes
}
$redirect = $this->u_action . '&amp;u=' . $user_id;
meta_refresh(3, $redirect);
- trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error(phpbb::$user->lang[$msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
}
@@ -159,16 +155,16 @@ class mcp_notes
add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']);
add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
- $msg = $user->lang['USER_FEEDBACK_ADDED'];
+ $msg = phpbb::$user->lang['USER_FEEDBACK_ADDED'];
}
else
{
- $msg = $user->lang['FORM_INVALID'];
+ $msg = phpbb::$user->lang['FORM_INVALID'];
}
$redirect = $this->u_action;
meta_refresh(3, $redirect);
- trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ trigger_error($msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// Generate the appropriate user information for the user we are looking at
@@ -180,8 +176,8 @@ class mcp_notes
$rank_title = $rank_img = '';
$avatar_img = get_user_avatar($userrow['user_avatar'], $userrow['user_avatar_type'], $userrow['user_avatar_width'], $userrow['user_avatar_height']);
- $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
+ $limit_days = array(0 => phpbb::$user->lang['ALL_ENTRIES'], 1 => phpbb::$user->lang['1_DAY'], 7 => phpbb::$user->lang['7_DAYS'], 14 => phpbb::$user->lang['2_WEEKS'], 30 => phpbb::$user->lang['1_MONTH'], 90 => phpbb::$user->lang['3_MONTHS'], 180 => phpbb::$user->lang['6_MONTHS'], 365 => phpbb::$user->lang['1_YEAR']);
+ $sort_by_text = array('a' => phpbb::$user->lang['SORT_USERNAME'], 'b' => phpbb::$user->lang['SORT_DATE'], 'c' => phpbb::$user->lang['SORT_IP'], 'd' => phpbb::$user->lang['SORT_ACTION']);
$sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
@@ -203,7 +199,7 @@ class mcp_notes
{
$template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username_full'],
- 'REPORT_AT' => $user->format_date($row['time']),
+ 'REPORT_AT' => phpbb::$user->format_date($row['time']),
'ACTION' => $row['action'],
'IP' => $row['ip'],
'ID' => $row['id'])
@@ -218,16 +214,16 @@ class mcp_notes
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'L_TITLE' => $user->lang['MCP_NOTES_USER'],
+ 'L_TITLE' => phpbb::$user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, phpbb::$config['posts_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, phpbb::$config['posts_per_page'], $start),
- 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
+ 'TOTAL_REPORTS' => ($log_count == 1) ? phpbb::$user->lang['LIST_REPORT'] : sprintf(phpbb::$user->lang['LIST_REPORTS'], $log_count),
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
'RANK_TITLE' => $rank_title,
- 'JOINED' => $user->format_date($userrow['user_regdate']),
+ 'JOINED' => phpbb::$user->format_date($userrow['user_regdate']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
diff --git a/phpBB/modules/mcp/mcp_post.php b/phpBB/modules/mcp/mcp_post.php
index 8d4a4683cc..33a2336662 100644
--- a/phpBB/modules/mcp/mcp_post.php
+++ b/phpBB/modules/mcp/mcp_post.php
@@ -21,9 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
- global $template, $db, $user, $auth;
-
- $user->add_lang('posting');
+ phpbb::$user->add_lang('posting');
$post_id = request_var('p', 0);
$start = request_var('start', 0);
@@ -52,9 +50,9 @@ function mcp_post_details($id, $mode, $action)
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
$template->assign_vars(array(
- 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid('mcp', "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
+ 'RETURN_POST' => sprintf(phpbb::$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'], '', ''),
+ 'L_RETURN_POST' => sprintf(phpbb::$user->lang['RETURN_POST'], '', ''),
'WHOIS' => user_ipwhois($ip),
));
}
@@ -200,14 +198,14 @@ function mcp_post_details($id, $mode, $action)
'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'),
+ 'MINI_POST_IMG' => ($post_unread) ? phpbb::$user->img('icon_post_target_unread', 'NEW_POST') : phpbb::$user->img('icon_post_target', 'POST'),
- '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']),
- 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
+ 'RETURN_TOPIC' => sprintf(phpbb::$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(phpbb::$user->lang['RETURN_FORUM'], '<a href="' . append_sid('viewforum', "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
+ 'REPORTED_IMG' => phpbb::$user->img('icon_topic_reported', 'POST_REPORTED'),
+ 'UNAPPROVED_IMG' => phpbb::$user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
+ 'EDIT_IMG' => phpbb::$user->img('icon_post_edit', 'EDIT_POST'),
+ 'SEARCH_IMG' => phpbb::$user->img('icon_user_search', 'SEARCH'),
'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
@@ -216,7 +214,7 @@ function mcp_post_details($id, $mode, $action)
'POST_PREVIEW' => $message,
'POST_SUBJECT' => $post_info['post_subject'],
- 'POST_DATE' => $user->format_date($post_info['post_time']),
+ 'POST_DATE' => phpbb::$user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
'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'],
@@ -238,7 +236,7 @@ function mcp_post_details($id, $mode, $action)
{
$template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username_full'],
- 'REPORT_AT' => $user->format_date($row['time']),
+ 'REPORT_AT' => phpbb::$user->format_date($row['time']),
'ACTION' => $row['action'],
'ID' => $row['id'])
);
@@ -263,20 +261,20 @@ function mcp_post_details($id, $mode, $action)
do
{
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ if (isset(phpbb::$user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset(phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
{
- $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
- $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
+ $row['reson_description'] = phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
+ $row['reason_title'] = phpbb::$user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
}
$template->assign_block_vars('reports', array(
'REPORT_ID' => $row['report_id'],
'REASON_TITLE' => $row['reason_title'],
'REASON_DESC' => $row['reason_description'],
- 'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
+ 'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : phpbb::$user->lang['GUEST'],
'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_TIME' => phpbb::$user->format_date($row['report_time']),
'REPORT_TEXT' => bbcode_nl2br(trim($row['report_text'])),
));
}
@@ -333,9 +331,9 @@ function mcp_post_details($id, $mode, $action)
foreach ($users_ary as $user_id => $user_row)
{
$template->assign_block_vars('userrow', array(
- 'USERNAME' => ($user_id == ANONYMOUS) ? $user->lang['GUEST'] : $user_row['username'],
+ 'USERNAME' => ($user_id == ANONYMOUS) ? phpbb::$user->lang['GUEST'] : $user_row['username'],
'NUM_POSTS' => $user_row['postings'],
- 'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
+ 'L_POST_S' => ($user_row['postings'] == 1) ? phpbb::$user->lang['POST'] : phpbb::$user->lang['POSTS'],
'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'))
@@ -364,7 +362,7 @@ function mcp_post_details($id, $mode, $action)
'IP' => $row['poster_ip'],
'HOSTNAME' => $hostname,
'NUM_POSTS' => $row['postings'],
- 'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
+ 'L_POST_S' => ($row['postings'] == 1) ? phpbb::$user->lang['POST'] : phpbb::$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('mcp', "i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}"))
@@ -394,8 +392,6 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db;
-
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
return;
diff --git a/phpBB/modules/mcp/mcp_queue.php b/phpBB/modules/mcp/mcp_queue.php
index 1d122b8581..6e4e0144d0 100644
--- a/phpBB/modules/mcp/mcp_queue.php
+++ b/phpBB/modules/mcp/mcp_queue.php
@@ -33,7 +33,6 @@ class mcp_queue
function main($id, $mode)
{
- global $auth, $db, $user, $template;
global $action;
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
@@ -74,7 +73,7 @@ class mcp_queue
$this->tpl_name = 'mcp_post';
- $user->add_lang(array('posting', 'viewtopic'));
+ phpbb::$user->add_lang(array('posting', 'viewtopic'));
$post_id = request_var('p', 0);
$topic_id = request_var('t', 0);
@@ -195,14 +194,14 @@ class mcp_queue
'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'),
+ 'MINI_POST_IMG' => ($post_unread) ? phpbb::$user->img('icon_post_target_unread', 'NEW_POST') : phpbb::$user->img('icon_post_target', 'POST'),
- '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']),
- 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
- 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
+ 'RETURN_QUEUE' => sprintf(phpbb::$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(phpbb::$user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
+ 'RETURN_TOPIC_SIMPLE' => sprintf(phpbb::$user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
+ 'REPORTED_IMG' => phpbb::$user->img('icon_topic_reported', 'POST_REPORTED'),
+ 'UNAPPROVED_IMG' => phpbb::$user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
+ 'EDIT_IMG' => phpbb::$user->img('icon_post_edit', 'EDIT_POST'),
'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
@@ -211,7 +210,7 @@ class mcp_queue
'POST_PREVIEW' => $message,
'POST_SUBJECT' => $post_info['post_subject'],
- 'POST_DATE' => $user->format_date($post_info['post_time']),
+ 'POST_DATE' => phpbb::$user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
'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'],
@@ -223,7 +222,7 @@ class mcp_queue
case 'unapproved_topics':
case 'unapproved_posts':
- $user->add_lang(array('viewtopic', 'viewforum'));
+ phpbb::$user->add_lang(array('viewtopic', 'viewforum'));
$topic_id = request_var('t', 0);
$forum_info = array();
@@ -292,7 +291,7 @@ class mcp_queue
$global_id = $forum_id;
}
- $forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
+ $forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_approve as $row)
{
$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . $row['forum_name'] . '</option>';
@@ -411,7 +410,7 @@ class mcp_queue
if (empty($row['post_username']))
{
- $row['post_username'] = $user->lang['GUEST'];
+ $row['post_username'] = phpbb::$user->lang['GUEST'];
}
$template->assign_block_vars('postrow', array(
@@ -426,20 +425,20 @@ class mcp_queue
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_ID' => $row['post_id'],
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : phpbb::$user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_SUBJECT' => $row['post_subject'],
'TOPIC_TITLE' => $row['topic_title'],
- 'POST_TIME' => $user->format_date($row['post_time']))
+ 'POST_TIME' => phpbb::$user->format_date($row['post_time']))
);
}
unset($rowset, $forum_names);
// Now display the page
$template->assign_vars(array(
- 'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? $user->lang['DISPLAY_POSTS'] : $user->lang['DISPLAY_TOPICS'],
- 'L_EXPLAIN' => ($mode == 'unapproved_posts') ? $user->lang['MCP_QUEUE_UNAPPROVED_POSTS_EXPLAIN'] : $user->lang['MCP_QUEUE_UNAPPROVED_TOPICS_EXPLAIN'],
- 'L_TITLE' => ($mode == 'unapproved_posts') ? $user->lang['MCP_QUEUE_UNAPPROVED_POSTS'] : $user->lang['MCP_QUEUE_UNAPPROVED_TOPICS'],
- 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
+ 'L_DISPLAY_ITEMS' => ($mode == 'unapproved_posts') ? phpbb::$user->lang['DISPLAY_POSTS'] : phpbb::$user->lang['DISPLAY_TOPICS'],
+ 'L_EXPLAIN' => ($mode == 'unapproved_posts') ? phpbb::$user->lang['MCP_QUEUE_UNAPPROVED_POSTS_EXPLAIN'] : phpbb::$user->lang['MCP_QUEUE_UNAPPROVED_TOPICS_EXPLAIN'],
+ 'L_TITLE' => ($mode == 'unapproved_posts') ? phpbb::$user->lang['MCP_QUEUE_UNAPPROVED_POSTS'] : phpbb::$user->lang['MCP_QUEUE_UNAPPROVED_TOPICS'],
+ 'L_ONLY_TOPIC' => ($topic_id) ? sprintf(phpbb::$user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
'S_FORUM_OPTIONS' => $forum_options,
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
@@ -448,7 +447,7 @@ class mcp_queue
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, phpbb::$config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, phpbb::$config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
- 'TOTAL' => ($total == 1) ? (($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POST'] : $user->lang['VIEW_FORUM_TOPIC']) : sprintf((($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POSTS'] : $user->lang['VIEW_FORUM_TOPICS']), $total),
+ 'TOTAL' => ($total == 1) ? (($mode == 'unapproved_posts') ? phpbb::$user->lang['VIEW_TOPIC_POST'] : phpbb::$user->lang['VIEW_FORUM_TOPIC']) : sprintf((($mode == 'unapproved_posts') ? phpbb::$user->lang['VIEW_TOPIC_POSTS'] : phpbb::$user->lang['VIEW_FORUM_TOPICS']), $total),
));
$this->tpl_name = 'mcp_queue';
@@ -462,8 +461,6 @@ class mcp_queue
*/
function approve_post($post_id_list, $id, $mode)
{
- global $db, $template, $user;
-
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
trigger_error('NOT_AUTHORISED');
@@ -775,10 +772,10 @@ function approve_post($post_id_list, $id, $mode)
$add_message = '';
if (sizeof($post_id_list) == 1 && !empty($post_url))
{
- $add_message = '<br /><br />' . sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>');
+ $add_message = '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>');
}
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>') . $add_message);
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>') . $add_message);
}
}
@@ -787,8 +784,6 @@ function approve_post($post_id_list, $id, $mode)
*/
function disapprove_post($post_id_list, $id, $mode)
{
- global $db, $template, $user;
-
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
trigger_error('NOT_AUTHORISED');
@@ -821,15 +816,15 @@ function disapprove_post($post_id_list, $id, $mode)
if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
- $additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
+ $additional_msg = phpbb::$user->lang['NO_REASON_DISAPPROVAL'];
}
else
{
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
+ $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset(phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
$disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
- if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ if (isset(phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
{
$disapprove_reason_lang = strtoupper($row['reason_title']);
}
@@ -969,10 +964,10 @@ function disapprove_post($post_id_list, $id, $mode)
if (!isset($lang_reasons[$post_data['user_lang']]))
{
// Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity.
- $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
+ $lang_reasons[$post_data['user_lang']] = phpbb::$user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
// Only load up the language pack if the language is different to the current one
- if ($post_data['user_lang'] != $user->lang_name && file_exists(PHPBB_ROOT_PATH . '/language/' . $post_data['user_lang'] . '/mcp.' . PHP_EXT))
+ if ($post_data['user_lang'] != phpbb::$user->lang_name && file_exists(PHPBB_ROOT_PATH . '/language/' . $post_data['user_lang'] . '/mcp.' . PHP_EXT))
{
// Load up the language pack
$lang = array();
@@ -1065,7 +1060,7 @@ function disapprove_post($post_id_list, $id, $mode)
else
{
meta_refresh(3, $redirect);
- trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
}
}
diff --git a/phpBB/modules/mcp/mcp_reports.php b/phpBB/modules/mcp/mcp_reports.php
index fc48a24482..f1aba235eb 100644
--- a/phpBB/modules/mcp/mcp_reports.php
+++ b/phpBB/modules/mcp/mcp_reports.php
@@ -33,7 +33,6 @@ class mcp_reports
function main($id, $mode)
{
- global $auth, $db, $user, $template;
global $action;
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
@@ -65,7 +64,7 @@ class mcp_reports
{
case 'report_details':
- $user->add_lang(array('posting', 'viewforum', 'viewtopic'));
+ phpbb::$user->add_lang(array('posting', 'viewforum', 'viewtopic'));
$post_id = request_var('p', 0);
@@ -105,10 +104,10 @@ class mcp_reports
$post_info = $post_info[$post_id];
$reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']);
- if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]))
+ if (isset(phpbb::$user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset(phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]))
{
- $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
- $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
+ $reason['description'] = phpbb::$user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
+ $reason['title'] = phpbb::$user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
}
if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false))
@@ -204,13 +203,13 @@ class mcp_reports
'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']),
+ 'EDIT_IMG' => phpbb::$user->img('icon_post_edit', 'EDIT_POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? phpbb::$user->img('icon_post_target_unread', 'NEW_POST') : phpbb::$user->img('icon_post_target', 'POST'),
+ 'UNAPPROVED_IMG' => phpbb::$user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
- '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']),
+ 'RETURN_REPORTS' => sprintf(phpbb::$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' => phpbb::$user->img('icon_topic_reported', 'POST_REPORTED'),
+ 'REPORT_DATE' => phpbb::$user->format_date($report['report_time']),
'REPORT_ID' => $report_id,
'REPORT_REASON_TITLE' => $reason['title'],
'REPORT_REASON_DESCRIPTION' => $reason['description'],
@@ -227,8 +226,8 @@ class mcp_reports
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
'POST_PREVIEW' => $message,
- 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
- 'POST_DATE' => $user->format_date($post_info['post_time']),
+ 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : phpbb::$user->lang['NO_SUBJECT'],
+ 'POST_DATE' => phpbb::$user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
'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'],
@@ -315,7 +314,7 @@ class mcp_reports
$forum_list[] = 0;
$forum_data = array();
- $forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
+ $forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_reports as $row)
{
$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . $row['forum_name'] . '</option>';
@@ -398,12 +397,12 @@ class mcp_reports
'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
- 'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : phpbb::$user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_ID' => $row['post_id'],
- 'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
- 'POST_TIME' => $user->format_date($row['post_time']),
+ 'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : phpbb::$user->lang['NO_SUBJECT'],
+ 'POST_TIME' => phpbb::$user->format_date($row['post_time']),
'REPORT_ID' => $row['report_id'],
- 'REPORT_TIME' => $user->format_date($row['report_time']),
+ 'REPORT_TIME' => phpbb::$user->format_date($row['report_time']),
'TOPIC_TITLE' => $row['topic_title'])
);
}
@@ -413,9 +412,9 @@ class mcp_reports
// Now display the page
$template->assign_vars(array(
- 'L_EXPLAIN' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'],
- 'L_TITLE' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN'] : $user->lang['MCP_REPORTS_CLOSED'],
- 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
+ 'L_EXPLAIN' => ($mode == 'reports') ? phpbb::$user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : phpbb::$user->lang['MCP_REPORTS_CLOSED_EXPLAIN'],
+ 'L_TITLE' => ($mode == 'reports') ? phpbb::$user->lang['MCP_REPORTS_OPEN'] : phpbb::$user->lang['MCP_REPORTS_CLOSED'],
+ 'L_ONLY_TOPIC' => ($topic_id) ? sprintf(phpbb::$user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
'S_MCP_ACTION' => $this->u_action,
'S_FORUM_OPTIONS' => $forum_options,
@@ -425,7 +424,7 @@ class mcp_reports
'PAGE_NUMBER' => on_page($total, phpbb::$config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
- 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
+ 'TOTAL_REPORTS' => ($total == 1) ? phpbb::$user->lang['LIST_REPORT'] : sprintf(phpbb::$user->lang['LIST_REPORTS'], $total),
)
);
@@ -440,8 +439,6 @@ class mcp_reports
*/
function close_report($report_id_list, $mode, $action)
{
- global $db, $template, $user;
-
$sql = 'SELECT r.post_id
FROM ' . REPORTS_TABLE . ' r
WHERE ' . $db->sql_in_set('r.report_id', $report_id_list);
@@ -459,7 +456,7 @@ function close_report($report_id_list, $mode, $action)
trigger_error('NOT_AUTHORISED');
}
- if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false)
+ if ($action == 'delete' && strpos(phpbb::$user->data['session_page'], 'mode=report_details') !== false)
{
$redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
}
@@ -602,7 +599,7 @@ function close_report($report_id_list, $mode, $action)
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($reporter['username']),
- 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']),
+ 'CLOSER_NAME' => htmlspecialchars_decode(phpbb::$user->data['username']),
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
);
@@ -625,7 +622,7 @@ function close_report($report_id_list, $mode, $action)
}
else
{
- confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
+ confirm_box(false, phpbb::$user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
}
$redirect = request_var('redirect', 'index.' . PHP_EXT);
@@ -641,15 +638,15 @@ 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('viewforum', 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_forum = sprintf(phpbb::$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('viewtopic', 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
+ $return_topic = sprintf(phpbb::$user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . current($topic_ids) . '&amp;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>'));
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf(phpbb::$user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
}
}
diff --git a/phpBB/modules/mcp/mcp_topic.php b/phpBB/modules/mcp/mcp_topic.php
index 9da64df6f9..32d5f5f8e6 100644
--- a/phpBB/modules/mcp/mcp_topic.php
+++ b/phpBB/modules/mcp/mcp_topic.php
@@ -21,11 +21,9 @@ if (!defined('IN_PHPBB'))
*/
function mcp_topic_view($id, $mode, $action)
{
- global $template, $db, $user, $auth;
-
$url = append_sid(PHPBB_ROOT_PATH. 'mcp.' . PHP_EXT . '?' . extra_url());
- $user->add_lang('viewtopic');
+ phpbb::$user->add_lang('viewtopic');
$topic_id = request_var('t', 0);
$topic_info = get_topic_data(array($topic_id), false, true);
@@ -223,13 +221,13 @@ function mcp_topic_view($id, $mode, $action)
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
- 'POST_DATE' => $user->format_date($row['post_time']),
+ 'POST_DATE' => phpbb::$user->format_date($row['post_time']),
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
'POST_ID' => $row['post_id'],
- 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 't=' . $topic_id) . '">', '</a>'),
+ 'RETURN_TOPIC' => sprintf(phpbb::$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'),
+ 'MINI_POST_IMG' => ($post_unread) ? phpbb::$user->img('icon_post_target_unread', 'NEW_POST') : phpbb::$user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
@@ -294,14 +292,14 @@ function mcp_topic_view($id, $mode, $action)
'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('viewtopic', 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
+ 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf(phpbb::$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,
'ACTION' => $action,
- 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'),
- 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
+ 'REPORTED_IMG' => phpbb::$user->img('icon_topic_reported', 'POST_REPORTED'),
+ 'UNAPPROVED_IMG' => phpbb::$user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
'S_MCP_ACTION' => "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
'S_FORUM_SELECT' => ($to_forum_id) ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true),
@@ -322,12 +320,12 @@ 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('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>'),
+ 'RETURN_TOPIC' => sprintf(phpbb::$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(phpbb::$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('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),
+ 'TOTAL_POSTS' => ($total == 1) ? phpbb::$user->lang['VIEW_TOPIC_POST'] : sprintf(phpbb::$user->lang['VIEW_TOPIC_POSTS'], $total),
));
}
@@ -336,15 +334,13 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
- global $db, $template, $user, $auth;
-
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
$start = request_var('start', 0);
if (!sizeof($post_id_list))
{
- $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_POST_SELECTED']);
return;
}
@@ -358,7 +354,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
if (!sizeof($post_info))
{
- $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_POST_SELECTED']);
return;
}
@@ -368,13 +364,13 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
// Make some tests
if (!$subject)
{
- $template->assign_var('MESSAGE', $user->lang['EMPTY_SUBJECT']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['EMPTY_SUBJECT']);
return;
}
if ($to_forum_id <= 0)
{
- $template->assign_var('MESSAGE', $user->lang['NO_DESTINATION_FORUM']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_DESTINATION_FORUM']);
return;
}
@@ -382,7 +378,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
if (!sizeof($forum_info))
{
- $template->assign_var('MESSAGE', $user->lang['USER_CANNOT_POST']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['USER_CANNOT_POST']);
return;
}
@@ -390,7 +386,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
if ($forum_info['forum_type'] != FORUM_POST)
{
- $template->assign_var('MESSAGE', $user->lang['FORUM_NOT_POSTABLE']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['FORUM_NOT_POSTABLE']);
return;
}
@@ -503,7 +499,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
set_config('num_topics', phpbb::$config['num_topics'] + 1, true);
// Link back to both topics
- $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>');
+ $return_link = sprintf(phpbb::$user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
@@ -520,7 +516,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
else
{
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);
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
@@ -529,11 +525,9 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $auth;
-
if (!$to_topic_id)
{
- $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
@@ -541,7 +535,7 @@ function merge_posts($topic_id, $to_topic_id)
if (!sizeof($topic_data))
{
- $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
}
@@ -552,7 +546,7 @@ function merge_posts($topic_id, $to_topic_id)
if (!sizeof($post_id_list))
{
- $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
+ $template->assign_var('MESSAGE', phpbb::$user->lang['NO_POST_SELECTED']);
return;
}
@@ -595,7 +589,7 @@ function merge_posts($topic_id, $to_topic_id)
if ($row)
{
- $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
+ $return_link .= sprintf(phpbb::$user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
}
else
{
@@ -609,7 +603,7 @@ 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('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
+ $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf(phpbb::$user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
else
{
@@ -626,7 +620,7 @@ function merge_posts($topic_id, $to_topic_id)
else
{
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);
+ trigger_error(phpbb::$user->lang[$success_msg] . '<br /><br />' . $return_link);
}
}
diff --git a/phpBB/modules/mcp/mcp_warn.php b/phpBB/modules/mcp/mcp_warn.php
index 48515a6c64..70862393df 100644
--- a/phpBB/modules/mcp/mcp_warn.php
+++ b/phpBB/modules/mcp/mcp_warn.php
@@ -33,8 +33,6 @@ class mcp_warn
function main($id, $mode)
{
- global $auth, $db, $user, $template;
-
$action = request_var('action', array('' => ''));
if (is_array($action))
@@ -75,8 +73,6 @@ class mcp_warn
*/
function mcp_warn_front_view()
{
- global $template, $db, $user, $auth;
-
$template->assign_vars(array(
'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'),
@@ -99,7 +95,7 @@ class mcp_warn
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
- 'WARNING_TIME' => $user->format_date($row['user_last_warning']),
+ 'WARNING_TIME' => phpbb::$user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
));
}
@@ -121,7 +117,7 @@ class mcp_warn
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
- 'WARNING_TIME' => $user->format_date($row['warning_time']),
+ 'WARNING_TIME' => phpbb::$user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'],
));
}
@@ -133,17 +129,15 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
- global $template, $db, $user, $auth;
-
- $user->add_lang('memberlist');
+ phpbb::$user->add_lang('memberlist');
$start = request_var('start', 0);
$st = request_var('st', 0);
$sk = request_var('sk', 'b');
$sd = request_var('sd', 'd');
- $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
- $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
+ $limit_days = array(0 => phpbb::$user->lang['ALL_ENTRIES'], 1 => phpbb::$user->lang['1_DAY'], 7 => phpbb::$user->lang['7_DAYS'], 14 => phpbb::$user->lang['2_WEEKS'], 30 => phpbb::$user->lang['1_MONTH'], 90 => phpbb::$user->lang['3_MONTHS'], 180 => phpbb::$user->lang['6_MONTHS'], 365 => phpbb::$user->lang['1_YEAR']);
+ $sort_by_text = array('a' => phpbb::$user->lang['SORT_USERNAME'], 'b' => phpbb::$user->lang['SORT_DATE'], 'c' => phpbb::$user->lang['SORT_WARNINGS']);
$sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
@@ -168,7 +162,7 @@ class mcp_warn
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid('memberlist', 'mode=viewprofile&amp;u=' . $row['user_id']),
- 'WARNING_TIME' => $user->format_date($row['user_last_warning']),
+ 'WARNING_TIME' => phpbb::$user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'],
));
}
@@ -182,7 +176,7 @@ class mcp_warn
'PAGE_NUMBER' => on_page($user_count, phpbb::$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, phpbb::$config['topics_per_page'], $start),
- 'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
+ 'TOTAL_USERS' => ($user_count == 1) ? phpbb::$user->lang['LIST_USER'] : sprintf(phpbb::$user->lang['LIST_USERS'], $user_count),
));
}
@@ -191,8 +185,6 @@ class mcp_warn
*/
function mcp_warn_post_view($action)
{
- global $template, $db, $user, $auth;
-
$post_id = request_var('p', 0);
$forum_id = request_var('f', 0);
$notify = phpbb_request::is_set('notify_user');
@@ -218,7 +210,7 @@ class mcp_warn
}
// Prevent someone from warning themselves
- if ($user_row['user_id'] == $user->data['user_id'])
+ if ($user_row['user_id'] == phpbb::$user->data['user_id'])
{
trigger_error('CANNOT_WARN_SELF');
}
@@ -269,15 +261,15 @@ class mcp_warn
if (check_form_key('mcp_warn'))
{
add_warning($user_row, $warning, $notify, $post_id);
- $msg = $user->lang['USER_WARNING_ADDED'];
+ $msg = phpbb::$user->lang['USER_WARNING_ADDED'];
}
else
{
- $msg = $user->lang['FORM_INVALID'];
+ $msg = phpbb::$user->lang['FORM_INVALID'];
}
$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>'));
+ trigger_error($msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// OK, they didn't submit a warning so lets build the page for them to do so
@@ -314,14 +306,14 @@ class mcp_warn
'USERNAME' => $user_row['username'],
'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
'RANK_TITLE' => $rank_title,
- 'JOINED' => $user->format_date($user_row['user_regdate']),
+ 'JOINED' => phpbb::$user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
- '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"),
+ 'L_WARNING_POST_DEFAULT' => sprintf(phpbb::$user->lang['WARNING_POST_DEFAULT'], generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&amp;p=$post_id#p$post_id"),
'S_CAN_NOTIFY' => $s_can_notify,
));
@@ -333,7 +325,6 @@ class mcp_warn
function mcp_warn_user_view($action)
{
global $module;
- global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -355,7 +346,7 @@ class mcp_warn
}
// Prevent someone from warning themselves
- if ($user_row['user_id'] == $user->data['user_id'])
+ if ($user_row['user_id'] == phpbb::$user->data['user_id'])
{
trigger_error('CANNOT_WARN_SELF');
}
@@ -392,15 +383,15 @@ class mcp_warn
if (check_form_key('mcp_warn'))
{
add_warning($user_row, $warning, $notify);
- $msg = $user->lang['USER_WARNING_ADDED'];
+ $msg = phpbb::$user->lang['USER_WARNING_ADDED'];
}
else
{
- $msg = $user->lang['FORM_INVALID'];
+ $msg = phpbb::$user->lang['FORM_INVALID'];
}
$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>'));
+ trigger_error($msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// Generate the appropriate user information for the user we are looking at
@@ -419,7 +410,7 @@ class mcp_warn
'USERNAME' => $user_row['username'],
'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
'RANK_TITLE' => $rank_title,
- 'JOINED' => $user->format_date($user_row['user_regdate']),
+ 'JOINED' => phpbb::$user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
@@ -438,8 +429,6 @@ class mcp_warn
*/
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
- global $template, $db, $user, $auth;
-
if ($send_pm)
{
include_once(PHPBB_ROOT_PATH . 'includes/functions_privmsgs.' . PHP_EXT);
@@ -454,9 +443,9 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
$message_parser->parse(true, true, true, false, false, true, true);
$pm_data = array(
- 'from_user_id' => $user->data['user_id'],
- 'from_user_ip' => $user->ip,
- 'from_username' => $user->data['username'],
+ 'from_user_id' => phpbb::$user->data['user_id'],
+ 'from_user_ip' => phpbb::$user->ip,
+ 'from_username' => phpbb::$user->data['username'],
'enable_sig' => false,
'enable_bbcode' => true,
'enable_smilies' => true,