Index: search.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/search.php,v retrieving revision 1.68 diff -u -r1.68 search.php --- search.php 24 Sep 2006 15:28:16 -0000 1.68 +++ search.php 19 Oct 2006 09:54:10 -0000 @@ -24,12 +24,12 @@ $fromyear = optional_param('fromyear', 0, PARAM_INT); // Starting date $fromhour = optional_param('fromhour', 0, PARAM_INT); // Starting date $fromminute = optional_param('fromminute', 0, PARAM_INT); // Starting date + if ($timefromrestrict) { $datefrom = make_timestamp($fromyear, $frommonth, $fromday, $fromhour, $fromminute); } else { $datefrom = optional_param('datefrom', 0, PARAM_INT); // Starting date } - $timetorestrict = optional_param('timetorestrict', 0, PARAM_INT); // Use ending date $today = optional_param('today', 0, PARAM_INT); // Ending date $tomonth = optional_param('tomonth', 0, PARAM_INT); // Ending date @@ -41,9 +41,6 @@ } else { $dateto = optional_param('dateto', 0, PARAM_INT); // Ending date } - - - if (empty($search)) { // Check the other parameters instead if (!empty($words)) { $search .= ' '.$words; @@ -102,7 +99,10 @@ "id\">$strforums -> $strsearch", 'search.words', "", "", " ", navmenu($course)); - forum_print_big_search_form($course); + //forum_print_big_search_form($course); + include('forum_search_form.php'); + $forumform =new forum_search_form('search.php',compact('words','course','subject','phrase','user','userid','fullwords','notwords','datefrom','dateto')); + $forumform->display(); print_footer($course); exit; } @@ -127,8 +127,10 @@ $words = $search; } - forum_print_big_search_form($course); - + //forum_print_big_search_form($course); + include('forum_search_form.php'); + $forumform =new forum_search_form('search.php',compact('words','course','subject','phrase','user','userid','fullwords','notwords','datefrom','dateto')); + $forumform->display(); print_footer($course); exit; } @@ -203,10 +205,10 @@ // Hack for posts of format FORMAT_PLAIN. Otherwise html tags added by // the highlight() call bellow get stripped out by forum_print_post(). if ($post->format == FORMAT_PLAIN) { - $post->message = s($post->message); - $post->message = rebuildnolinktag($post->message); - $post->message = str_replace(' ', '  ', $post->message); - $post->message = nl2br($post->message); + $post->message = s($post->message); + $post->message = rebuildnolinktag($post->message); + $post->message = str_replace(' ', '  ', $post->message); + $post->message = nl2br($post->message); $post->format = FORMAT_HTML; } @@ -263,123 +265,18 @@ -function forum_print_big_search_form($course) { - global $CFG, $words, $subject, $phrase, $user, $userid, $fullwords, $notwords, $datefrom, $dateto; - print_simple_box(get_string('searchforumintro', 'forum'), 'center', '', '', 'searchbox', 'intro'); - - print_simple_box_start("center"); - - echo "\n"; - - echo '
'; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - if ($CFG->dbtype == 'mysql' || $CFG->dbtype == 'postgres7') { - echo ''; - echo ''; - echo ''; - echo ''; - } - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - echo ''; - - echo ''; - echo '
'; - - echo "\n"; - - print_simple_box_end(); -} function forum_clean_search_terms($words, $prefix='') { - $searchterms = explode(' ', $words); + + $searchterms = explode(' ', $words); foreach ($searchterms as $key => $searchterm) { if (strlen($searchterm) < 2) { unset($searchterms[$key]); } else if ($prefix) { $searchterms[$key] = $prefix.$searchterm; + echo "vcv".$key; } } return trim(implode(' ', $searchterms));