From 21da9db80bd75cb87ad727d6e1c7cb7ef0adcdc9 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 14 Dec 2004 06:26:43 +0000 Subject: [PATCH] When posting a new topic, display the forum description to help orient the posting. Also changed some headings slightly to make more sense. --- mod/forum/post.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 10bfc13526..078e1ffede 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -462,7 +462,8 @@ error("Could not find top parent of post $post->id"); } } else { - $toppost->subject = get_string("yournewtopic", "forum"); + $toppost->subject = ($forum->type == "news") ? get_string("addanewtopic", "forum") : + get_string("addanewdiscussion", "forum"); } if (empty($post->subject)) { @@ -488,7 +489,7 @@ $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id); - if (empty($discussion->name)) { + if (!empty($discussion) and empty($discussion->name)) { $discussion->name = $forum->name; } @@ -511,7 +512,11 @@ echo "

".get_string("yourreply", "forum").":

"; } else { echo "
"; - echo "

".get_string("yournewtopic", "forum")."

"; + $forum->intro = trim($forum->intro); + if (!empty($forum->intro)) { + print_simple_box(format_text($forum->intro), 'center'); + } + print_heading(get_string('yournewtopic', 'forum')); } if (!empty($post->error)) { notify($post->error); -- 2.39.5