Moodle is marking posts as read if I receive them by email...can I change this?

Moodle is marking posts as read if I receive them by email...can I change this?

by Kevin Audleman -
Number of replies: 4
I sometimes read the emails sent out by Moodle, sometimes not. So when I go to my course and all messages are marked as read, I lose the ability to discern what's really new. Does anybody know how I can stop Moodle from marking posts as read when sent by email?

Kevin
Average of ratings: -
In reply to Kevin Audleman

Re: Moodle is marking posts as read if I receive them by email...can I change this?

by Eduardo Hernandez -
Hi,

I was about to send the same question. I was looking at moodle/mod/forum/lib.php and taking a look at the cron function in it.

At line 385-391 (Moodle 1.6) I see these lines (after the message is sent by e-mail if user is subscribed)

/// Mark post as read if forum_usermarksread is set off
if (!$CFG->forum_usermarksread && forum_tp_can_track_forums($forum, $userto) &&  forum_tp_is_tracked($forum, $userto->id)) {
                   if (!forum_tp_mark_post_read($userto->id, $post, $forum->id)) {
                 mtrace("Error: mod/forum/cron.php: Could not mark post $post->id read for user $userto->id".
                                     " while sending email.");
 }


If I comment these lines, will Moodle stop marking as read messages sent by e-mail?, Or is there any option available somewhere in Moodle to set this avoiding code modification?
In reply to Eduardo Hernandez

Re: Moodle is marking posts as read if I receive them by email...can I change this?

by Kevin Audleman -
Found the answer! There is a setting in the Forum block at the site level (a.k.a. go into the Admin section) that controls whether or not posts will be marked as read when sent out. No need to modify code!

Kevin
In reply to Kevin Audleman

Re: Moodle is marking posts as read if I receive them by email...can I change this?

by Eduardo Hernandez -
Kevin,

Probably, because it is friday. I can't seem to find the setting. I'm pasting my forum config screen i have in moodle 1.6 and I can't seem to find the setting you are talking me about.

Could show me where?
Attachment forum.jpg
In reply to Eduardo Hernandez

Re: Moodle is marking posts as read if I receive them by email...can I change this?

by Kevin Audleman -
It is forum_usermarksread. Set it to 'yes'