Index: mod/forum/lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/lib.php,v retrieving revision 1.609.2.97 diff -u -r1.609.2.97 lib.php --- mod/forum/lib.php 19 Oct 2009 00:13:26 -0000 1.609.2.97 +++ mod/forum/lib.php 9 Nov 2009 13:55:35 -0000 @@ -8,6 +8,7 @@ define('FORUM_MODE_FLATNEWEST', -1); define('FORUM_MODE_THREADED', 2); define('FORUM_MODE_NESTED', 3); +define('FORUM_MODE_FLATUSER', 4); define('FORUM_FORCESUBSCRIBE', 1); define('FORUM_INITIALSUBSCRIBE', 2); @@ -4968,7 +4969,9 @@ // preload all posts - TODO: improve... if ($mode == FORUM_MODE_FLATNEWEST) { $sort = "p.created DESC"; - } else { + } else if($mode == FORUM_MODE_FLATUSER) { + $sort = "u.firstname ASC, p.created ASC"; + }else { $sort = "p.created ASC"; } @@ -5041,6 +5044,7 @@ } switch ($mode) { + case FORUM_MODE_FLATUSER : case FORUM_MODE_FLATOLDEST : case FORUM_MODE_FLATNEWEST : default: @@ -5095,13 +5099,16 @@ $link = false; $ratingsmenuused = false; - +/* if ($mode == FORUM_MODE_FLATNEWEST) { $sort = "ORDER BY created DESC"; + } else if($mode == FORUM_MODE_FLATUSER) { + $sort = "ORDER BY user ASC"; } else { $sort = "ORDER BY created ASC"; } - +echo "sort: $sort
"; +*/ foreach ($posts as $post) { if (!$post->parent) { continue; @@ -6861,6 +6868,7 @@ function forum_get_layout_modes() { return array (FORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'forum'), FORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'forum'), + FORUM_MODE_FLATUSER => get_string('modeflatuser', 'forum'), FORUM_MODE_THREADED => get_string('modethreaded', 'forum'), FORUM_MODE_NESTED => get_string('modenested', 'forum')); } Index: lang/en_utf8/forum.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/forum.php,v retrieving revision 1.21.4.15 diff -u -r1.21.4.15 forum.php --- lang/en_utf8/forum.php 30 Jan 2009 11:30:21 -0000 1.21.4.15 +++ lang/en_utf8/forum.php 9 Nov 2009 13:55:34 -0000 @@ -146,6 +146,7 @@ $string['modeflatoldestfirst'] = 'Display replies flat, with oldest first'; $string['modenested'] = 'Display replies in nested form'; $string['modethreaded'] = 'Display replies in threaded form'; +$string['modeflatuser'] = 'Display replies flat, by user'; $string['modulename'] = 'Forum'; $string['modulenameplural'] = 'Forums'; $string['more'] = 'more';