Skip to content
Browse files

Don't save Guest forum mode to database (just session)

  • Loading branch information...
1 parent 8be944a commit acb50c1bf8cb0ac5aa640ac5e538166613729f1a moodler committed May 13, 2005
Showing with 6 additions and 2 deletions.
  1. +6 −2 mod/forum/discuss.php
View
8 mod/forum/discuss.php
@@ -77,10 +77,14 @@
unset($SESSION->fromdiscussion);
if ($mode) {
- set_user_preference("forum_displaymode", $mode);
+ if (isguest()) {
+ $USER->preference['forum_displaymode'] = $mode; // don't save it in database
+ } else {
+ set_user_preference('forum_displaymode', $mode);
+ }
}
- $displaymode = get_user_preferences("forum_displaymode", $CFG->forum_displaymode);
+ $displaymode = get_user_preferences('forum_displaymode', $CFG->forum_displaymode);
if ($parent) {
if (abs($displaymode) == 1) { // If flat AND parent, then force nested display this time

0 comments on commit acb50c1

Please sign in to comment.
Something went wrong with that request. Please try again.