phpBB

Code Changes

File: includes/ucp/ucp_pm_viewfolder.php

  Unmodified   Added   Modified   Removed
Line 25Line 25
*/
function view_folder($id, $mode, $folder_id, $folder)
{

*/
function view_folder($id, $mode, $folder_id, $folder)
{

	global $user, $template, $auth, $db, $cache;

	global $user, $template, $auth, $db, $cache, $request;

	global $phpbb_root_path, $config, $phpEx;

$submit_export = (isset($_POST['submit_export'])) ? true : false;

	global $phpbb_root_path, $config, $phpEx;

$submit_export = (isset($_POST['submit_export'])) ? true : false;

Line 40Line 40
		$icons = $cache->obtain_icons();

$color_rows = array('marked', 'replied');

		$icons = $cache->obtain_icons();

$color_rows = array('marked', 'replied');


// only show the friend/foe color rows if the module is enabled
$zebra_enabled = false;

 

$_module = new p_master();
$_module->list_modules('ucp');


$_module = new p_master();
$_module->list_modules('ucp');

Line 196Line 193
	}
else
{

	}
else
{

		$export_type = request_var('export_option', '');
$enclosure = request_var('enclosure', '');
$delimiter = request_var('delimiter', '');

		$export_type = $request->variable('export_option', '');
$enclosure = $request->variable('enclosure', '');
$delimiter = $request->variable('delimiter', '');


if ($export_type == 'CSV' && ($delimiter === '' || $enclosure === ''))
{


if ($export_type == 'CSV' && ($delimiter === '' || $enclosure === ''))
{

Line 397Line 394
*/
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, $request, $phpbb_dispatcher;





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

	$start = $request->variable('start', 0);


// Additional vars later, pm ordering is mostly different from post ordering. :/


// Additional vars later, pm ordering is mostly different from post ordering. :/

	$sort_days	= request_var('st', 0);
$sort_key = request_var('sk', 't');
$sort_dir = request_var('sd', 'd');

	$sort_days	= $request->variable('st', 0);
$sort_key = $request->variable('sk', 't');
$sort_dir = $request->variable('sd', 'd');





 
	/* @var $pagination \phpbb\pagination */

	$pagination = $phpbb_container->get('pagination');

// PM ordering options

	$pagination = $phpbb_container->get('pagination');

// PM ordering options

Line 461Line 459
	$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 473

'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 533
		$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))