2002-07-14 13:32:51 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
2003-01-05 14:19:20 +00:00
|
|
|
require_once("../../config.php");
|
|
|
|
require_once("lib.php");
|
2002-07-14 13:32:51 +00:00
|
|
|
|
|
|
|
require_variable($id); // forum
|
|
|
|
|
|
|
|
if (! $forum = get_record("forum", "id", $id)) {
|
|
|
|
error("Forum ID is incorrect");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! $course = get_record("course", "id", $forum->course)) {
|
|
|
|
error("Could not find this course!");
|
|
|
|
}
|
|
|
|
|
2004-01-31 14:47:57 +00:00
|
|
|
if (! $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id)) {
|
|
|
|
$cm->id = 0;
|
|
|
|
}
|
|
|
|
|
2002-07-14 13:32:51 +00:00
|
|
|
require_login($course->id);
|
|
|
|
|
|
|
|
if (!isteacher($course->id)) {
|
|
|
|
error("This page is for teachers only");
|
|
|
|
}
|
|
|
|
|
2002-07-31 14:19:35 +00:00
|
|
|
unset($SESSION->fromdiscussion);
|
2002-07-14 13:32:51 +00:00
|
|
|
|
2004-02-22 11:25:09 +00:00
|
|
|
add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", $forum->id, $cm->id);
|
2002-07-14 13:32:51 +00:00
|
|
|
|
|
|
|
$strsubscribers = get_string("subscribers", "forum");
|
|
|
|
$strforums = get_string("forums", "forum");
|
|
|
|
|
|
|
|
if ($course->category) {
|
2004-01-31 14:47:57 +00:00
|
|
|
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
|
|
|
|
<a href=\"index.php?id=$course->id\">$strforums</a> ->
|
|
|
|
<a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
|
2002-07-14 13:32:51 +00:00
|
|
|
} else {
|
2004-01-31 14:47:57 +00:00
|
|
|
$navigation = "<a href=\"index.php?id=$course->id\">$strforums</a> ->
|
|
|
|
<a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
|
2002-07-14 13:32:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print_header("$course->shortname: $strsubscribers", "$course->fullname", "$navigation");
|
|
|
|
|
2002-08-15 04:16:39 +00:00
|
|
|
if (! $users = forum_subscribed_users($course, $forum) ) {
|
|
|
|
print_heading(get_string("nosubscribers", "forum"));
|
2002-07-14 13:32:51 +00:00
|
|
|
|
|
|
|
} else {
|
2002-08-15 03:45:09 +00:00
|
|
|
print_heading(get_string("subscribersto","forum", "'$forum->name'"));
|
2004-01-31 14:47:57 +00:00
|
|
|
echo '<table align="center" cellpadding="5" cellspacing="5">';
|
2002-07-29 08:24:13 +00:00
|
|
|
foreach ($users as $user) {
|
2004-01-31 14:47:57 +00:00
|
|
|
echo "<tr><td>";
|
2002-08-15 04:16:39 +00:00
|
|
|
print_user_picture($user->id, $course->id, $user->picture);
|
2004-01-31 14:47:57 +00:00
|
|
|
echo "</td><td bgcolor=\"$THEME->cellcontent\">";
|
2002-08-15 04:16:39 +00:00
|
|
|
echo "$user->firstname $user->lastname";
|
2004-01-31 14:47:57 +00:00
|
|
|
echo "</td><td bgcolor=\"$THEME->cellcontent\">";
|
2002-08-15 04:16:39 +00:00
|
|
|
echo "$user->email";
|
2004-01-31 14:47:57 +00:00
|
|
|
echo "</td><td>";
|
|
|
|
echo "<font size=1><a href=\"subscribe.php?id=$forum->id&user=$user->id\">unsubscribe</a></font>";
|
|
|
|
echo "</td></tr>";
|
2002-07-14 13:32:51 +00:00
|
|
|
}
|
2004-01-31 14:47:57 +00:00
|
|
|
echo "</table>";
|
2002-07-14 13:32:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print_footer($course);
|
|
|
|
|
|
|
|
?>
|