experimental, though considered almost stable.
Actually this function should get a new name
It's no big deal to integrate virtually any search engine you like into the existing hilighter (as long as it uses an uri conform query string, like most search engines do). Simply replace the function getGoogleQuery() in inc/common.php with the following one:
function getGoogleQuery(){ global $conf; $url = parse_url($_SERVER['HTTP_REFERER']); if(!$url) return ''; $pattern = join('|', array_keys($conf['search'])); if(!preg_match("#(".$pattern.")\.#i",$url['host'], $matches)) return ''; $se = $conf['search'][$matches[1]]; $query = array(); parse_str($url['query'],$query); return $query[$se]; }
Configuration is done in the array $conf (conf/local.php or conf/dokuwiki.php): The keys (i.e. the search engine names) must match a regex search /<pattern>\./i; the values refer to the GET-variable that contains the search string (most common - but not always - a single “q”).
$conf['search'] = array( 'google' => 'q', 'yahoo' => 'p', 'lycos' => 'query', 'altavista' => 'q' );
Thats all!
More search strings (and hopefully growing) can be found at http://lucy.renegArt.de/doku.php/devel/dw/suma.
If you're not familiar with the german language - not even with the few words used at that page - you may create an according english page (if nobody did it before you
) at http://lucy.renegArt.de/doku.php/devel/dw/suma.en.