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:
moodler 2005-02-13 17:20:17 +00:00
parent 3613082378
commit 0936de64a5

View File

@ -2196,8 +2196,18 @@ function forum_update_post($post,&$message) {
global $USER, $CFG; global $USER, $CFG;
$post->modified = time(); $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 if (!$post->parent) { // Post is a discussion starter - update discussion title too
set_field("forum_discussions", "name", $post->subject, "id", $post->discussion); set_field("forum_discussions", "name", $post->subject, "id", $post->discussion);