2 // social.php - course format featuring social forum
3 // included from view.php
5 include_once("$CFG->dirroot/mod/forum/lib.php");
6 include_once("$CFG->dirroot/mod/resource/lib.php");
11 <TABLE WIDTH
="100%" BORDER
="0" CELLSPACING
="5" CELLPADDING
="5">
13 <TD WIDTH
="<?=$leftwidth?>" VALIGN
="TOP">
15 $moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
16 $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
17 $editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
18 get_string("editmyprofile")."</A>";
19 if ($USER->description
) {
20 $moddata[]= $editmyprofile;
22 $moddata[]= $editmyprofile." <BLINK>*</BLINK>";
24 $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
25 print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
29 /// Then, print all the available resources (Section 0)
30 print_section_block(get_string("activities"), $course, $sections[0],
31 $mods, $modnames, $modnamesused, true, "100%", isediting($course->id
));
34 /// Print all the recent activity
35 // Print all the recent activity
36 if ($course->showrecent
) {
37 print_side_block_start(get_string("recentactivity"), $leftwidth, "sideblockrecentactivity");
38 print_recent_activity($course);
39 print_side_block_end();
43 /// Print a form to search forums
44 $searchform = forum_print_search_form($course, "", true);
45 $searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
46 print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
48 /// Admin links and controls
49 if (isteacher($course->id
)) {
50 print_course_admin_links($course, "100%", $leftwidth);
55 echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
56 if ($social = forum_get_course_forum($course->id
, "social")) {
57 if (forum_is_subscribed($USER->id
, $social->id
)) {
58 $subtext = get_string("unsubscribe", "forum");
60 $subtext = get_string("subscribe", "forum");
62 $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>";
63 print_heading_block($headertext);
64 echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
66 forum_print_latest_discussions($social->id
, 10, "plain", "DESC", false);
69 notify("Could not find or create a social forum here");