Skip to content

Commit

Permalink
If a user sets their 'Track read/unread posts' personal profile setti…
Browse files Browse the repository at this point in the history
…ng to

'No', delete all of their read records.
  • Loading branch information
mchurch committed Apr 25, 2005
1 parent 5b34cd2 commit fe0a767
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions user/edit.html
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions user/edit.php
Expand Up @@ -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) {
Expand Down

0 comments on commit fe0a767

Please sign in to comment.