Browse Source

Show a confirmation message for the 'send topic' feature ('fixes' #380)

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 11 years ago
parent
commit
341c46d545

+ 3 - 0
Sources/Display.php

@@ -365,6 +365,9 @@ function Display()
 
 	// Did we report a post to a moderator just now?
 	$context['report_sent'] = isset($_GET['reportsent']);
+	
+	// Did we send this topic to a friend?
+	$context['topic_sent'] = isset($_GET['topicsent']);
 
 	// Let's get nosey, who is viewing this topic?
 	if (!empty($settings['display_who_viewing']))

+ 1 - 1
Sources/SendTopic.php

@@ -139,7 +139,7 @@ function SendTopic()
 	sendmail($_POST['r_email'], $emaildata['subject'], $emaildata['body'], $_POST['y_email']);
 
 	// Back to the topic!
-	redirectexit('topic=' . $topic . '.0');
+	redirectexit('topic=' . $topic . '.0;topicsent');
 }
 
 /**

+ 8 - 0
Themes/default/Display.template.php

@@ -22,6 +22,14 @@ function template_main()
 				', $txt['report_sent'], '
 			</div>';
 	}
+	// Topic was sent successfully
+	elseif ($context['topic_sent'])
+	{
+		echo '
+			<div class="infobox">
+				', $txt['topic_sent'], '
+			</div>';
+	}
 
 	// Show the anchor for the top and for the first message. If the first message is new, say so.
 	echo '

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

@@ -277,6 +277,7 @@ $txt['redirect_board'] = 'Redirect Board';
 
 $txt['sendtopic_send'] = 'Send';
 $txt['report_sent'] = 'Your report has been sent successfully.';
+$txt['topic_sent'] = 'Your email has been sent successfully.';
 
 $txt['time_offset'] = 'Time Offset';
 $txt['or'] = 'or';