From c6ee38d073d2883384b5fdeb907613634b791062 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 12 Aug 2003 16:37:52 +0000 Subject: [PATCH] Some refinements to the display of forums - don't show intro box for teacher forum (because it can't be edited) - don't show intro box when the text is empty anyway --- mod/forum/view.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mod/forum/view.php b/mod/forum/view.php index 081a56e6dc..b1ba1c1c01 100644 --- a/mod/forum/view.php +++ b/mod/forum/view.php @@ -133,14 +133,24 @@ break; case "eachuser": - print_simple_box(text_to_html($forum->intro), "CENTER"); - echo "

"; + if (!empty($forum->intro)) { + print_simple_box(text_to_html($forum->intro), "center"); + } + echo "

"; if (forum_user_can_post_discussion($forum)) { print_string("allowsdiscussions", "forum"); } else { echo " "; } - echo "

"; + echo "

"; + if (!empty($showall)) { + forum_print_latest_discussions($forum->id, 0, "header"); + } else { + forum_print_latest_discussions($forum->id, FORUM_MANY_DISCUSSIONS, "header"); + } + break; + + case "teacher": if (!empty($showall)) { forum_print_latest_discussions($forum->id, 0, "header"); } else { @@ -149,8 +159,10 @@ break; default: - print_simple_box(text_to_html($forum->intro), "CENTER"); - echo "

 

"; + if (!empty($forum->intro)) { + print_simple_box(text_to_html($forum->intro), "center"); + } + echo "

 

"; if (!empty($showall)) { forum_print_latest_discussions($forum->id, 0, "header"); } else { -- 2.39.5