Changeset 702 for trunk/forum/includes/mcp
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- Location:
- trunk/forum/includes/mcp
- Files:
-
- 8 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 } -
trunk/forum/includes/mcp/mcp_logs.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_logs.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 … … 165 165 $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); 166 166 167 $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); 168 $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 169 167 170 // Grab log data 168 171 $log_data = array(); 169 172 $log_count = 0; 170 view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort );173 view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords); 171 174 172 175 $template->assign_vars(array( 173 176 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), 174 177 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count), 175 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param ", $log_count, $config['topics_per_page'], $start),178 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start), 176 179 177 180 'L_TITLE' => $user->lang['MCP_LOGS'], … … 183 186 'S_SELECT_SORT_DAYS' => $s_limit_days, 184 187 'S_LOGS' => ($log_count > 0), 188 'S_KEYWORDS' => $keywords, 185 189 ) 186 190 ); … … 189 193 { 190 194 $data = array(); 191 195 192 196 $checks = array('viewtopic', 'viewforum'); 193 197 foreach ($checks as $check) -
trunk/forum/includes/mcp/mcp_main.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_main.php 8950 2008-09-27 10:59:25Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 569 569 $additional_msg = $user->lang['FORUM_NOT_POSTABLE']; 570 570 } 571 else if (!$auth->acl_get('f_post', $to_forum_id) )571 else if (!$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id))) 572 572 { 573 573 $additional_msg = $user->lang['USER_CANNOT_POST']; … … 595 595 $leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false; 596 596 597 $topics_moved = sizeof($topic_ids);598 $topics_authed_moved = 0;599 597 $forum_sync_data = array(); 600 598 … … 602 600 $forum_sync_data[$to_forum_id] = $forum_data; 603 601 602 // Real topics added to target forum 603 $topics_moved = sizeof($topic_data); 604 605 // Approved topics added to target forum 606 $topics_authed_moved = 0; 607 608 // Posts (topic replies + topic post if approved) added to target forum 609 $topic_posts_added = 0; 610 611 // Posts (topic replies + topic post if approved and not global announcement) removed from source forum 612 $topic_posts_removed = 0; 613 614 // Real topics removed from source forum (all topics without global announcements) 615 $topics_removed = 0; 616 617 // Approved topics removed from source forum (except global announcements) 618 $topics_authed_removed = 0; 619 604 620 foreach ($topic_data as $topic_id => $topic_info) 605 621 { 606 if ($topic_info['topic_approved'] == '1')622 if ($topic_info['topic_approved']) 607 623 { 608 624 $topics_authed_moved++; 625 $topic_posts_added++; 626 } 627 628 $topic_posts_added += $topic_info['topic_replies']; 629 630 if ($topic_info['topic_type'] != POST_GLOBAL) 631 { 632 $topics_removed++; 633 $topic_posts_removed += $topic_info['topic_replies']; 634 635 if ($topic_info['topic_approved']) 636 { 637 $topics_authed_removed++; 638 $topic_posts_removed++; 639 } 609 640 } 610 641 } … … 612 643 $db->sql_transaction('begin'); 613 644 614 $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts615 FROM ' . TOPICS_TABLE . ' t616 WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);617 $result = $db->sql_query($sql);618 $row_data = $db->sql_fetchrow($result);619 $db->sql_freeresult($result);620 621 645 $sync_sql = array(); 622 646 623 if ($row_data['topic_posts']) 624 { 625 $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts']; 626 $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts']; 647 if ($topic_posts_added) 648 { 649 $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $topic_posts_added; 627 650 } 628 651 629 652 if ($topics_authed_moved) 630 653 { 631 $sync_sql[$to_forum_id][] 632 } 633 634 $sync_sql[$to_forum_id][] 654 $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved; 655 } 656 657 $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved; 635 658 636 659 // Move topics, but do not resync yet … … 693 716 $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow)); 694 717 695 $topics_authed_moved--; 696 $topics_moved--; 718 // Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts 719 $topics_removed--; 720 $topics_authed_removed--; 697 721 } 698 722 } 699 723 unset($topic_data); 700 724 701 $sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) $topics_moved; 702 703 if ($topics_authed_moved) 704 { 705 $sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $topics_authed_moved; 725 if ($topic_posts_removed) 726 { 727 $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . $topic_posts_removed; 728 } 729 730 if ($topics_removed) 731 { 732 $sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) $topics_removed; 733 } 734 735 if ($topics_authed_removed) 736 { 737 $sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $topics_authed_removed; 706 738 } 707 739 … … 782 814 foreach ($data as $topic_id => $row) 783 815 { 784 add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']); 816 if ($row['topic_moved_id']) 817 { 818 add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']); 819 } 820 else 821 { 822 add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); 823 } 785 824 } 786 825 … … 866 905 foreach ($post_data as $id => $row) 867 906 { 868 add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']); 907 $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; 908 add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username); 869 909 } 870 910 … … 930 970 else 931 971 { 972 if ($affected_topics != 1 || $deleted_topics || !$topic_id) 973 { 974 $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", false); 975 } 976 932 977 meta_refresh(3, $redirect); 933 978 trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link)); … … 1028 1073 'poll_title' => (string) $topic_row['poll_title'], 1029 1074 'poll_start' => (int) $topic_row['poll_start'], 1030 'poll_length' => (int) $topic_row['poll_length'] 1075 'poll_length' => (int) $topic_row['poll_length'], 1076 'poll_max_options' => (int) $topic_row['poll_max_options'], 1077 'poll_vote_change' => (int) $topic_row['poll_vote_change'], 1031 1078 ); 1032 1079 … … 1130 1177 'is_orphan' => (int) $attach_row['is_orphan'], 1131 1178 'poster_id' => (int) $attach_row['poster_id'], 1132 'physical_filename' => (string) basename($attach_row['physical_filename']),1133 'real_filename' => (string) basename($attach_row['real_filename']),1179 'physical_filename' => (string) utf8_basename($attach_row['physical_filename']), 1180 'real_filename' => (string) utf8_basename($attach_row['real_filename']), 1134 1181 'download_count' => (int) $attach_row['download_count'], 1135 1182 'attach_comment' => (string) $attach_row['attach_comment'], … … 1190 1237 1191 1238 sync('forum', 'forum_id', $to_forum_id); 1192 set_config ('num_topics', $config['num_topics'] +sizeof($new_topic_id_list), true);1193 set_config ('num_posts', $config['num_posts'] +$total_posts, true);1239 set_config_count('num_topics', sizeof($new_topic_id_list), true); 1240 set_config_count('num_posts', $total_posts, true); 1194 1241 1195 1242 foreach ($new_topic_id_list as $topic_id => $new_topic_id) -
trunk/forum/includes/mcp/mcp_notes.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_notes.php 8598 2008-06-04 15:37:06Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 194 194 $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); 195 195 196 $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); 197 $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 198 196 199 $log_data = array(); 197 200 $log_count = 0; 198 view_log('user', $log_data, $log_count, $config[' posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);201 view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords); 199 202 200 203 if ($log_count) … … 220 223 'S_SELECT_SORT_KEY' => $s_sort_key, 221 224 'S_SELECT_SORT_DAYS' => $s_limit_days, 225 'S_KEYWORDS' => $keywords, 222 226 223 227 'L_TITLE' => $user->lang['MCP_NOTES_USER'], 224 228 225 'PAGE_NUMBER' => on_page($log_count, $config[' posts_per_page'], $start),226 'PAGINATION' => generate_pagination($this->u_action . "& st=$st&sk=$sk&sd=$sd", $log_count, $config['posts_per_page'], $start),229 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), 230 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start), 227 231 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count), 228 232 229 'USERNAME' => $userrow['username'],230 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',231 233 'RANK_TITLE' => $rank_title, 232 234 'JOINED' => $user->format_date($userrow['user_regdate']), 233 235 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, 234 236 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, 237 238 'USERNAME_FULL' => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), 239 'USERNAME_COLOUR' => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), 240 'USERNAME' => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), 241 'U_PROFILE' => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), 235 242 236 243 'AVATAR_IMG' => $avatar_img, -
trunk/forum/includes/mcp/mcp_queue.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_queue.php 9133 2008-11-30 12:03:43Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 106 106 $template->assign_vars(array( 107 107 'S_TOPIC_REVIEW' => true, 108 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 108 109 'TOPIC_TITLE' => $post_info['topic_title']) 109 110 ); … … 492 493 493 494 $total_topics = $total_posts = 0; 494 $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array(); 495 $user_posts_sql = array(); 496 497 $update_forum_information = false; 495 $topic_approve_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array(); 496 $user_posts_sql = $post_approved_list = array(); 498 497 499 498 foreach ($post_info as $post_id => $post_data) 500 499 { 500 if ($post_data['post_approved']) 501 { 502 $post_approved_list[] = $post_id; 503 continue; 504 } 505 501 506 $topic_id_list[$post_data['topic_id']] = 1; 502 507 … … 518 523 if ($post_data['forum_id']) 519 524 { 520 if (!isset($forum_topics_posts[$post_data['forum_id']]))521 {522 $forum_topics_posts[$post_data['forum_id']] = array(523 'forum_posts' => 0,524 'forum_topics' => 0525 );526 }527 528 525 $total_topics++; 529 $forum_topics_posts[$post_data['forum_id']]['forum_topics']++;530 526 } 531 527 $topic_approve_sql[] = $post_data['topic_id']; … … 540 536 else 541 537 { 542 if (!isset($topic_replies_sql[$post_data['topic_id']]))543 {544 $topic_replies_sql[$post_data['topic_id']] = 0;545 }546 $topic_replies_sql[$post_data['topic_id']]++;547 548 538 $approve_log[] = array( 549 539 'type' => 'post', … … 556 546 if ($post_data['forum_id']) 557 547 { 558 if (!isset($forum_topics_posts[$post_data['forum_id']]))559 {560 $forum_topics_posts[$post_data['forum_id']] = array(561 'forum_posts' => 0,562 'forum_topics' => 0563 );564 }565 566 548 $total_posts++; 567 $forum_topics_posts[$post_data['forum_id']]['forum_posts']++;568 549 569 550 // Increment by topic_replies if we approve a topic... … … 572 553 { 573 554 $total_posts += $post_data['topic_replies']; 574 $forum_topics_posts[$post_data['forum_id']]['forum_posts'] += $post_data['topic_replies'];575 555 } 576 556 } 577 557 578 558 $post_approve_sql[] = $post_id; 579 580 // If the post is newer than the last post information stored we need to update the forum information 581 if ($post_data['post_time'] >= $post_data['forum_last_post_time'])582 {583 $update_forum_information = true;584 }559 } 560 561 $post_id_list = array_values(array_diff($post_id_list, $post_approved_list)); 562 for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++) 563 { 564 unset($post_info[$post_approved_list[$i]]); 585 565 } 586 566 … … 601 581 } 602 582 583 unset($topic_approve_sql, $post_approve_sql); 584 603 585 foreach ($approve_log as $log_data) 604 586 { 605 587 add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']); 606 }607 608 if (sizeof($topic_replies_sql))609 {610 foreach ($topic_replies_sql as $topic_id => $num_replies)611 {612 $sql = 'UPDATE ' . TOPICS_TABLE . "613 SET topic_replies = topic_replies + $num_replies614 WHERE topic_id = $topic_id";615 $db->sql_query($sql);616 }617 }618 619 if (sizeof($forum_topics_posts))620 {621 foreach ($forum_topics_posts as $forum_id => $row)622 {623 $sql = 'UPDATE ' . FORUMS_TABLE . '624 SET ';625 $sql .= ($row['forum_topics']) ? "forum_topics = forum_topics + {$row['forum_topics']}" : '';626 $sql .= ($row['forum_topics'] && $row['forum_posts']) ? ', ' : '';627 $sql .= ($row['forum_posts']) ? "forum_posts = forum_posts + {$row['forum_posts']}" : '';628 $sql .= " WHERE forum_id = $forum_id";629 630 $db->sql_query($sql);631 }632 588 } 633 589 … … 653 609 if ($total_topics) 654 610 { 655 set_config ('num_topics', $config['num_topics'] +$total_topics, true);611 set_config_count('num_topics', $total_topics, true); 656 612 } 657 613 658 614 if ($total_posts) 659 615 { 660 set_config('num_posts', $config['num_posts'] + $total_posts, true); 661 } 662 unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql); 663 664 update_post_information('topic', array_keys($topic_id_list)); 665 666 if ($update_forum_information) 667 { 668 update_post_information('forum', array_keys($forum_id_list)); 669 } 616 set_config_count('num_posts', $total_posts, true); 617 } 618 619 sync('topic', 'topic_id', array_keys($topic_id_list), true); 620 sync('forum', 'forum_id', array_keys($forum_id_list), true, true); 670 621 unset($topic_id_list, $forum_id_list); 671 622 … … 734 685 else 735 686 { 736 $success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';687 $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS'; 737 688 } 738 689 } … … 846 797 if (confirm_box(true)) 847 798 { 848 849 // If Topic -> forum_topics_real -= 1 850 // If Post -> topic_replies_real -= 1 851 852 $num_disapproved = 0; 853 $forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = $disapprove_log = array(); 854 799 $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array(); 800 $topic_replies_real = $post_disapprove_list = array(); 801 802 // Build a list of posts to be unapproved and get the related topics real replies count 855 803 foreach ($post_info as $post_id => $post_data) 856 804 { 857 $topic_id_list[$post_data['topic_id']] = 1; 858 859 if ($post_data['forum_id']) 860 { 861 $forum_id_list[$post_data['forum_id']] = 1; 862 } 863 864 // Topic or Post. ;) 865 /** 866 * @todo this probably is a different method than the one used by delete_posts, does this cause counter inconsistency? 867 */ 868 if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id) 869 { 870 if ($post_data['forum_id']) 871 { 872 if (!isset($forum_topics_real[$post_data['forum_id']])) 873 { 874 $forum_topics_real[$post_data['forum_id']] = 0; 875 } 876 $forum_topics_real[$post_data['forum_id']]++; 877 $num_disapproved++; 878 } 879 880 $disapprove_log[] = array( 881 'type' => 'topic', 882 'post_subject' => $post_data['post_subject'], 883 'forum_id' => $post_data['forum_id'], 884 'topic_id' => 0, // useless to log a topic id, as it will be deleted 805 $post_disapprove_list[$post_id] = $post_data['topic_id']; 806 if (!isset($topic_replies_real[$post_data['topic_id']])) 807 { 808 $topic_replies_real[$post_data['topic_id']] = $post_data['topic_replies_real']; 809 } 810 } 811 812 // Now we build the log array 813 foreach ($post_disapprove_list as $post_id => $topic_id) 814 { 815 // If the count of disapproved posts for the topic is greater 816 // than topic's real replies count, the whole topic is disapproved/deleted 817 if (sizeof(array_keys($post_disapprove_list, $topic_id)) > $topic_replies_real[$topic_id]) 818 { 819 // Don't write the log more than once for every topic 820 if (!isset($disapprove_log_topics[$topic_id])) 821 { 822 // Build disapproved topics log 823 $disapprove_log_topics[$topic_id] = array( 824 'type' => 'topic', 825 'post_subject' => $post_info[$post_id]['topic_title'], 826 'forum_id' => $post_info[$post_id]['forum_id'], 827 'topic_id' => 0, // useless to log a topic id, as it will be deleted 828 ); 829 } 830 } 831 else 832 { 833 // Build disapproved posts log 834 $disapprove_log_posts[] = array( 835 'type' => 'post', 836 'post_subject' => $post_info[$post_id]['post_subject'], 837 'forum_id' => $post_info[$post_id]['forum_id'], 838 'topic_id' => $post_info[$post_id]['topic_id'], 885 839 ); 886 } 887 else 888 { 889 if (!isset($topic_replies_real_sql[$post_data['topic_id']])) 890 { 891 $topic_replies_real_sql[$post_data['topic_id']] = 0; 892 } 893 $topic_replies_real_sql[$post_data['topic_id']]++; 894 895 $disapprove_log[] = array( 896 'type' => 'post', 897 'post_subject' => $post_data['post_subject'], 898 'forum_id' => $post_data['forum_id'], 899 'topic_id' => $post_data['topic_id'], 900 ); 901 } 902 903 $post_disapprove_sql[] = $post_id; 904 } 905 906 unset($post_data); 907 908 if (sizeof($forum_topics_real)) 909 { 910 foreach ($forum_topics_real as $forum_id => $topics_real) 911 { 912 $sql = 'UPDATE ' . FORUMS_TABLE . " 913 SET forum_topics_real = forum_topics_real - $topics_real 914 WHERE forum_id = $forum_id"; 915 $db->sql_query($sql); 916 } 917 } 918 919 if (sizeof($topic_replies_real_sql)) 920 { 921 foreach ($topic_replies_real_sql as $topic_id => $num_replies) 922 { 923 $sql = 'UPDATE ' . TOPICS_TABLE . " 924 SET topic_replies_real = topic_replies_real - $num_replies 925 WHERE topic_id = $topic_id"; 926 $db->sql_query($sql); 927 } 928 } 929 930 if (sizeof($post_disapprove_sql)) 840 841 } 842 } 843 844 // Get disapproved posts/topics counts separately 845 $num_disapproved_topics = sizeof($disapprove_log_topics); 846 $num_disapproved_posts = sizeof($disapprove_log_posts); 847 848 // Build the whole log 849 $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts); 850 851 // Unset unneeded arrays 852 unset($post_data, $disapprove_log_topics, $disapprove_log_posts); 853 854 // Let's do the job - delete disapproved posts 855 if (sizeof($post_disapprove_list)) 931 856 { 932 857 if (!function_exists('delete_posts')) … … 936 861 937 862 // We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts 938 delete_posts('post_id', $post_disapprove_sql); 863 // Note: function delete_posts triggers related forums/topics sync, 864 // so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually 865 delete_posts('post_id', array_keys($post_disapprove_list)); 939 866 940 867 foreach ($disapprove_log as $log_data) … … 943 870 } 944 871 } 945 unset($post_disapprove_sql, $topic_replies_real_sql);946 947 update_post_information('topic', array_keys($topic_id_list));948 949 if (sizeof($forum_id_list))950 {951 update_post_information('forum', array_keys($forum_id_list));952 }953 unset($topic_id_list, $forum_id_list);954 872 955 873 $messenger = new messenger(); … … 980 898 // Load up the language pack 981 899 $lang = array(); 982 @include($phpbb_root_path . '/language/' . $post_data['user_lang']. '/mcp.' . $phpEx);900 @include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx); 983 901 984 902 // If we find the reason in this language pack use it … … 1019 937 $messenger->save_queue(); 1020 938 1021 if ( sizeof($forum_topics_real))1022 { 1023 $success_msg = ($num_disapproved == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';939 if ($num_disapproved_topics) 940 { 941 $success_msg = ($num_disapproved_topics == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS'; 1024 942 } 1025 943 else 1026 944 { 1027 $success_msg = ( sizeof($post_id_list)== 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';945 $success_msg = ($num_disapproved_posts == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS'; 1028 946 } 1029 947 } -
trunk/forum/includes/mcp/mcp_reports.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_reports.php 9015 2008-10-14 18:29:50Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 78 78 AND rr.reason_id = r.reason_id 79 79 AND r.user_id = u.user_id 80 AND r.pm_id = 0 80 81 ORDER BY report_closed ASC'; 81 82 $result = $db->sql_query_limit($sql, 1); … … 116 117 $template->assign_vars(array( 117 118 'S_TOPIC_REVIEW' => true, 119 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 118 120 'TOPIC_TITLE' => $post_info['topic_title']) 119 121 ); … … 150 152 if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) 151 153 { 152 $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);153 154 154 $sql = 'SELECT * 155 155 FROM ' . ATTACHMENTS_TABLE . ' 156 156 WHERE post_msg_id = ' . $post_id . ' 157 157 AND in_message = 0 158 ORDER BY filetime DESC , post_msg_id ASC';158 ORDER BY filetime DESC'; 159 159 $result = $db->sql_query($sql); 160 160 … … 259 259 unset($forum_list_read); 260 260 261 if ($topic_id && $forum_id)261 if ($topic_id) 262 262 { 263 263 $topic_info = get_topic_data(array($topic_id)); … … 268 268 } 269 269 270 $topic_info = $topic_info[$topic_id]; 271 $forum_id = $topic_info['forum_id']; 272 } 273 else if ($topic_id && !$forum_id) 274 { 275 $topic_id = 0; 270 if ($forum_id != $topic_info[$topic_id]['forum_id']) 271 { 272 $topic_id = 0; 273 } 274 else 275 { 276 $topic_info = $topic_info[$topic_id]; 277 $forum_id = (int) $topic_info['forum_id']; 278 } 276 279 } 277 280 … … 330 333 331 334 $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; 332 $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';335 $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; 333 336 334 337 if ($mode == 'reports') … … 347 350 AND r.post_id = p.post_id 348 351 " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' 349 ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . '352 ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . ' 350 353 ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " 351 354 AND t.topic_id = p.topic_id 355 AND r.pm_id = 0 352 356 $limit_time_sql 353 357 ORDER BY $sort_order_sql"; … … 372 376 AND u.user_id = p.poster_id 373 377 AND ru.user_id = r.user_id 378 AND r.pm_id = 0 374 379 ORDER BY ' . $sort_order_sql; 375 380 $result = $db->sql_query($sql); … … 426 431 'TOPIC_ID' => $topic_id, 427 432 'TOTAL' => $total, 428 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total), 433 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total), 429 434 ) 430 435 ); … … 439 444 * Closes a report 440 445 */ 441 function close_report($report_id_list, $mode, $action )446 function close_report($report_id_list, $mode, $action, $pm = false) 442 447 { 443 global $db, $template, $user, $config ;448 global $db, $template, $user, $config, $auth; 444 449 global $phpEx, $phpbb_root_path; 445 450 446 $sql = 'SELECT r.post_id 447 FROM ' . REPORTS_TABLE . ' r 448 WHERE ' . $db->sql_in_set('r.report_id', $report_id_list); 451 $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; 452 $id_column = ($pm) ? 'pm_id' : 'post_id'; 453 $module = ($pm) ? 'pm_reports' : 'reports'; 454 $pm_prefix = ($pm) ? 'PM_' : ''; 455 456 $sql = "SELECT r.$id_column 457 FROM " . REPORTS_TABLE . ' r 458 WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . $pm_where; 449 459 $result = $db->sql_query($sql); 450 460 … … 452 462 while ($row = $db->sql_fetchrow($result)) 453 463 { 454 $post_id_list[] = $row[ 'post_id'];464 $post_id_list[] = $row[$id_column]; 455 465 } 456 466 $post_id_list = array_unique($post_id_list); 457 467 458 if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) 459 { 460 trigger_error('NOT_AUTHORISED'); 468 if ($pm) 469 { 470 if (!$auth->acl_getf_global('m_report')) 471 { 472 trigger_error('NOT_AUTHORISED'); 473 } 474 } 475 else 476 { 477 if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) 478 { 479 trigger_error('NOT_AUTHORISED'); 480 } 461 481 } 462 482 … … 465 485 $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); 466 486 } 487 elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) 488 { 489 $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); 490 } 467 491 else if ($action == 'close' && !request_var('r', 0)) 468 492 { 469 $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode= reports');493 $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); 470 494 } 471 495 else … … 478 502 479 503 $s_hidden_fields = build_hidden_fields(array( 480 'i' => 'reports',504 'i' => $module, 481 505 'mode' => $mode, 482 506 'report_id_list' => $report_id_list, … … 487 511 if (confirm_box(true)) 488 512 { 489 $post_info = get_post_data($post_id_list, 'm_report');490 491 $sql = 'SELECT r.report_id, r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type492 FROM '. REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u513 $post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report'); 514 515 $sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type 516 FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u 493 517 WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . ' 494 518 ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' 495 AND r.user_id = u.user_id' ;519 AND r.user_id = u.user_id' . $pm_where; 496 520 $result = $db->sql_query($sql); 497 521 … … 504 528 if (!$report['report_closed']) 505 529 { 506 $close_report_posts[] = $report['post_id']; 507 $close_report_topics[] = $post_info[$report['post_id']]['topic_id']; 530 $close_report_posts[] = $report[$id_column]; 531 532 if (!$pm) 533 { 534 $close_report_topics[] = $post_info[$report['post_id']]['topic_id']; 535 } 508 536 } 509 537 … … 520 548 $close_report_topics = array_unique($close_report_topics); 521 549 522 if ( sizeof($close_report_posts))550 if (!$pm && sizeof($close_report_posts)) 523 551 { 524 552 // Get a list of topics that still contain reported posts … … 559 587 if (sizeof($close_report_posts)) 560 588 { 561 $sql = 'UPDATE ' . POSTS_TABLE . ' 562 SET post_reported = 0 563 WHERE ' . $db->sql_in_set('post_id', $close_report_posts); 564 $db->sql_query($sql); 565 566 if (sizeof($close_report_topics)) 567 { 568 $sql = 'UPDATE ' . TOPICS_TABLE . ' 569 SET topic_reported = 0 570 WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' 571 OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); 589 if ($pm) 590 { 591 $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' 592 SET message_reported = 0 593 WHERE ' . $db->sql_in_set('msg_id', $close_report_posts); 572 594 $db->sql_query($sql); 595 596 if ($action == 'delete') 597 { 598 delete_pm(ANONYMOUS, $close_report_posts, PRIVMSGS_INBOX); 599 } 600 } 601 else 602 { 603 $sql = 'UPDATE ' . POSTS_TABLE . ' 604 SET post_reported = 0 605 WHERE ' . $db->sql_in_set('post_id', $close_report_posts); 606 $db->sql_query($sql); 607 608 if (sizeof($close_report_topics)) 609 { 610 $sql = 'UPDATE ' . TOPICS_TABLE . ' 611 SET topic_reported = 0 612 WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' 613 OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); 614 $db->sql_query($sql); 615 } 573 616 } 574 617 } … … 580 623 foreach ($reports as $report) 581 624 { 582 add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); 625 if ($pm) 626 { 627 add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']); 628 } 629 else 630 { 631 add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); 632 } 583 633 } 584 634 … … 595 645 } 596 646 597 $post_id = $reporter[ 'post_id'];598 599 $messenger->template( 'report_'. $action . 'd', $reporter['user_lang']);647 $post_id = $reporter[$id_column]; 648 649 $messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']); 600 650 601 651 $messenger->to($reporter['user_email'], $reporter['username']); 602 652 $messenger->im($reporter['user_jabber'], $reporter['username']); 603 653 604 $messenger->assign_vars(array( 605 'USERNAME' => htmlspecialchars_decode($reporter['username']), 606 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), 607 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])), 608 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title']))) 609 ); 654 if ($pm) 655 { 656 $messenger->assign_vars(array( 657 'USERNAME' => htmlspecialchars_decode($reporter['username']), 658 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), 659 'PM_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])), 660 )); 661 } 662 else 663 { 664 $messenger->assign_vars(array( 665 'USERNAME' => htmlspecialchars_decode($reporter['username']), 666 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), 667 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])), 668 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title']))) 669 ); 670 } 610 671 611 672 $messenger->send($reporter['user_notify_type']); 612 673 } 613 674 } 614 615 foreach ($post_info as $post) 616 { 617 $forum_ids[$post['forum_id']] = $post['forum_id']; 618 $topic_ids[$post['topic_id']] = $post['topic_id']; 619 } 620 675 676 if (!$pm) 677 { 678 foreach ($post_info as $post) 679 { 680 $forum_ids[$post['forum_id']] = $post['forum_id']; 681 $topic_ids[$post['topic_id']] = $post['topic_id']; 682 } 683 } 684 621 685 unset($notify_reporters, $post_info, $reports); 622 686 623 687 $messenger->save_queue(); 624 688 625 $success_msg = (sizeof($report_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_'. strtoupper($action) . 'D_SUCCESS';689 $success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS'; 626 690 } 627 691 else 628 692 { 629 confirm_box(false, $user->lang[strtoupper($action) . '_REPORT'. ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);693 confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); 630 694 } 631 695 … … 640 704 { 641 705 meta_refresh(3, $redirect); 706 642 707 $return_forum = ''; 643 if (sizeof($forum_ids == 1))644 {645 $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';646 }647 708 $return_topic = ''; 648 if (sizeof($topic_ids == 1)) 649 { 650 $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; 651 } 652 709 710 if (!$pm) 711 { 712 if (sizeof($forum_ids) === 1) 713 { 714 $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; 715 } 716 717 if (sizeof($topic_ids) === 1) 718 { 719 $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; 720 } 721 } 722 653 723 trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); 654 724 } -
trunk/forum/includes/mcp/mcp_topic.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_topic.php 9030 2008-10-19 18:32:11Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 107 107 if ($total == -1) 108 108 { 109 $total = $topic_info['topic_replies'] + 1; 109 if ($auth->acl_get('m_approve', $topic_info['forum_id'])) 110 { 111 $total = $topic_info['topic_replies_real'] + 1; 112 } 113 else 114 { 115 $total = $topic_info['topic_replies'] + 1; 116 } 110 117 } 111 118 … … 260 267 $s_topic_icons = false; 261 268 262 if ($auth->acl_get ('m_split',$topic_info['forum_id']))269 if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id'])) 263 270 { 264 271 include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); … … 302 309 'ACTION' => $action, 303 310 304 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED', false, true), 305 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED', false, true), 311 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), 312 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'), 313 'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'), 306 314 307 315 'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start", … … 502 510 503 511 // Update forum statistics 504 set_config ('num_topics', $config['num_topics'] +1, true);512 set_config_count('num_topics', 1, true); 505 513 506 514 // Link back to both topics -
trunk/forum/includes/mcp/mcp_warn.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_warn.php 9002 2008-10-11 17:01:43Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 205 205 $sql = 'SELECT u.*, p.* 206 206 FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u 207 WHERE p ost_id = $post_id207 WHERE p.post_id = $post_id 208 208 AND u.user_id = p.poster_id"; 209 209 $result = $db->sql_query($sql); … … 421 421 'U_POST_ACTION' => $this->u_action, 422 422 423 'USERNAME' => $user_row['username'],424 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',425 423 'RANK_TITLE' => $rank_title, 426 424 'JOINED' => $user->format_date($user_row['user_regdate']), 427 425 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, 428 426 'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0, 427 428 'USERNAME_FULL' => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 429 'USERNAME_COLOUR' => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 430 'USERNAME' => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 431 'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 429 432 430 433 'AVATAR_IMG' => $avatar_img,
Note:
See TracChangeset
for help on using the changeset viewer.