Added links to unread notices on course-view and forum-index
This commit is contained in:
+8
-5
@@ -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
@@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user