diff --git a/search/documents/wiki_document.php b/search/documents/wiki_document.php index 24ed20d173b..95820d1ca4d 100644 --- a/search/documents/wiki_document.php +++ b/search/documents/wiki_document.php @@ -21,7 +21,9 @@ // generic information; required $doc->id = $page->id; $doc->title = $page->pagename; - $doc->author = $page->author; + + //remove '(ip.ip.ip.ip)' from wiki author field + $doc->author = preg_replace('/\(.*?\)/', '', $page->author); $doc->contents = $page->content; $doc->url = wiki_make_link($wiki_id, $page->pagename, $page->version); diff --git a/search/query.php b/search/query.php index 9590695f9f6..3f6cfc029b6 100644 --- a/search/query.php +++ b/search/query.php @@ -23,7 +23,7 @@ * */ require_once('../config.php'); - require_once("$CFG->dirroot/search/lib.php"); + require_once("$CFG->dirroot/search/lib.php"); //check for php5, but don't die yet (see line 27) if ($check = search_check_php5()) { @@ -46,7 +46,91 @@ //print $e; $no_index = true; } //catch - } //if + } //if + + + //Result document class that contains all the display information we need + class ResultDocument { + public $url, + $title, + $score, + $doctype, + $author; + } //ResultDocument + + //generates an HTML string of links to result pages + function page_numbers($query, $hits, $page=1, $results_per_page=20) { + //total result pages + $pages = ceil($hits/$results_per_page); + + $ret = "