diff options
Diffstat (limited to 'phpBB/includes/mcp')
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_ban.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_logs.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_main.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_notes.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_pm_reports.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_queue.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_reports.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_warn.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_ban.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 27 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 132 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 225 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_notes.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_pm_reports.php | 8 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 85 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 25 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 7 | 
20 files changed, 152 insertions, 434 deletions
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php index 383df30498..a3a1e0ef9a 100644 --- a/phpBB/includes/mcp/info/mcp_ban.php +++ b/phpBB/includes/mcp/info/mcp_ban.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  *  */ @@ -35,5 +34,3 @@ class mcp_ban_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php index fe2f9fa1d7..fc30a600c0 100644 --- a/phpBB/includes/mcp/info/mcp_logs.php +++ b/phpBB/includes/mcp/info/mcp_logs.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  *  */ @@ -35,5 +34,3 @@ class mcp_logs_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php index 9755cdfc07..705715cbeb 100644 --- a/phpBB/includes/mcp/info/mcp_main.php +++ b/phpBB/includes/mcp/info/mcp_main.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  *  */ @@ -36,5 +35,3 @@ class mcp_main_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php index afe232e5b5..a77b461bbd 100644 --- a/phpBB/includes/mcp/info/mcp_notes.php +++ b/phpBB/includes/mcp/info/mcp_notes.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  *  */ @@ -34,5 +33,3 @@ class mcp_notes_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php index 103f560597..07dc564b19 100644 --- a/phpBB/includes/mcp/info/mcp_pm_reports.php +++ b/phpBB/includes/mcp/info/mcp_pm_reports.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  *  */ @@ -35,5 +34,3 @@ class mcp_pm_reports_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php index 7a256642b9..7ad79f9781 100644 --- a/phpBB/includes/mcp/info/mcp_queue.php +++ b/phpBB/includes/mcp/info/mcp_queue.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  *  */ @@ -35,5 +34,3 @@ class mcp_queue_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php index 3893ba5abb..cb6962a1d5 100644 --- a/phpBB/includes/mcp/info/mcp_reports.php +++ b/phpBB/includes/mcp/info/mcp_reports.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  *  */ @@ -35,5 +34,3 @@ class mcp_reports_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php index 2b0b09f75a..d5ac1eedbf 100644 --- a/phpBB/includes/mcp/info/mcp_warn.php +++ b/phpBB/includes/mcp/info/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  *  */ @@ -36,5 +35,3 @@ class mcp_warn_info  	{  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index d9f5eb8f22..d3bc336293 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.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  *  */ @@ -215,5 +214,3 @@ class mcp_ban  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index b70601b479..fec1edc872 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.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  *  */ @@ -23,6 +22,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  {  	global $template, $db, $user, $auth, $cache, $module;  	global $phpEx, $phpbb_root_path, $config; +	global $request;  	$user->add_lang(array('viewtopic', 'viewforum')); @@ -34,7 +34,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  	if ($merge_select)  	{  		// Fixes a "bug" that makes forum_view use the same ordering as topic_view -		unset($_POST['sk'], $_POST['sd'], $_REQUEST['sk'], $_REQUEST['sd']); +		$request->overwrite('sk', null); +		$request->overwrite('sd', null); +		$request->overwrite('sk', null, phpbb_request_interface::POST); +		$request->overwrite('sd', null, phpbb_request_interface::POST);  	}  	$forum_id			= $forum_info['forum_id']; @@ -128,7 +131,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  		'PAGINATION'			=> generate_pagination($url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&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'			=> $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),  	));  	// Grab icons @@ -146,10 +149,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  		$read_tracking_join = $read_tracking_select = '';  	} -	$sql = "SELECT t.topic_id -		FROM " . TOPICS_TABLE . " t -		WHERE t.forum_id IN($forum_id, 0) -			" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . " +	$sql = 'SELECT t.topic_id +		FROM ' . TOPICS_TABLE . ' t +		WHERE t.forum_id = ' . $forum_id . ' +			' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "  			$limit_time_sql  		ORDER BY t.topic_type DESC, $sort_order_sql";  	$result = $db->sql_query_limit($sql, $topics_per_page, $start); @@ -184,11 +187,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  	{  		if ($config['load_db_lastread'])  		{ -			$topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']), array()); +			$topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']));  		}  		else  		{ -			$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, array()); +			$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list);  		}  	} @@ -221,8 +224,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)  		$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_IMG_STYLE'		=> $folder_img,  			'TOPIC_FOLDER_IMG'		=> $user->img($folder_img, $folder_alt), -			'TOPIC_FOLDER_IMG_SRC'	=> $user->img($folder_img, $folder_alt, false, '', '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'] : '', @@ -443,5 +446,3 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)  		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index af262baa29..13398e62bc 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.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  *  */ @@ -39,7 +38,7 @@ function mcp_front_view($id, $mode, $action)  		{  			$sql = 'SELECT COUNT(post_id) AS total  				FROM ' . POSTS_TABLE . ' -				WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ') +				WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '  					AND post_approved = 0';  			$result = $db->sql_query($sql);  			$total = (int) $db->sql_fetchfield('total'); @@ -47,8 +46,6 @@ function mcp_front_view($id, $mode, $action)  			if ($total)  			{ -				$global_id = $forum_list[0]; -  				$sql = 'SELECT forum_id, forum_name  					FROM ' . FORUMS_TABLE . '  					WHERE ' . $db->sql_in_set('forum_id', $forum_list); @@ -62,7 +59,7 @@ function mcp_front_view($id, $mode, $action)  				$sql = 'SELECT post_id  					FROM ' . POSTS_TABLE . ' -					WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ') +					WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '  						AND post_approved = 0  					ORDER BY post_time DESC';  				$result = $db->sql_query_limit($sql, 5); @@ -81,7 +78,7 @@ function mcp_front_view($id, $mode, $action)  			if ($total)  			{ -				$sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id +				$sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.post_attachment, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id  					FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u  					WHERE ' . $db->sql_in_set('p.post_id', $post_list) . '  						AND t.topic_id = p.topic_id @@ -91,17 +88,11 @@ function mcp_front_view($id, $mode, $action)  				while ($row = $db->sql_fetchrow($result))  				{ -					$global_topic = ($row['forum_id']) ? false : true; -					if ($global_topic) -					{ -						$row['forum_id'] = $global_id; -					} -  					$template->assign_block_vars('unapproved', array(  						'U_POST_DETAILS'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']), -						'U_MCP_FORUM'		=> (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']) : '', +						'U_MCP_FORUM'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']),  						'U_MCP_TOPIC'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']), -						'U_FORUM'			=> (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', +						'U_FORUM'			=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),  						'U_TOPIC'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),  						'AUTHOR_FULL'		=> get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']), @@ -109,12 +100,13 @@ 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'	=> $forum_names[$row['forum_id']],  						'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'])) -					); +						'POST_TIME'		=> $user->format_date($row['post_time']), +						'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', +					));  				}  				$db->sql_freeresult($result);  			} @@ -126,22 +118,9 @@ function mcp_front_view($id, $mode, $action)  			$template->assign_vars(array(  				'S_HIDDEN_FIELDS'		=> $s_hidden_fields,  				'S_MCP_QUEUE_ACTION'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"), +				'L_UNAPPROVED_TOTAL'	=> $user->lang('UNAPPROVED_POSTS_TOTAL', (int) $total), +				'S_HAS_UNAPPROVED_POSTS'=> ($total != 0),  			)); - -			if ($total == 0) -			{ -				$template->assign_vars(array( -					'L_UNAPPROVED_TOTAL'		=> $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), -					'S_HAS_UNAPPROVED_POSTS'	=> true) -				); -			}  		}  	} @@ -159,31 +138,29 @@ function mcp_front_view($id, $mode, $action)  				WHERE r.post_id = p.post_id  					AND r.pm_id = 0  					AND r.report_closed = 0 -					AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')'; +					AND ' . $db->sql_in_set('p.forum_id', $forum_list);  			$result = $db->sql_query($sql);  			$total = (int) $db->sql_fetchfield('total');  			$db->sql_freeresult($result);  			if ($total)  			{ -				$global_id = $forum_list[0]; - -				$sql = $db->sql_build_query('SELECT', array( -					'SELECT'	=> 'r.report_time, p.post_id, p.post_subject, p.post_time, 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, t.topic_id, t.topic_title, f.forum_id, f.forum_name', +				$sql_ary = array( +					'SELECT'	=> 'r.report_time, p.post_id, p.post_subject, p.post_time, p.post_attachment, 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, t.topic_id, t.topic_title, f.forum_id, f.forum_name',  					'FROM'		=> array(  						REPORTS_TABLE			=> 'r',  						REPORTS_REASONS_TABLE	=> 'rr',  						TOPICS_TABLE			=> 't',  						USERS_TABLE				=> array('u', 'u2'), -						POSTS_TABLE				=> 'p' +						POSTS_TABLE				=> 'p',  					),  					'LEFT_JOIN'	=> array(  						array(  							'FROM'	=> array(FORUMS_TABLE => 'f'), -							'ON'	=> 'f.forum_id = p.forum_id' -						) +							'ON'	=> 'f.forum_id = p.forum_id', +						),  					),  					'WHERE'		=> 'r.post_id = p.post_id @@ -193,25 +170,20 @@ function mcp_front_view($id, $mode, $action)  						AND p.topic_id = t.topic_id  						AND r.user_id = u.user_id  						AND p.poster_id = u2.user_id -						AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')', +						AND ' . $db->sql_in_set('p.forum_id', $forum_list), -					'ORDER_BY'	=> 'p.post_time DESC' -				)); +					'ORDER_BY'	=> 'p.post_time DESC', +				); +				$sql = $db->sql_build_query('SELECT', $sql_ary);  				$result = $db->sql_query_limit($sql, 5);  				while ($row = $db->sql_fetchrow($result))  				{ -					$global_topic = ($row['forum_id']) ? false : true; -					if ($global_topic) -					{ -						$row['forum_id'] = $global_id; -					} -  					$template->assign_block_vars('report', array(  						'U_POST_DETAILS'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"), -						'U_MCP_FORUM'		=> (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view") : '', +						'U_MCP_FORUM'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view"),  						'U_MCP_TOPIC'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"), -						'U_FORUM'			=> (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', +						'U_FORUM'			=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),  						'U_TOPIC'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),  						'REPORTER_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), @@ -224,29 +196,20 @@ 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'	=> $row['forum_name'],  						'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']), +						'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',  					));  				}  			} -			if ($total == 0) -			{ -				$template->assign_vars(array( -					'L_REPORTS_TOTAL'	=>	$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), -					'S_HAS_REPORTS'		=> true) -				); -			} +			$template->assign_vars(array( +				'L_REPORTS_TOTAL'	=> $user->lang('REPORTS_TOTAL', (int) $total), +				'S_HAS_REPORTS'		=> ($total != 0), +			));  		}  	} @@ -269,14 +232,14 @@ function mcp_front_view($id, $mode, $action)  		{  			include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); -			$sql = $db->sql_build_query('SELECT', array( -				'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', +			$sql_ary = array( +				'SELECT'	=> 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, 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',  				'FROM'		=> array(  					REPORTS_TABLE			=> 'r',  					REPORTS_REASONS_TABLE	=> 'rr',  					USERS_TABLE				=> array('u', 'u2'), -					PRIVMSGS_TABLE				=> 'p' +					PRIVMSGS_TABLE				=> 'p',  				),  				'WHERE'		=> 'r.pm_id = p.msg_id @@ -286,8 +249,9 @@ function mcp_front_view($id, $mode, $action)  					AND r.user_id = u.user_id  					AND p.author_id = u2.user_id', -				'ORDER_BY'	=> 'p.message_time DESC' -			)); +				'ORDER_BY'	=> 'p.message_time DESC', +			); +			$sql_ary = $db->sql_build_query('SELECT', $sql_ary);  			$result = $db->sql_query_limit($sql, 5);  			$pm_by_id = $pm_list = array(); @@ -320,24 +284,15 @@ function mcp_front_view($id, $mode, $action)  					'REPORT_TIME'		=> $user->format_date($row['report_time']),  					'PM_TIME'			=> $user->format_date($row['message_time']),  					'RECIPIENTS'		=> implode(', ', $address_list[$row['msg_id']]), +					'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',  				));  			}  		} -		if ($total == 0) -		{ -			$template->assign_vars(array( -				'L_PM_REPORTS_TOTAL'	=>	$user->lang['PM_REPORTS_ZERO_TOTAL'], -				'S_HAS_PM_REPORTS'		=>	false) -			); -		} -		else -		{ -			$template->assign_vars(array( -				'L_PM_REPORTS_TOTAL'	=> ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total), -				'S_HAS_PM_REPORTS'		=> true) -			); -		} +		$template->assign_vars(array( +			'L_PM_REPORTS_TOTAL'	=> $user->lang('PM_REPORTS_TOTAL', (int) $total), +			'S_HAS_PM_REPORTS'		=> ($total != 0), +		));  	}  	// Latest 5 logs @@ -347,9 +302,6 @@ function mcp_front_view($id, $mode, $action)  		if (!empty($forum_list))  		{ -			// Add forum_id 0 for global announcements -			$forum_list[] = 0; -  			$log_count = false;  			$log = array();  			view_log('mod', $log, $log_count, 5, 0, $forum_list); @@ -376,5 +328,3 @@ function mcp_front_view($id, $mode, $action)  	$template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));  	make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_', true);  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 73ff72c177..848bad40a3 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.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  *  */ @@ -174,7 +173,7 @@ class mcp_logs  		$template->assign_vars(array(  			'PAGE_NUMBER'		=> on_page($log_count, $config['topics_per_page'], $start), -			'TOTAL'				=> ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count), +			'TOTAL'				=> $user->lang('TOTAL_LOGS', (int) $log_count),  			'PAGINATION'		=> generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),  			'L_TITLE'			=> $user->lang['MCP_LOGS'], @@ -214,5 +213,3 @@ class mcp_logs  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index ffede11d37..a21c67924d 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.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  *  */ @@ -332,131 +331,22 @@ function change_topic_type($action, $topic_ids)  	if (confirm_box(true))  	{ -		if ($new_topic_type != POST_GLOBAL) +		$sql = 'UPDATE ' . TOPICS_TABLE . " +			SET topic_type = $new_topic_type +			WHERE " . $db->sql_in_set('topic_id', $topic_ids); +		$db->sql_query($sql); + +		if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids))  		{ +			// Delete topic shadows for global announcements +			$sql = 'DELETE FROM ' . TOPICS_TABLE . ' +				WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); +			$db->sql_query($sql); +  			$sql = 'UPDATE ' . TOPICS_TABLE . "  				SET topic_type = $new_topic_type -				WHERE " . $db->sql_in_set('topic_id', $topic_ids) . ' -					AND forum_id <> 0'; +					WHERE " . $db->sql_in_set('topic_id', $topic_ids);  			$db->sql_query($sql); - -			// Reset forum id if a global topic is within the array -			$to_forum_id = request_var('to_forum_id', 0); - -			if ($to_forum_id) -			{ -				$sql = 'UPDATE ' . TOPICS_TABLE . " -					SET topic_type = $new_topic_type, forum_id = $to_forum_id -					WHERE " . $db->sql_in_set('topic_id', $topic_ids) . ' -						AND forum_id = 0'; -				$db->sql_query($sql); - -				// Update forum_ids for all posts -				$sql = 'UPDATE ' . POSTS_TABLE . " -					SET forum_id = $to_forum_id -					WHERE " . $db->sql_in_set('topic_id', $topic_ids) . ' -						AND forum_id = 0'; -				$db->sql_query($sql); - -				// Do a little forum sync stuff -				$sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed -					FROM ' . TOPICS_TABLE . ' t -					WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids); -				$result = $db->sql_query($sql); -				$row_data = $db->sql_fetchrow($result); -				$db->sql_freeresult($result); - -				$sync_sql = array(); - -				if ($row_data['topic_posts']) -				{ -					$sync_sql[$to_forum_id][]	= 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts']; -				} - -				if ($row_data['topics_authed']) -				{ -					$sync_sql[$to_forum_id][]	= 'forum_topics = forum_topics + ' . (int) $row_data['topics_authed']; -				} - -				$sync_sql[$to_forum_id][]	= 'forum_topics_real = forum_topics_real + ' . (int) sizeof($topic_ids); - -				foreach ($sync_sql as $forum_id_key => $array) -				{ -					$sql = 'UPDATE ' . FORUMS_TABLE . ' -						SET ' . implode(', ', $array) . ' -						WHERE forum_id = ' . $forum_id_key; -					$db->sql_query($sql); -				} - -				sync('forum', 'forum_id', $to_forum_id); -			} -		} -		else -		{ -			// Get away with those topics already being a global announcement by re-calculating $topic_ids -			$sql = 'SELECT topic_id -				FROM ' . TOPICS_TABLE . ' -				WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' -					AND forum_id <> 0'; -			$result = $db->sql_query($sql); - -			$topic_ids = array(); -			while ($row = $db->sql_fetchrow($result)) -			{ -				$topic_ids[] = $row['topic_id']; -			} -			$db->sql_freeresult($result); - -			if (sizeof($topic_ids)) -			{ -				// Delete topic shadows for global announcements -				$sql = 'DELETE FROM ' . TOPICS_TABLE . ' -					WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); -				$db->sql_query($sql); - -				$sql = 'UPDATE ' . TOPICS_TABLE . " -					SET topic_type = $new_topic_type, forum_id = 0 -						WHERE " . $db->sql_in_set('topic_id', $topic_ids); -				$db->sql_query($sql); - -				// Update forum_ids for all posts -				$sql = 'UPDATE ' . POSTS_TABLE . ' -					SET forum_id = 0 -					WHERE ' . $db->sql_in_set('topic_id', $topic_ids); -				$db->sql_query($sql); - -				// Do a little forum sync stuff -				$sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts, COUNT(t.topic_approved) as topics_authed -					FROM ' . TOPICS_TABLE . ' t -					WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids); -				$result = $db->sql_query($sql); -				$row_data = $db->sql_fetchrow($result); -				$db->sql_freeresult($result); - -				$sync_sql = array(); - -				if ($row_data['topic_posts']) -				{ -					$sync_sql[$forum_id][]	= 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts']; -				} - -				if ($row_data['topics_authed']) -				{ -					$sync_sql[$forum_id][]	= 'forum_topics = forum_topics - ' . (int) $row_data['topics_authed']; -				} - -				$sync_sql[$forum_id][]	= 'forum_topics_real = forum_topics_real - ' . (int) sizeof($topic_ids); - -				foreach ($sync_sql as $forum_id_key => $array) -				{ -					$sql = 'UPDATE ' . FORUMS_TABLE . ' -						SET ' . implode(', ', $array) . ' -						WHERE forum_id = ' . $forum_id_key; -					$db->sql_query($sql); -				} - -				sync('forum', 'forum_id', $forum_id); -			}  		}  		$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED'; @@ -473,41 +363,7 @@ function change_topic_type($action, $topic_ids)  	}  	else  	{ -		// Global topic involved? -		$global_involved = false; - -		if ($new_topic_type != POST_GLOBAL) -		{ -			$sql = 'SELECT forum_id -				FROM ' . TOPICS_TABLE . ' -				WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' -					AND forum_id = 0'; -			$result = $db->sql_query($sql); -			$row = $db->sql_fetchrow($result); -			$db->sql_freeresult($result); - -			if ($row) -			{ -				$global_involved = true; -			} -		} - -		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']) -			); - -			confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields), 'mcp_move.html'); -		} -		else -		{ -			confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields)); -		} +		confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));  	}  	$redirect = request_var('redirect', "index.$phpEx"); @@ -531,6 +387,7 @@ function mcp_move_topic($topic_ids)  {  	global $auth, $user, $db, $template;  	global $phpEx, $phpbb_root_path; +	global $request;  	// Here we limit the operation to one forum only  	$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true); @@ -584,8 +441,8 @@ function mcp_move_topic($topic_ids)  	if (!$to_forum_id || $additional_msg)  	{ -		unset($_POST['confirm']); -		unset($_REQUEST['confirm_key']); +		$request->overwrite('confirm', null, phpbb_request_interface::POST); +		$request->overwrite('confirm_key', null);  	}  	if (confirm_box(true)) @@ -626,16 +483,13 @@ function mcp_move_topic($topic_ids)  			$topic_posts_added += $topic_info['topic_replies']; -			if ($topic_info['topic_type'] != POST_GLOBAL) -			{ -				$topics_removed++; -				$topic_posts_removed += $topic_info['topic_replies']; +			$topics_removed++; +			$topic_posts_removed += $topic_info['topic_replies']; -				if ($topic_info['topic_approved']) -				{ -					$topics_authed_removed++; -					$topic_posts_removed++; -				} +			if ($topic_info['topic_approved']) +			{ +				$topics_authed_removed++; +				$topic_posts_removed++;  			}  		} @@ -658,6 +512,14 @@ function mcp_move_topic($topic_ids)  		// Move topics, but do not resync yet  		move_topics($topic_ids, $to_forum_id, false); +		if ($request->is_set_post('move_lock_topics') && $auth->acl_get('m_lock', $to_forum_id)) +		{ +			$sql = 'UPDATE ' . TOPICS_TABLE . ' +				SET topic_status = ' . ITEM_LOCKED . ' +				WHERE ' . $db->sql_in_set('topic_id', $topic_ids); +			$db->sql_query($sql); +		} +  		$forum_ids = array($to_forum_id);  		foreach ($topic_data as $topic_id => $row)  		{ @@ -665,15 +527,6 @@ function mcp_move_topic($topic_ids)  			$forum_ids[] = $row['forum_id'];  			add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']); -			// If we have moved a global announcement, we need to correct the topic type -			if ($row['topic_type'] == POST_GLOBAL) -			{ -				$sql = 'UPDATE ' . TOPICS_TABLE . ' -					SET topic_type = ' . POST_ANNOUNCE . ' -					WHERE topic_id = ' . (int) $row['topic_id']; -				$db->sql_query($sql); -			} -  			// Leave a redirection if required and only if the topic is visible to users  			if ($leave_shadow && $row['topic_approved'] && $row['topic_type'] != POST_GLOBAL)  			{ @@ -755,6 +608,7 @@ function mcp_move_topic($topic_ids)  		$template->assign_vars(array(  			'S_FORUM_SELECT'		=> make_forum_select($to_forum_id, $forum_id, false, true, true, true),  			'S_CAN_LEAVE_SHADOW'	=> true, +			'S_CAN_LOCK_TOPIC'		=> ($auth->acl_get('m_lock', $to_forum_id)) ? true : false,  			'ADDITIONAL_MSG'		=> $additional_msg)  		); @@ -1036,8 +890,8 @@ function mcp_fork_topic($topic_ids)  	if ($additional_msg)  	{ -		unset($_POST['confirm']); -		unset($_REQUEST['confirm_key']); +		$request->overwrite('confirm', null, phpbb_request_interface::POST); +		$request->overwrite('confirm_key', null);  	}  	if (confirm_box(true)) @@ -1053,16 +907,11 @@ function mcp_fork_topic($topic_ids)  			if (!isset($search_type) && $topic_row['enable_indexing'])  			{  				// Select the search method and do some additional checks to ensure it can actually be utilised -				$search_type = basename($config['search_type']); - -				if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) -				{ -					trigger_error('NO_SUCH_SEARCH_MODULE'); -				} +				$search_type = $config['search_type'];  				if (!class_exists($search_type))  				{ -					include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); +					trigger_error('NO_SUCH_SEARCH_MODULE');  				}  				$error = false; @@ -1313,5 +1162,3 @@ function mcp_fork_topic($topic_ids)  		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 02a89c0251..99dbb8d86d 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.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  *  */ @@ -228,7 +227,7 @@ class mcp_notes  			'PAGE_NUMBER'		=> on_page($log_count, $config['topics_per_page'], $start),  			'PAGINATION'		=> generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start), -			'TOTAL_REPORTS'		=> ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count), +			'TOTAL_REPORTS'		=> $user->lang('LIST_REPORTS', (int) $log_count),  			'RANK_TITLE'		=> $rank_title,  			'JOINED'			=> $user->format_date($userrow['user_regdate']), @@ -247,5 +246,3 @@ class mcp_notes  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 72f77fae7c..d242929a80 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.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  *  */ @@ -293,6 +292,7 @@ class mcp_pm_reports  								'REPORT_TIME'			=> $user->format_date($row['report_time']),  								'RECIPIENTS'			=> implode(', ', $address_list[$row['msg_id']]), +								'ATTACH_ICON_IMG'		=> ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',  							));  						}  					} @@ -310,7 +310,7 @@ class mcp_pm_reports  					'PAGINATION'			=> generate_pagination($this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),  					'PAGE_NUMBER'			=> on_page($total, $config['topics_per_page'], $start),  					'TOTAL'					=> $total, -					'TOTAL_REPORTS'			=> ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),					 +					'TOTAL_REPORTS'			=> $user->lang('LIST_REPORTS', (int) $total),  					)  				); @@ -319,5 +319,3 @@ class mcp_pm_reports  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index ba45037a18..2a52a858b3 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.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  *  */ @@ -465,12 +464,10 @@ function change_poster(&$post_info, $userdata)  	}  	// refresh search cache of this post -	$search_type = basename($config['search_type']); +	$search_type = $config['search_type']; -	if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +	if (class_exists($search_type))  	{ -		require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); -  		// We do some additional checks in the module to ensure it can actually be utilised  		$error = false;  		$search = new $search_type($error); @@ -497,5 +494,3 @@ function change_poster(&$post_info, $userdata)  	// Now add log entry  	add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 764461fa53..ef32b5f03c 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.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  *  */ @@ -269,13 +268,11 @@ class mcp_queue  						trigger_error('NOT_MODERATOR');  					} -					$global_id = $forum_list[0]; -  					$forum_list = implode(', ', $forum_list);  					$sql = 'SELECT SUM(forum_topics) as sum_forum_topics -						FROM ' . FORUMS_TABLE . " -						WHERE forum_id IN (0, $forum_list)"; +						FROM ' . FORUMS_TABLE . ' +						WHERE ' . $db->sql_in_set('forum_id', $forum_list);  					$result = $db->sql_query($sql);  					$forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');  					$db->sql_freeresult($result); @@ -291,7 +288,6 @@ class mcp_queue  					$forum_info = $forum_info[$forum_id];  					$forum_list = $forum_id; -					$global_id = $forum_id;  				}  				$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>'; @@ -313,10 +309,10 @@ class mcp_queue  				if ($mode == 'unapproved_posts')  				{  					$sql = 'SELECT p.post_id -						FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . " -						WHERE p.forum_id IN (0, $forum_list) +						FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . ' +						WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '  							AND p.post_approved = 0 -							" . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' +							' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '  							' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "  							AND t.topic_id = p.topic_id  							AND t.topic_first_post_id <> p.post_id @@ -335,7 +331,7 @@ class mcp_queue  					if (sizeof($post_ids))  					{ -						$sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour +						$sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour  							FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u  							WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '  								AND t.topic_id = p.topic_id @@ -346,10 +342,7 @@ class mcp_queue  						$post_data = $rowset = array();  						while ($row = $db->sql_fetchrow($result))  						{ -							if ($row['forum_id']) -							{ -								$forum_names[] = $row['forum_id']; -							} +							$forum_names[] = $row['forum_id'];  							$post_data[$row['post_id']] = $row;  						}  						$db->sql_freeresult($result); @@ -367,9 +360,9 @@ class mcp_queue  				}  				else  				{ -					$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour +					$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour  						FROM ' . TOPICS_TABLE . " t -						WHERE forum_id IN (0, $forum_list) +						WHERE " . $db->sql_in_set('forum_id', $forum_list) . "  							AND topic_approved = 0  							$limit_time_sql  						ORDER BY $sort_order_sql"; @@ -378,10 +371,7 @@ class mcp_queue  					$rowset = array();  					while ($row = $db->sql_fetchrow($result))  					{ -						if ($row['forum_id']) -						{ -							$forum_names[] = $row['forum_id']; -						} +						$forum_names[] = $row['forum_id'];  						$rowset[] = $row;  					}  					$db->sql_freeresult($result); @@ -405,12 +395,6 @@ class mcp_queue  				foreach ($rowset as $row)  				{ -					$global_topic = ($row['forum_id']) ? false : true; -					if ($global_topic) -					{ -						$row['forum_id'] = $global_id; -					} -  					if (empty($row['post_username']))  					{  						$row['post_username'] = $user->lang['GUEST']; @@ -418,7 +402,7 @@ class mcp_queue  					$template->assign_block_vars('postrow', array(  						'U_TOPIC'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), -						'U_VIEWFORUM'		=> (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', +						'U_VIEWFORUM'		=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),  						'U_VIEWPOST'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),  						'U_VIEW_DETAILS'	=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$row['forum_id']}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')), @@ -428,11 +412,12 @@ 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'	=> $forum_names[$row['forum_id']],  						'POST_SUBJECT'	=> ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'],  						'TOPIC_TITLE'	=> $row['topic_title'], -						'POST_TIME'		=> $user->format_date($row['post_time'])) -					); +						'POST_TIME'		=> $user->format_date($row['post_time']), +						'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', +					));  				}  				unset($rowset, $forum_names); @@ -450,7 +435,7 @@ class mcp_queue  					'PAGINATION'			=> generate_pagination($this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),  					'PAGE_NUMBER'			=> on_page($total, $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'					=> $user->lang((($mode == 'unapproved_posts') ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),  				));  				$this->tpl_name = 'mcp_queue'; @@ -505,11 +490,7 @@ function approve_post($post_id_list, $id, $mode)  			}  			$topic_id_list[$post_data['topic_id']] = 1; - -			if ($post_data['forum_id']) -			{ -				$forum_id_list[$post_data['forum_id']] = 1; -			} +			$forum_id_list[$post_data['forum_id']] = 1;  			// User post update (we do not care about topic or post, since user posts are strictly connected to posts)  			// But we care about forums where post counts get not increased. ;) @@ -521,10 +502,7 @@ function approve_post($post_id_list, $id, $mode)  			// Topic or Post. ;)  			if ($post_data['topic_first_post_id'] == $post_id)  			{ -				if ($post_data['forum_id']) -				{ -					$total_topics++; -				} +				$total_topics++;  				$topic_approve_sql[] = $post_data['topic_id'];  				$approve_log[] = array( @@ -544,16 +522,13 @@ function approve_post($post_id_list, $id, $mode)  				);  			} -			if ($post_data['forum_id']) -			{ -				$total_posts++; +			$total_posts++; -				// Increment by topic_replies if we approve a topic... -				// This works because we do not adjust the topic_replies when re-approving a topic after an edit. -				if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies']) -				{ -					$total_posts += $post_data['topic_replies']; -				} +			// Increment by topic_replies if we approve a topic... +			// This works because we do not adjust the topic_replies when re-approving a topic after an edit. +			if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies']) +			{ +				$total_posts += $post_data['topic_replies'];  			}  			$post_approve_sql[] = $post_id; @@ -745,6 +720,7 @@ function disapprove_post($post_id_list, $id, $mode)  {  	global $db, $template, $user, $config;  	global $phpEx, $phpbb_root_path; +	global $request;  	if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))  	{ @@ -779,9 +755,10 @@ function disapprove_post($post_id_list, $id, $mode)  		if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))  		{  			$additional_msg = $user->lang['NO_REASON_DISAPPROVAL']; -			unset($_REQUEST['confirm_key']); -			unset($_POST['confirm_key']); -			unset($_POST['confirm']); + +			$request->overwrite('confirm', null, phpbb_request_interface::POST); +			$request->overwrite('confirm_key', null, phpbb_request_interface::POST); +			$request->overwrite('confirm_key', null, phpbb_request_interface::REQUEST);  		}  		else  		{ @@ -995,5 +972,3 @@ function disapprove_post($post_id_list, $id, $mode)  		trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index def5422be2..95e84e816b 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.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  *  */ @@ -313,7 +312,6 @@ class mcp_reports  					$forum_info = $forum_info[$forum_id];  					$forum_list = array($forum_id); -					$global_id = $forum_id;  				}  				$forum_list[] = 0; @@ -369,7 +367,7 @@ class mcp_reports  				if (sizeof($report_ids))  				{ -					$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id +					$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id  						FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru  						WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . '  							AND t.topic_id = p.topic_id @@ -383,14 +381,8 @@ class mcp_reports  					$report_data = $rowset = array();  					while ($row = $db->sql_fetchrow($result))  					{ -						$global_topic = ($row['forum_id']) ? false : true; -						if ($global_topic) -						{ -							$row['forum_id'] = $global_id; -						} -  						$template->assign_block_vars('postrow', array( -							'U_VIEWFORUM'				=> (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', +							'U_VIEWFORUM'				=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),  							'U_VIEWPOST'				=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . '#p' . $row['post_id'],  							'U_VIEW_DETAILS'			=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&start=$start&mode=report_details&f={$row['forum_id']}&r={$row['report_id']}"), @@ -404,14 +396,15 @@ 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'	=> $forum_data[$row['forum_id']]['forum_name'],  							'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']),  							'REPORT_ID'		=> $row['report_id'],  							'REPORT_TIME'	=> $user->format_date($row['report_time']), -							'TOPIC_TITLE'	=> $row['topic_title']) -						); +							'TOPIC_TITLE'	=> $row['topic_title'], +							'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', +						));  					}  					$db->sql_freeresult($result);  					unset($report_ids, $row); @@ -431,7 +424,7 @@ class mcp_reports  					'PAGE_NUMBER'			=> on_page($total, $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'			=> $user->lang('LIST_REPORTS', (int) $total),  					)  				); @@ -724,5 +717,3 @@ function close_report($report_id_list, $mode, $action, $pm = false)  		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index d7cc1e795a..598b470663 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.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  *  */ @@ -336,7 +335,7 @@ function mcp_topic_view($id, $mode, $action)  		'PAGE_NUMBER'		=> on_page($total, $posts_per_page, $start),  		'PAGINATION'		=> (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&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'		=> $user->lang('VIEW_TOPIC_POSTS', (int) $total),  	));  } @@ -638,5 +637,3 @@ function merge_posts($topic_id, $to_topic_id)  		trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 63e5b19155..d8e655000f 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  *  */ @@ -185,7 +184,7 @@ class mcp_warn  			'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),  		));  	} @@ -507,5 +506,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  | 
