phpBB

Code Changes

File: includes/ucp/ucp_pm_viewfolder.php

  Unmodified   Added   Modified   Removed
Line 397Line 397
*/
function get_pm_from($folder_id, $folder, $user_id)
{

*/
function get_pm_from($folder_id, $folder, $user_id)
{

	global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx;

	global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx, $phpbb_dispatcher;


$start = request_var('start', 0);



$start = request_var('start', 0);


Line 461Line 461
	$start = $pagination->validate_start($start, $config['topics_per_page'], $pm_count);
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start);


	$start = $pagination->validate_start($start, $config['topics_per_page'], $pm_count);
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start);


	$template->assign_vars(array(

	$template_vars = array(

		'TOTAL_MESSAGES'	=> $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),

'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),

		'TOTAL_MESSAGES'	=> $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),

'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),

Line 475Line 475

'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '',
'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')),


'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '',
'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')),

	));



























	);

/**
* Modify template variables before they are assigned
*
* @event core.ucp_pm_view_folder_get_pm_from_template
* @var int folder_id Folder ID
* @var array folder Folder data
* @var int user_id User ID
* @var string base_url Pagination base URL
* @var int start Pagination start
* @var int pm_count Count of PMs
* @var array template_vars Template variables to be assigned
* @since 3.1.11-RC1
*/
$vars = array(
'folder_id',
'folder',
'user_id',
'base_url',
'start',
'pm_count',
'template_vars',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_template', compact($vars)));

$template->assign_vars($template_vars);


// Grab all pm data
$rowset = $pm_list = array();


// Grab all pm data
$rowset = $pm_list = array();

Line 509Line 535
		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
}


		$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
}


	$sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE t.user_id = $user_id






	$sql_ary = array(
'SELECT' => 't.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported',
'FROM' => array(
PRIVMSGS_TO_TABLE => 't',
PRIVMSGS_TABLE => 'p',
USERS_TABLE => 'u',
),
'WHERE' => "t.user_id = $user_id

			AND p.author_id = u.user_id
AND $folder_sql
AND t.msg_id = p.msg_id

			AND p.author_id = u.user_id
AND $folder_sql
AND t.msg_id = p.msg_id

			$sql_limit_time
ORDER BY $sql_sort_order";
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);



















			$sql_limit_time",
'ORDER_BY' => $sql_sort_order,
);

/**
* Modify SQL before it is executed
*
* @event core.ucp_pm_view_folder_get_pm_from_sql
* @var array sql_ary SQL array
* @var int sql_limit SQL limit
* @var int sql_start SQL start
* @since 3.1.11-RC1
*/
$vars = array(
'sql_ary',
'sql_limit',
'sql_start',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_sql', compact($vars)));

$result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), $sql_limit, $sql_start);


$pm_reported = array();
while ($row = $db->sql_fetchrow($result))


$pm_reported = array();
while ($row = $db->sql_fetchrow($result))