From 3f213cd3214e271eb0efd29c205bc451da981c21 Mon Sep 17 00:00:00 2001 From: Daniel Neis Araujo Date: Wed, 28 Mar 2012 23:22:58 -0300 Subject: [PATCH] MDL-32253 - Adding link to forum discussion on text emails --- mod/forum/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 0e3935a1afc..4e5e4f28e4d 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -937,6 +937,8 @@ function forum_cron() { $posttext .= " -> ".format_string($discussion->name,true); } $posttext .= "\n"; + $posttext .= $CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion->id; + $posttext .= "\n"; $posthtml .= "

". "wwwroot/course/view.php?id=$course->id\">$shortname -> ". @@ -990,7 +992,9 @@ function forum_cron() { $userfrom->customheaders = array ("Precedence: Bulk"); if ($userto->maildigest == 2) { - // Subjects only + // Subjects and link only + $posttext .= "\n"; + $posttext .= $CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion->id; $by = new stdClass(); $by->name = fullname($userfrom); $by->date = userdate($post->modified); @@ -1125,6 +1129,8 @@ function forum_make_mail_text($course, $cm, $forum, $discussion, $post, $userfro // add absolute file links $post->message = file_rewrite_pluginfile_urls($post->message, 'pluginfile.php', $modcontext->id, 'mod_forum', 'post', $post->id); + $posttext .= "\n"; + $posttext .= $CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion->id; $posttext .= "\n---------------------------------------------------------------------\n"; $posttext .= format_string($post->subject,true); if ($bare) {