]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - wiki_search.php3
added diff link
[SourceForge/phpwiki.git] / wiki_search.php3
1 <!-- $Id: wiki_search.php3,v 1.5 2000-06-18 15:12:13 ahollosi Exp $ -->
2 <?
3    // Title search: returns pages having a name matching the search term
4
5    $found = 0;
6
7    if(get_magic_quotes_gpc())
8       $search = stripslashes($search);
9
10    $result = "<P><B>Searching for \"" . htmlspecialchars($search) .
11                 "\" ....</B></P>\n";
12
13    // quote regexp chars
14    $search = preg_quote($search);
15
16    // search matching pages
17    $query = InitTitleSearch($dbi, $search);
18    while ($page = TitleSearchNextMatch($dbi, $query)) {
19       $found++;
20       $result .= LinkExistingWikiWord($page) . "<br>\n";
21    }
22
23    $result .= "<hr noshade>\n$found pages match your query.\n";
24    GeneratePage('MESSAGE', $result, "Title Search Results", 0);
25 ?>