Example #1
0
         // nothing needed
         break;
     default:
         // assume keyword. do nothing
         break;
 }
 /////////////////////////////////////////////////////
 // Spellchecking
 /////////////////////////////////////////////////////
 // we can skip corrections if we're into the results or
 // this is a corrected query
 if ($spellcheck) {
     $checker = new Spellcheck();
     $corTerm = $HTTP_GET_VARS['term'];
     $hiTerm = 'hello';
     $corTerm = $checker->auto_correct($corTerm, $hiTerm);
     $URL = "search.php?" . http_build_query(array('type' => $HTTP_GET_VARS['type'], 'term' => $corTerm, 'start' => $start, 'step' => $step, 'c' => '1'));
     if ($corTerm !== $HTTP_GET_VARS['term']) {
         $smarty->assign_by_ref('correctedTerm', $hiTerm);
         $smarty->assign('correctedURL', $URL);
     }
 }
 /////////////////////////////////////////////////////
 // Search
 /////////////////////////////////////////////////////
 $cache = new Query_Cache();
 $books = $cache->getSearchResults($term, $start, $step, $hits, $pid);
 $smarty->assign_by_ref('hits', $hits);
 if ($hits > 0) {
     $thisURL = "search.php?" . http_build_query(array('type' => $HTTP_GET_VARS['type'], 'term' => $corTerm, 'c' => '1'));
     foreach ($books as $book) {