4 This plugin enables the [find:] moniker, which searches (for partial
5 matches) in "instant" and "interwiki" URLs, and alternatively selects
6 a similiar wiki page. As last resort falls back on google search.
10 $ewiki_plugins["intermap"]["find"] = "ewiki_linking_findany";
12 function ewiki_linking_findany($moniker, $page) {
17 $page_i = strtolower($page);
18 $search = array_merge(
19 $ewiki_config["instant"],
20 $ewiki_config["interwiki"]
22 foreach ($search as $pn=>$url) {
23 if (strtolower($pn) == $page_i) {
29 $result = ewiki_db::SEARCH("id",$page_i);
30 while ($row = $result->get()) {
31 if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
32 return(ewiki_script("", $row["id"]));
36 #-- Google saves the day!
37 return("http://www.google.com/search?q=".urlencode($page));