diff options
Diffstat (limited to 'phpBB/includes/mcp/mcp_warn.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 1016204ff8..d396d004dc 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -2,9 +2,8 @@ /** * * @package mcp -* @version $Id$ * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -135,10 +134,11 @@ class mcp_warn */ function mcp_warn_list_view($action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $phpbb_container; global $template, $db, $user, $auth; $user->add_lang('memberlist'); + $pagination = $phpbb_container->get('pagination'); $start = request_var('start', 0); $st = request_var('st', 0); @@ -176,6 +176,9 @@ class mcp_warn )); } + $base_url = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&mode=list&st=$st&sk=$sk&sd=$sd"); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $user_count, $config['topics_per_page'], $start); + $template->assign_vars(array( 'U_POST_ACTION' => $this->u_action, 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, @@ -183,9 +186,7 @@ class mcp_warn 'S_SELECT_SORT_KEY' => $s_sort_key, '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&mode=list&st=$st&sk=$sk&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), + 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count), )); } @@ -252,7 +253,7 @@ class mcp_warn // Check if can send a notification if ($config['allow_privmsg']) { - $auth2 = new auth(); + $auth2 = new \phpbb\auth\auth(); $auth2->acl($user_row); $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; unset($auth2); @@ -288,28 +289,17 @@ class mcp_warn // We want to make the message available here as a reminder // Parse the message and subject - $message = censor_text($user_row['post_text']); - - // Second parse bbcode here - if ($user_row['bbcode_bitfield']) - { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - - $bbcode = new bbcode($user_row['bbcode_bitfield']); - $bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']); - } - - $message = bbcode_nl2br($message); - $message = smiley_text($message); + $parse_flags = OPTION_FLAG_SMILIES | ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0); + $message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true); // Generate the appropriate user information for the user we are looking at - if (!function_exists('get_user_avatar')) + if (!function_exists('phpbb_get_user_avatar')) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); } get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src); - $avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']); + $avatar_img = phpbb_get_user_avatar($user_row); $template->assign_vars(array( 'U_POST_ACTION' => $this->u_action, @@ -375,7 +365,7 @@ class mcp_warn // Check if can send a notification if ($config['allow_privmsg']) { - $auth2 = new auth(); + $auth2 = new \phpbb\auth\auth(); $auth2->acl($user_row); $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; unset($auth2); @@ -408,13 +398,13 @@ class mcp_warn } // Generate the appropriate user information for the user we are looking at - if (!function_exists('get_user_avatar')) + if (!function_exists('phpbb_get_user_avatar')) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); } get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src); - $avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']); + $avatar_img = phpbb_get_user_avatar($user_row); // OK, they didn't submit a warning so lets build the page for them to do so $template->assign_vars(array( @@ -507,5 +497,3 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']); } - -?>
\ No newline at end of file |