Skip to content

Commit

Permalink
Don't show news at all if 0 newsitems was selected in course settings
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Aug 11, 2002
1 parent bd2bed9 commit db6395b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
18 changes: 10 additions & 8 deletions course/topics.php
Expand Up @@ -193,15 +193,17 @@

// Print all the news items.

if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
if ($course->newsitems) {
if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
}
echo "<BR>";
}
echo "<BR>";

// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
Expand Down
18 changes: 10 additions & 8 deletions course/weeks.php
Expand Up @@ -185,15 +185,17 @@

// Print all the news items.

if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
if ($course->newsitems) {
if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box(get_string("latestnews"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "<FONT SIZE=1>";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "</FONT>";
print_simple_box_end();
}
echo "<BR>";
}
echo "<BR>";

// Print all the recent activity
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
Expand Down

0 comments on commit db6395b

Please sign in to comment.