Added links to unread notices on course-view and forum-index

This commit is contained in:
moodler
2005-01-30 04:47:09 +00:00
parent 31686aea4c
commit d0388ebe95
2 changed files with 10 additions and 7 deletions
+8 -5
View File
@@ -1044,11 +1044,14 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
get_current_group($course->id) : false;
$unread = forum_tp_count_forum_posts($mod->instance, $groupid) -
forum_tp_count_forum_read_records($USER->id, $mod->instance, $groupid);
if ($unread == 1) {
echo '<span class="unread"> '.$strunreadpostsone.' </span>';
} else if ($unread) {
$strunreadpostsnumber = get_string('unreadpostsnumber', 'forum', $unread);
echo '<span class="unread"> '.$strunreadpostsnumber.' </span>';
if ($unread) {
echo '<span class="unread"> <a href="'.$CFG->wwwroot.'/mod/forum/view.php?id='.$mod->id.'">';
if ($unread == 1) {
echo $strunreadpostsone;
} else {
print_string('unreadpostsnumber', 'forum', $unread);
}
echo '</a> </span>';
}
}
+2 -2
View File
@@ -137,9 +137,9 @@
$unread = forum_tp_count_forum_posts($forum->id, $groupid) -
forum_tp_count_forum_read_records($USER->id, $forum->id, $groupid);
if ($unread > 0) {
$unreadlink = '<span class="unread">'.$unread.'</span>';
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
} else {
$unreadlink = '<span class="read">'.$unread.'</span>';
$unreadlink = '<span class="read"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
}
}