From c2c071a27446e0bdbf3ec56a4d71156841ef6b8b Mon Sep 17 00:00:00 2001 From: Charles Fulton Date: Mon, 21 May 2012 05:39:27 -0700 Subject: [PATCH] MDL-33139 forum: indicate which user's post was edited --- mod/forum/lang/en/forum.php | 1 + mod/forum/post.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index 48e5d76a925..138ac53a46b 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -137,6 +137,7 @@ $string['displaystart_help'] = 'This setting specifies whether a forum post shou $string['eachuserforum'] = 'Each person posts one discussion'; $string['edit'] = 'Edit'; $string['editedby'] = 'Edited by {$a->name} - original submission {$a->date}'; +$string['editedpostupdated'] = '{$a}\'s post was updated'; $string['editing'] = 'Editing'; $string['emptymessage'] = 'Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved.'; $string['erroremptymessage'] = 'Post message cannot be empty'; diff --git a/mod/forum/post.php b/mod/forum/post.php index 6301c7ec5d0..a57633f29a2 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -647,7 +647,13 @@ if ($fromform = $mform_post->get_data()) { if (!empty($message)) { // if we're printing stuff about the file upload $timemessage = 4; } - $message .= '
'.get_string("postupdated", "forum"); + + if ($realpost->userid == $USER->id) { + $message .= '
'.get_string("postupdated", "forum"); + } else { + $realuser = $DB->get_record('user', array('id' => $realpost->userid)); + $message .= '
'.get_string("editedpostupdated", "forum", fullname($realuser)); + } if ($subscribemessage = forum_post_subscription($fromform, $forum)) { $timemessage = 4;