Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If a user sets their 'Track read/unread posts' personal profile setti…

…ng to

'No', delete all of their read records.
  • Loading branch information...
commit fe0a76782f8fd95d7ada2a5dfc40b41d0a7c0039 1 parent 5b34cd2
mchurch authored
Showing with 17 additions and 0 deletions.
  1. +11 −0 user/edit.html
  2. +6 −0 user/edit.php
View
11 user/edit.html
@@ -148,6 +148,17 @@
choose_from_menu ($choices, "autosubscribe", $user->autosubscribe, "") ?>
</td>
</tr>
+<?php if ($CFG->forum_trackreadposts) { ?>
+<tr>
+ <th><?php print_string("trackforums") ?>:</th>
+ <td><?php
+ unset($choices);
+ $choices["1"] = get_string("yes");
+ $choices["0"] = get_string("no");
+ choose_from_menu ($choices, "trackforums", $user->trackforums, "") ?>
+ </td>
+</tr>
+<?php } ?>
<?php if ($CFG->htmleditor) { ?>
<tr>
<th><?php print_string("textediting") ?>:</th>
View
6 user/edit.php
@@ -191,6 +191,12 @@
set_send_count($usernew,true);
}
+ /// Update forum track preference.
+ if (($usernew->trackforums != $USER->trackforums) && !$usernew->trackforums) {
+ require_once($CFG->dirroot.'/mod/forum/lib.php');
+ forum_tp_delete_read_records($USER->id);
+ }
+
add_to_log($course->id, "user", "update", "view.php?id=$user->id&course=$course->id", "");
if ($user->id == $USER->id) {
Please sign in to comment.
Something went wrong with that request. Please try again.