Changeset 702 for trunk/forum/includes/mcp/mcp_front.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/mcp/mcp_front.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_front.php 9029 2008-10-18 18:44:41Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 35 35 36 36 $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false); 37 37 38 38 if (!empty($forum_list)) 39 39 { … … 120 120 } 121 121 122 $s_hidden_fields = build_hidden_fields(array( 123 'redirect' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&f=' . $forum_id : '')) 124 )); 125 122 126 $template->assign_vars(array( 127 'S_HIDDEN_FIELDS' => $s_hidden_fields, 123 128 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"), 124 129 )); … … 153 158 FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p 154 159 WHERE r.post_id = p.post_id 160 AND r.pm_id = 0 155 161 AND r.report_closed = 0 156 162 AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')'; … … 182 188 183 189 'WHERE' => 'r.post_id = p.post_id 190 AND r.pm_id = 0 184 191 AND r.report_closed = 0 185 192 AND r.reason_id = rr.reason_id … … 241 248 ); 242 249 } 250 } 251 } 252 253 // Latest 5 reported PMs 254 if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report')) 255 { 256 $template->assign_var('S_SHOW_PM_REPORTS', true); 257 $user->add_lang(array('ucp')); 258 259 $sql = 'SELECT COUNT(r.report_id) AS total 260 FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p 261 WHERE r.post_id = 0 262 AND r.pm_id = p.msg_id 263 AND r.report_closed = 0'; 264 $result = $db->sql_query($sql); 265 $total = (int) $db->sql_fetchfield('total'); 266 $db->sql_freeresult($result); 267 268 if ($total) 269 { 270 include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); 271 272 $sql = $db->sql_build_query('SELECT', array( 273 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id', 274 275 'FROM' => array( 276 REPORTS_TABLE => 'r', 277 REPORTS_REASONS_TABLE => 'rr', 278 USERS_TABLE => array('u', 'u2'), 279 PRIVMSGS_TABLE => 'p' 280 ), 281 282 'WHERE' => 'r.pm_id = p.msg_id 283 AND r.post_id = 0 284 AND r.report_closed = 0 285 AND r.reason_id = rr.reason_id 286 AND r.user_id = u.user_id 287 AND p.author_id = u2.user_id', 288 289 'ORDER_BY' => 'p.message_time DESC' 290 )); 291 $result = $db->sql_query_limit($sql, 5); 292 293 $pm_by_id = $pm_list = array(); 294 while ($row = $db->sql_fetchrow($result)) 295 { 296 $pm_by_id[(int) $row['msg_id']] = $row; 297 $pm_list[] = (int) $row['msg_id']; 298 } 299 300 $address_list = get_recipient_strings($pm_by_id); 301 302 foreach ($pm_list as $message_id) 303 { 304 $row = $pm_by_id[$message_id]; 305 306 $template->assign_block_vars('pm_report', array( 307 'U_PM_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&i=pm_reports&mode=pm_report_details"), 308 309 'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 310 'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 311 'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 312 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 313 314 'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']), 315 'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']), 316 'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']), 317 'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']), 318 319 'PM_SUBJECT' => $row['message_subject'], 320 'REPORT_TIME' => $user->format_date($row['report_time']), 321 'PM_TIME' => $user->format_date($row['message_time']), 322 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), 323 )); 324 } 325 } 326 327 if ($total == 0) 328 { 329 $template->assign_vars(array( 330 'L_PM_REPORTS_TOTAL' => $user->lang['PM_REPORTS_ZERO_TOTAL'], 331 'S_HAS_PM_REPORTS' => false) 332 ); 333 } 334 else 335 { 336 $template->assign_vars(array( 337 'L_PM_REPORTS_TOTAL' => ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total), 338 'S_HAS_PM_REPORTS' => true) 339 ); 243 340 } 244 341 }
Note:
See TracChangeset
for help on using the changeset viewer.