]> git.mjollnir.org Git - moodle.git/commitdiff
Added an "unsubscribe" link to emails
authormartin <martin>
Sun, 8 Sep 2002 16:04:51 +0000 (16:04 +0000)
committermartin <martin>
Sun, 8 Sep 2002 16:04:51 +0000 (16:04 +0000)
mod/forum/lib.php

index 08e9f0fba51f8581e3218f9add772db424624cec..b621d4fe2b8d3444c6692ebb8abbf352b0b6f894 100644 (file)
@@ -905,6 +905,7 @@ function forum_cron () {
 
             if ($users = forum_subscribed_users($course, $forum)) {
                 $strforums = get_string("forums", "forum");
+                $canunsubscribe = ! forum_is_forcesubscribed($forum->id);
 
                 $mailcount=0;
                 foreach ($users as $userto) {
@@ -946,6 +947,11 @@ function forum_cron () {
                             $posthtml .= " -> <A HREF=\"$CFG->wwwroot/mod/forum/discuss.php?d=$discussion->id\">$discussion->name</A></FONT></P>";
                         }
                         $posthtml .= forum_make_mail_post($post, $userfrom, $userto, $course, false, true, false, false);
+
+                        if ($canunsubscribe) {
+                            $posthtml .= "\n<BR><HR SIZE=1 NOSHADE><FONT SIZE=1><A HREF=\"$CFG->wwwroot/mod/forum/subscribe.php?id=$forum->id\">".get_string("unsubscribe", "forum")."</A></FONT>";
+                        }
+
                     } else {
                       $posthtml = "";
                     }