mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Add an "edited by" message to posts when they have been edited by a
different person from the original poster. See bug 2392
This commit is contained in:
parent
3613082378
commit
0936de64a5
@ -2196,8 +2196,18 @@ function forum_update_post($post,&$message) {
|
||||
global $USER, $CFG;
|
||||
|
||||
$post->modified = time();
|
||||
// the following causes bug 2392
|
||||
//$post->userid = $USER->id;
|
||||
|
||||
if ($USER->id != $post->userid) { // Not the original author
|
||||
$data->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&course='.$post->course.'">'.
|
||||
fullname($USER).'</a>';
|
||||
$data->date = userdate($post->modified);
|
||||
$editedby = get_string('editedby', 'forum', $data);
|
||||
if ($post->format == FORMAT_HTML) {
|
||||
$post->message .= '<p>(<i>'.$editedby.'</i>)</p>';
|
||||
} else {
|
||||
$post->message .= "\n\n(".$editedby.')';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$post->parent) { // Post is a discussion starter - update discussion title too
|
||||
set_field("forum_discussions", "name", $post->subject, "id", $post->discussion);
|
||||
|
Loading…
x
Reference in New Issue
Block a user