if ($SITE->newsitems) { // Print forums only when needed require_once($CFG->dirroot .'/mod/forum/lib.php'); if (! $newsforum = forum_get_course_forum($SITE->id, 'news')) { error('Could not find or create a main news forum for the site'); } if (!empty($USER->id)) { $SESSION->fromdiscussion = $CFG->wwwroot; $subtext = ''; if (forum_is_subscribed($USER->id, $newsforum)) { if (!forum_is_forcesubscribed($newsforum)) { $subtext = get_string('unsubscribe', 'forum'); } } else { $subtext = get_string('subscribe', 'forum'); } print_heading_block($newsforum->name); echo 'id.'">'.$subtext.' '; } else { print_heading_block($newsforum->name); } forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'header', 'p.modified DESC'); } |
|