From ceca2ad2b0616af4a4fdb3e2fdfb4b4b5c8fd254 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 9 Aug 2003 07:59:39 +0000 Subject: [PATCH] Looks better when nothing is found --- mod/forum/search.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mod/forum/search.php b/mod/forum/search.php index 081468d122..1df21b32a2 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -48,36 +48,36 @@ } else { print_heading(get_string("nopostscontaining", "forum", $search)); } + print_footer($course); + exit; + } - } else { - - foreach ($posts as $post) { + foreach ($posts as $post) { - if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) { - error("Discussion ID was incorrect"); - } - if (! $forum = get_record("forum", "id", "$discussion->forum")) { - error("Could not find forum $discussion->forum"); - } + if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) { + error("Discussion ID was incorrect"); + } + if (! $forum = get_record("forum", "id", "$discussion->forum")) { + error("Could not find forum $discussion->forum"); + } - $post->subject = highlight("$search", $post->subject); - $discussion->name = highlight("$search", $discussion->name); + $post->subject = highlight("$search", $post->subject); + $discussion->name = highlight("$search", $discussion->name); - $fullsubject = "id\">$forum->name"; - if ($forum->type != "single") { - $fullsubject .= " -> id\">$discussion->name"; - if ($post->parent != 0) { - $fullsubject .= " -> discussion&parent=$post->id\">$post->subject"; - } + $fullsubject = "id\">$forum->name"; + if ($forum->type != "single") { + $fullsubject .= " -> id\">$discussion->name"; + if ($post->parent != 0) { + $fullsubject .= " -> discussion&parent=$post->id\">$post->subject"; } + } - $post->subject = $fullsubject; + $post->subject = $fullsubject; - $fulllink = "

discussion&parent=$post->id\">".get_string("postincontext", "forum")."

"; - forum_print_post($post, $course->id, false, false, false, false, $fulllink, $search); + $fulllink = "

discussion&parent=$post->id\">".get_string("postincontext", "forum")."

"; + forum_print_post($post, $course->id, false, false, false, false, $fulllink, $search); - echo "
"; - } + echo "
"; } if (count($posts) == $perpage) { -- 2.39.5