Permalink
Browse files

Minor interim change to improve display of discussions on user page

because some of them are getting really long on moodle.org

Eventually this display will be completely different, with information
about all public data.
  • Loading branch information...
1 parent d0e922a commit b8bf90c53f642ebb141bd060856b8a220f4e8abf moodler committed Jun 15, 2003
Showing with 10 additions and 2 deletions.
  1. +1 −0 lang/en/forum.php
  2. +9 −2 mod/forum/lib.php
View
@@ -25,6 +25,7 @@
$string['discussionmoved'] = "This discussion has been moved to '\$a'.";
$string['discussions'] = "Discussions";
$string['discussionsstartedby'] = "Discussions started by \$a";
+$string['discussionsstartedbyrecent'] = "Discussions recently started by \$a";
$string['discussthistopic'] = "Discuss this topic";
$string['eachuserforum'] = "Each person posts one discussion";
$string['edit'] = "Edit";
View
@@ -653,7 +653,7 @@ function forum_get_user_discussions($courseid, $userid) {
AND p.userid = u.id
AND u.id = '$userid'
AND d.forum = f.id
- ORDER BY p.created ASC");
+ ORDER BY p.created DESC");
}
@@ -1389,13 +1389,20 @@ function forum_delete_post($post) {
function forum_print_user_discussions($courseid, $userid) {
global $CFG, $USER;
+ $maxdiscussions = 10;
+ $countdiscussions = 0;
+
if ($discussions = forum_get_user_discussions($courseid, $userid)) {
$user = get_record("user", "id", $userid);
echo "<HR>";
- print_heading( get_string("discussionsstartedby", "forum", "$user->firstname $user->lastname") );
+ print_heading( get_string("discussionsstartedbyrecent", "forum", "$user->firstname $user->lastname") );
$replies = forum_count_discussion_replies();
foreach ($discussions as $discussion) {
+ $countdiscussions++;
+ if ($countdiscussions > $maxdiscussions) {
+ break;
+ }
if (($discussion->forumtype == "teacher") and !isteacher($courseid)) {
continue;
}

0 comments on commit b8bf90c

Please sign in to comment.