diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 12 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 7 | 
2 files changed, 15 insertions, 4 deletions
| diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index cf82925e1d..2f7c289653 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -46,6 +46,9 @@ function compose_pm($id, $mode, $action)  	$draft_id		= request_var('d', 0);  	$lastclick		= request_var('lastclick', 0); +	// Reply to all triggered (quote/reply) +	$reply_to_all	= request_var('reply_to_all', 0); +  	// Do NOT use request_var or specialchars here  	$address_list	= isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array(); @@ -84,7 +87,7 @@ function compose_pm($id, $mode, $action)  		}  		redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'));  	} -	 +  	// Since viewtopic.php language entries are used in several modes,  	// we include the language file here  	$user->add_lang('viewtopic'); @@ -314,13 +317,14 @@ function compose_pm($id, $mode, $action)  			if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview)  			{ -				if ($action == 'quotepost') +				// Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all" +				if ($action == 'quotepost' || !$reply_to_all)  				{  					$address_list = array('u' => array($post['author_id'] => 'to'));  				}  				else  				{ -					// We try to include every previously listed member from the TO Header +					// We try to include every previously listed member from the TO Header - Reply to all  					$address_list = rebuild_header(array('to' => $post['to_address']));  					// Add the author (if he is already listed then this is no shame (it will be overwritten)) @@ -443,7 +447,7 @@ function compose_pm($id, $mode, $action)  	$max_recipients = (!$max_recipients) ? $config['pm_max_recipients'] : $max_recipients;  	// If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients -	if (($action == 'reply' || $action == 'quote') && $max_recipients) +	if (($action == 'reply' || $action == 'quote') && $max_recipients && $reply_to_all)  	{  		// We try to include every previously listed member from the TO Header  		$list = rebuild_header(array('to' => $post['to_address'])); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index dd15f5ff37..0e51e268cf 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -169,6 +169,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  	$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); +	// Number of "to" recipients +	$num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); +  	$template->assign_vars(array(  		'MESSAGE_AUTHOR_FULL'		=> get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),  		'MESSAGE_AUTHOR_COLOUR'		=> get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), @@ -215,13 +218,17 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  		'U_QUOTE'			=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '',  		'U_EDIT'			=> (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '',  		'U_POST_REPLY_PM'	=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', +		'U_POST_REPLY_ALL'	=> ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&reply_to_all=1&p=" . $message_row['msg_id'] : '',  		'U_PREVIOUS_PM'		=> "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous",  		'U_NEXT_PM'			=> "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next", +		'U_PM_ACTION'		=> $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], +  		'S_HAS_ATTACHMENTS'	=> (sizeof($attachments)) ? true : false,  		'S_DISPLAY_NOTICE'	=> $display_notice && $message_row['message_attachment'],  		'S_AUTHOR_DELETED'	=> ($author_id == ANONYMOUS) ? true : false,  		'S_SPECIAL_FOLDER'	=> in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), +		'S_PM_RECIPIENTS'	=> $num_recipients,  		'U_PRINT_PM'		=> ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',  		'U_FORWARD_PM'		=> ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') | 
