From 2fe33daded491e2bee8a549d1aa8390536117b43 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Aug 2002 03:45:09 +0000 Subject: [PATCH] Fixes to list of subscribers (language fixes, and fix for site-level forums) --- lang/en/forum.php | 1 + lang/en/moodle.php | 1 + mod/forum/subscribers.php | 14 ++++++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lang/en/forum.php b/lang/en/forum.php index 2cf2ce2e04..abdcf0cb0b 100644 --- a/lang/en/forum.php +++ b/lang/en/forum.php @@ -34,6 +34,7 @@ $string[namesocial] = "Social forum"; $string[nameteacher] = "Teacher forum"; $string[nodiscussions] = "There are no discussion topics yet in this forum"; $string[noposts] = "No posts"; +$string[nosubscribers] = "There are no subscribers yet for this forum"; $string[numposts] = "\$a posts"; $string[olderdiscussions] = "Older discussions"; $string[parentofthispost] = "Parent of this post"; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 2b757563c7..f144b29c91 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -235,6 +235,7 @@ $string[nosuchemail] = "No such email address"; $string[noteachersyet] = "No teachers in this course yet"; $string[notenrolled] = "\$a is not enrolled in this course."; $string[nothingnew] = "Nothing new since your last login"; +$string[nousersyet] = "There are no users yet"; $string[now] = "now"; $string[numberweeks] = "Number of weeks/topics"; $string[numdays] = "\$a days"; diff --git a/mod/forum/subscribers.php b/mod/forum/subscribers.php index 3617a2018c..9281f6051d 100644 --- a/mod/forum/subscribers.php +++ b/mod/forum/subscribers.php @@ -38,11 +38,17 @@ print_header("$course->shortname: $strsubscribers", "$course->fullname", "$navigation"); - if (! $users = get_course_users($course->id)) { - print_heading("No users yet"); + if ($course->category) { + $users = get_course_users($course->id); + } else { + $users = get_records_sql("SELECT * from user"); + } + + if (! $users) { + print_heading(get_string("nousersyet")); } else { - print_heading("Subscribers to '$forum->name'"); + print_heading(get_string("subscribersto","forum", "'$forum->name'")); echo ""; $count = 0; foreach ($users as $user) { @@ -56,7 +62,7 @@ } } if (!$count) { - echo ""; + echo ""; } echo "
No subscribers yet
".get_string("nosubscribers", "forum")."
"; } -- 2.39.5