]> git.mjollnir.org Git - moodle.git/commitdiff
Added links to unread notices on course-view and forum-index
authormoodler <moodler>
Sun, 30 Jan 2005 04:47:09 +0000 (04:47 +0000)
committermoodler <moodler>
Sun, 30 Jan 2005 04:47:09 +0000 (04:47 +0000)
course/lib.php
mod/forum/index.php

index a1a2bba0be1664e34f83336e41045f998619ad8e..bbe0a6e3ee74da488d6dbdc9e94215cef4160531 100644 (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>';
                     }
                 }
 
index c8dcc6b75f3a3adfeab3f6a65a3ffdc1ada8e056..c6df9ca2d85167de13710b3c31ac1c77b66cc052 100644 (file)
                 $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>';
                 }
             }