diff --git a/mod/forum/subscribers.php b/mod/forum/subscribers.php new file mode 100644 index 00000000000..645102f4c69 --- /dev/null +++ b/mod/forum/subscribers.php @@ -0,0 +1,64 @@ +course)) { + error("Could not find this course!"); + } + + require_login($course->id); + + if (!isteacher($course->id)) { + error("This page is for teachers only"); + } + + unset($SESSION->fromdiscuss); + + add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", ""); + + $strsubscribers = get_string("subscribers", "forum"); + $strforums = get_string("forums", "forum"); + + if ($course->category) { + $navigation = "id\">$course->shortname -> + id\">$strforums -> + id\">$forum->name -> $strsubscribers"; + } else { + $navigation = "id\">$strforums -> + id\">$forum->name -> $strsubscribers"; + } + + print_header("$course->shortname: $strsubscribers", "$course->fullname", "$navigation"); + + $subscribers = get_records_sql("SELECT u.* FROM user u, user_students us, user_teachers ut, + forum_subscriptions fs + WHERE fs.forum = '$forum->id' AND fs.user = u.id AND + (fs.user = us.user OR fs.user = ut.user) + GROUP BY u.id + ORDER BY u.firstname"); + + if (! $subscribers) { + print_heading("No subscribers yet"); + } else { + print_heading("Subscribers to '$forum->name'"); + echo "
| "; + print_user_picture($subscriber->id, $course->id, $subscriber->picture); + echo " | "; + echo "$subscriber->firstname $subscriber->lastname"; + echo " |