$string['totalsize'] = 'Total Size ';
$string['type'] = 'Type';
$string['uncompleteindexingerror'] = 'Indexing was not successfully completed, please restart it.';
-$string['versiontoolow'] = 'Sorry, global search requires PHP 5.0.0 or later (currently using version '.$phpversion.')';
+$string['versiontoolow'] = 'Sorry, global search requires PHP 5.0.0 or later';
$string['whichmodulestosearch?'] = 'Which modules to search?';
$string['wordsintitle'] = 'Words in title';
?>
* @param string $data
* @return array
*/
- public function tokenize($data, $encoding = '')
+ public function tokenize($data, $encoding = 'UTF-8')
{
$this->setInput($data, $encoding);
-
$tokenList = array();
while (($nextToken = $this->nextToken()) !== null) {
$tokenList[] = $nextToken;
public static function getDefault()
{
if (!self::$_defaultImpl instanceof Zend_Search_Lucene_Analysis_Analyzer) {
- self::$_defaultImpl = new Zend_Search_Lucene_Analysis_Analyzer_Common_Text_CaseInsensitive();
+ self::$_defaultImpl = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8();
}
return self::$_defaultImpl;
$indexdate = $CFG->search_indexer_run_date;
-mtrace('<pre>Starting index update (additions)...');
+mtrace('Starting index update (additions)...');
mtrace('Index size before: '.$CFG->search_index_size."\n");
//get all modules
// print some additional info
mtrace("Added $addition_count documents.");
-mtrace('Index size after: '.$index->count().'</pre>');
+mtrace('Index size after: '.$index->count());
?>
\ No newline at end of file
$maxmemoryamount = ini_get('memory_limit');
ini_set('memory_limit', '48M');
- mtrace("<pre>Starting cron...\n");
- mtrace("--DELETE----");
+ mtrace("\n--DELETE----");
require_once("$CFG->dirroot/search/delete.php");
mtrace("--UPDATE----");
require_once("$CFG->dirroot/search/update.php");
mtrace("--ADD-------");
require_once("$CFG->dirroot/search/add.php");
mtrace("------------");
- mtrace("cron finished.</pre>");
+ //mtrace("cron finished.</pre>");
+ mtrace('done');
// set back normal values for php limits
ini_set('max_execution_time', $maxtimelimit);
$deletion_count = 0;
$startcleantime = time();
-mtrace('<pre>Starting clean-up of removed records...');
+mtrace('Starting clean-up of removed records...');
mtrace('Index size before: '.$CFG->search_index_size."\n");
if ($mods = get_records_select('modules')) {
set_config("search_index_size", (int)$CFG->search_index_size - (int)$deletion_count);
mtrace("Finished $deletion_count removals.");
-mtrace('Index size after: '.$index->count().'</pre>');
+mtrace('Index size after: '.$index->count());
?>
\ No newline at end of file
mtrace('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /></head><body>');
mtrace('<pre>Server Time: '.date('r',time())."\n");
-if ($CFG->search_indexer_busy == '1') {
+if (isset($CFG->search_indexer_busy) && $CFG->search_indexer_busy == '1') {
//means indexing was not finished previously
mtrace("Warning: Indexing was not successfully completed last time, restarting.\n");
}
}
//check if the busy flag is set
- if ($CFG->search_indexer_busy == '1') {
+ if (isset($CFG->search_indexer_busy) && $CFG->search_indexer_busy == '1') {
$this->complete = false;
}
else {
redirect("index.php");
}
-$strsearch = get_string('search', 'search');
+$strsearch = get_string('search', 'search');
$strquery = get_string('enteryoursearchquery', 'search');
-print_header("$site->shortname: $strsearch: $strquery", "$site->fullname",
- "<a href=\"index.php\">$strsearch</a> -> $strquery");
+$navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc');
+$navlinks[] = array('name' => $strquery, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+$course = get_site();
+print_header("$strsearch", "$strsearch" , $navigation, "", "", true, " ", navmenu($course));
//keep things pretty, even if php5 isn't available
if (!$check) {
if (isset($vars)) {
foreach ($vars as $key => $value) {
- $adv->$key = stripslashes(htmlentities($value));
+ // htmlentities breaks non-ascii chars
+ $adv->key = stripslashes($value);
+ //$adv->$key = stripslashes(htmlentities($value));
}
}
?>
$scorestr = get_string('score', 'search');
$authorstr = get_string('author', 'search');
foreach ($hits as $listing) {
- if ($CFG->unicodedb) $listing->title = mb_convert_encoding($listing->title, 'auto', 'UTF8');
+ //if ($CFG->unicodedb) {
+ //$listing->title = mb_convert_encoding($listing->title, 'auto', 'UTF8');
+ //}
$title_post_processing_function = $listing->doctype.'_link_post_processing';
require_once "{$CFG->dirroot}/search/documents/{$listing->doctype}_document.php";
- if (function_exists($title_post_processing_function))
+ if (function_exists($title_post_processing_function)) {
$listing->title = $title_post_processing_function($listing->title);
+ }
+
print "<li value='".($listing->number+1)."'><a href='".str_replace('DEFAULT_POPUP_SETTINGS', DEFAULT_POPUP_SETTINGS ,$listing->url)."'>$listing->title</a><br />\n"
."<em>".search_shorten_url($listing->url, 70)."</em><br />\n"
."{$typestr}: ".$listing->doctype.", {$scorestr}: ".round($listing->score, 3).", {$authorstr}: ".$listing->author."\n"
$indexdate = $CFG->search_indexer_update_date;
$startupdatedate = time();
-mtrace("<pre>Starting index update (updates)...\n");
+mtrace("Starting index update (updates)...\n");
if ($mods = get_records_select('modules')) {
$mods = array_merge($mods, search_get_additional_modules());
//update index date
set_config("search_indexer_update_date", $startupdatedate);
-mtrace("Finished $update_count updates.</pre>");
+mtrace("Finished $update_count updates");
?>
\ No newline at end of file