4 This file will return the results of the search. It will: display
5 the logo, the title "Search Results," then a list of all Wiki
6 pages that match seperated by five dots and the text that matched;
7 an HR tag, and then a statement:
8 32 pages match your query.
9 where the number is correct.
11 The online classic Wiki has both full search and title search.
12 Title search is a good idea; it doesn't come with the script you
16 echo WikiHeader("Search Results");
17 echo "<h1>$LogoImage Search Results</h1>\n";
21 // from classic wiki: $pat =~ s/[+?.*()[\]{}|\\]/\\$&/g;
22 // disallow _'_ and _%_ too, _\_ have to be doubled
23 $search = preg_replace("/[+?.*()'%[\\]{}|\\\\]/", "", $search);
25 // search matching pages
26 $query = InitTitleSearch($dbi, $search);
27 while ($page = TitleSearchNextMatch($dbi, $query)) {
29 echo LinkExistingWikiWord($page), "<br>\n";
33 echo "$found pages match your query.\n";