Bläddra i källkod

! Minor PM tweaks (correct confirmation message when deleting a conversation and don't count deleted PMs in the inbox total)

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 år sedan
förälder
incheckning
2f151bde65

+ 7 - 2
Sources/PersonalMessage.php

@@ -105,10 +105,12 @@ function MessageMain()
 			SELECT COUNT(*) AS total, SUM(is_read) AS num_read
 			FROM {db_prefix}pm_recipients
 			WHERE id_member = {int:current_member}
-				AND in_inbox = {int:in_inbox}',
+				AND in_inbox = {int:in_inbox}
+				AND deleted = {int:not_deleted}',
 			array(
 				'current_member' => $user_info['id'],
 				'in_inbox' => 1,
+				'not_deleted' => 0,
 			)
 		);
 		
@@ -181,6 +183,9 @@ function MessageMain()
 	$context['drafts_pm_save'] = !empty($modSettings['drafts_pm_enabled']) && allowedTo('pm_draft');
 	$context['drafts_autosave'] = !empty($context['drafts_pm_save']) && !empty($modSettings['drafts_autosave_enabled']) && allowedTo('pm_autosave_draft');
 
+	// Which message are we displaying for the delete confirm popup?
+	$context['delete_confirm'] = ($context['display_mode'] == 2) ? $txt['remove_conversation'] : $txt['delete_message'];
+
 	// Build the linktree for all the actions...
 	$context['linktree'][] = array(
 		'url' => $scripturl . '?action=pm',
@@ -976,7 +981,7 @@ function MessageFolder()
 		if ($context['display_mode'] == 2)
 		{
 			$context['conversation_buttons'] = array(
-				'delete' => array('text' => 'delete_conversation', 'image' => 'delete.png', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=pmactions;pm_actions[' . $context['current_pm'] . ']=delete;conversation;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], 'custom' => 'onclick="return confirm(\'' . addslashes($txt['remove_message']) . '?\');"'),
+				'delete' => array('text' => 'delete_conversation', 'image' => 'delete.png', 'lang' => true, 'url' => $scripturl . '?action=pm;sa=pmactions;pm_actions[' . $context['current_pm'] . ']=delete;conversation;f=' . $context['folder'] . ';start=' . $context['start'] . ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'], 'custom' => 'onclick="return confirm(\'' . addslashes($txt['remove_conversation']) . '?\');"'),
 			);
 
 			// Allow mods to add additional buttons here

+ 1 - 1
Themes/default/PersonalMessage.template.php

@@ -457,7 +457,7 @@ function template_folder()
 				else
 					echo '
 					<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote" class="quote_button">', $txt['reply_quote'], '</a></li>';
-			}
+			}			
 			echo '
 					<li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions[', $message['id'], ']=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', addslashes($txt['remove_message']), '?\');" class="remove_button">', $txt['delete'], '</a></li>';
 

+ 1 - 0
Themes/default/languages/PersonalMessage.english.php

@@ -35,6 +35,7 @@ $txt['delete_selected_confirm'] = 'Are you sure you want to delete all selected
 $txt['sent_to'] = 'Sent to';
 $txt['reply_to_all'] = 'Reply to All';
 $txt['delete_conversation'] = 'Delete Conversation';
+$txt['remove_conversation'] = 'Remove all messages in this conversation?';
 
 $txt['pm_capacity'] = 'Capacity';
 $txt['pm_currently_using'] = '%1$s messages, %2$s%% full.';