From fe98d35d43051a4c86e8fd3893b7b965b3c29a94 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 1 Feb 2005 02:58:51 +0000 Subject: [PATCH] FIxes from tony for highlighting --- mod/forum/search.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/forum/search.php b/mod/forum/search.php index 8fd173bdd0..8b63531914 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -54,7 +54,9 @@ } if ($search) { - + $strippedsearch = str_replace("user:","",$search); + $strippedsearch = str_replace("subject:","",$strippedsearch); + $strippedsearch = str_replace(""","",$strippedsearch); if (!$posts = forum_search_posts($searchterms, $course->id, $page*$perpage, $perpage, $totalcount)) { @@ -97,8 +99,8 @@ error("Could not find forum $discussion->forum"); } - $post->subject = highlight("$search", $post->subject); - $discussion->name = highlight("$search", $discussion->name); + $post->subject = highlight("$strippedsearch", $post->subject); + $discussion->name = highlight("$strippedsearch", $discussion->name); $fullsubject = "id\">$forum->name"; if ($forum->type != "single") { @@ -114,7 +116,7 @@ $post->forum = $forum->id; $fulllink = "discussion#$post->id\">".get_string("postincontext", "forum").""; - forum_print_post($post, $course->id, false, false, false, false, $fulllink, $search); + forum_print_post($post, $course->id, false, false, false, false, $fulllink, $strippedsearch); echo "
"; } -- 2.39.5