global $USER, $CFG;
static $stredit, $strdelete, $strreply, $strparent, $strprune;
- static $strpruneheading, $threadedmode;
+ static $strpruneheading, $displaymode;
static $strmarkread, $strmarkunread, $istracked;
$strparent = get_string('parent', 'forum');
$strpruneheading = get_string('pruneheading', 'forum');
$strprune = get_string('prune', 'forum');
- $threadedmode = (!empty($USER->mode) and ($USER->mode == FORUM_MODE_THREADED));
+ $displaymode = get_user_preferences('forum_displaymode', $CFG->forum_displaymode);
$strmarkread = get_string('markread', 'forum');
$strmarkunread = get_string('markunread', 'forum');
$mcmd = '&mark=read&postid='.$post->id;
$mtxt = $strmarkread;
}
- if ($threadedmode) {
+ if ($displaymode == FORUM_MODE_THREADED) {
$commands[] = '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.
$post->discussion.'&parent='.$post->id.$mcmd.'">'.$mtxt.'</a>';
} else {
}
if ($post->parent) { // Zoom in to the parent specifically
- $commands[] = '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.
+ if ($displaymode == FORUM_MODE_THREADED) {
+ $commands[] = '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.
$post->discussion.'&parent='.$post->parent.'">'.$strparent.'</a>';
+ } else {
+ $commands[] = '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.
+ $post->discussion.'#p'.$post->parent.'">'.$strparent.'</a>';
+ }
}
$forumtype = get_field('forum', 'type', 'id', $post->forum);