2002-02-26 06:33:48 +00:00
|
|
|
<? // $Id$
|
|
|
|
// social.php - course format featuring social forum
|
|
|
|
// included from view.php
|
|
|
|
|
2002-10-06 03:05:22 +00:00
|
|
|
include_once("$CFG->dirroot/mod/forum/lib.php");
|
2002-10-17 14:03:59 +00:00
|
|
|
include_once("$CFG->dirroot/mod/resource/lib.php");
|
2002-12-09 14:07:52 +00:00
|
|
|
|
|
|
|
$leftwidth = 210;
|
2002-02-26 06:33:48 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
|
|
|
|
<TR>
|
2002-12-09 14:07:52 +00:00
|
|
|
<TD WIDTH="<?=$leftwidth?>" VALIGN="TOP">
|
2002-02-26 06:33:48 +00:00
|
|
|
<?
|
2002-09-08 05:29:00 +00:00
|
|
|
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
|
2002-08-11 15:41:54 +00:00
|
|
|
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
2002-09-08 09:41:17 +00:00
|
|
|
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
|
2002-08-11 15:41:54 +00:00
|
|
|
get_string("editmyprofile")."</A>";
|
|
|
|
if ($USER->description) {
|
|
|
|
$moddata[]= $editmyprofile;
|
|
|
|
} else {
|
2002-11-07 09:30:41 +00:00
|
|
|
$moddata[]= $editmyprofile." <BLINK>*</BLINK>";
|
2002-08-11 15:41:54 +00:00
|
|
|
}
|
|
|
|
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
2002-12-09 14:07:52 +00:00
|
|
|
print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
|
2002-08-11 15:41:54 +00:00
|
|
|
|
2002-02-26 06:33:48 +00:00
|
|
|
|
|
|
|
|
2002-11-07 09:30:41 +00:00
|
|
|
/// Then, print all the available resources (Section 0)
|
2002-12-09 07:35:40 +00:00
|
|
|
print_section_block(get_string("activities"), $course, $sections[0],
|
|
|
|
$mods, $modnames, $modnamesused, true, "100%", isediting($course->id));
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2002-11-07 09:30:41 +00:00
|
|
|
|
|
|
|
/// Print all the recent activity
|
2002-12-09 14:07:52 +00:00
|
|
|
// Print all the recent activity
|
2002-12-09 07:35:40 +00:00
|
|
|
if ($course->showrecent) {
|
2002-12-09 14:07:52 +00:00
|
|
|
print_side_block_start(get_string("recentactivity"), $leftwidth, "sideblockrecentactivity");
|
2002-12-09 07:35:40 +00:00
|
|
|
print_recent_activity($course);
|
2002-12-09 14:07:52 +00:00
|
|
|
print_side_block_end();
|
2002-12-09 07:35:40 +00:00
|
|
|
}
|
2002-05-31 09:34:50 +00:00
|
|
|
|
2002-11-07 09:30:41 +00:00
|
|
|
|
|
|
|
/// Print a form to search forums
|
2002-12-09 07:35:40 +00:00
|
|
|
$searchform = forum_print_search_form($course, "", true);
|
|
|
|
$searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
|
2002-12-09 14:07:52 +00:00
|
|
|
print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
|
2002-06-11 04:56:11 +00:00
|
|
|
|
2002-12-09 07:35:40 +00:00
|
|
|
/// Admin links and controls
|
2003-01-01 07:03:23 +00:00
|
|
|
print_course_admin_links($course);
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2002-08-01 03:50:27 +00:00
|
|
|
echo "</TD>";
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2002-12-09 14:07:52 +00:00
|
|
|
echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
|
2002-08-01 03:50:27 +00:00
|
|
|
if ($social = forum_get_course_forum($course->id, "social")) {
|
|
|
|
if (forum_is_subscribed($USER->id, $social->id)) {
|
2002-08-11 15:41:54 +00:00
|
|
|
$subtext = get_string("unsubscribe", "forum");
|
2002-08-01 03:50:27 +00:00
|
|
|
} else {
|
2002-08-11 15:41:54 +00:00
|
|
|
$subtext = get_string("subscribe", "forum");
|
2002-08-01 03:50:27 +00:00
|
|
|
}
|
2002-08-11 15:41:54 +00:00
|
|
|
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
|
2002-12-09 07:35:40 +00:00
|
|
|
print_heading_block($headertext);
|
2002-08-01 03:50:27 +00:00
|
|
|
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
|
|
|
|
|
|
|
|
forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
|
2002-02-26 06:33:48 +00:00
|
|
|
|
|
|
|
} else {
|
2002-08-01 03:50:27 +00:00
|
|
|
notify("Could not find or create a social forum here");
|
2002-02-26 06:33:48 +00:00
|
|
|
}
|
|
|
|
?>
|
2002-08-01 03:50:27 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
2002-02-26 06:33:48 +00:00
|
|
|
</TABLE>
|
|
|
|
|