Skip to content

Commit

Permalink
Minor interim change to improve display of discussions on user page
Browse files Browse the repository at this point in the history
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
moodler committed Jun 15, 2003
1 parent d0e922a commit b8bf90c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/en/forum.php
Expand Up @@ -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";
Expand Down
11 changes: 9 additions & 2 deletions mod/forum/lib.php
Expand Up @@ -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");
}


Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b8bf90c

Please sign in to comment.