hi
add "Did you mean?" google suggestion to your search module.
1- backup your modules/Search/index.php
2- open modules/Search/index.php with text editor
3- search for :
if (!empty($query)) {
echo '<br />';
OpenTable();
echo '<div class="title">' . _FINDMORE . '</div><br />
<div class="content">' . _DIDNOTFIND . '<br /><br />'
. _SEARCH . ' <b>' . $search_htmlstring . '</b> ' . _SEARCHINGIN . ':<br /><br />'
. '<ul>'
. $mods
. '<li><a href="http://www.google.com/search?q=' . $search_urlstring . '" target="_blank">Google</a></li>'
. '<li><a href="http://groups.google.com/groups?q=' . $search_urlstring . '" target="_blank">Google Groups</a></li>'
. '</ul></div>';
CloseTable();
}
4- replace by:
$didyoumean = '';
echo '<br />';
$domaine = ((_DOC_LANGUAGE == 'tr') ? 'com.tr' : _DOC_LANGUAGE);
$ask = "http://www.google.{$domaine}/search?q=" . str_replace(' ', '+', $search_htmlstring);
$ask = str_replace('..', '.', $ask);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ask);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$get = curl_exec($ch);
$get = utf8_encode($get);
$get = explode("spell=1", $get);
if (sizeof($get) > 1) {
$get = explode("</a>", $get[1]);
$get = explode("class=spell>", $get[0]);
if (sizeof($get) > 1) {
$res = $get[1];
if (strlen($res) > 2) {
$didyoumean = '<li>' ._DIDYOUMEAN. ' : <a href="modules.php?name=' . $module_name . '&type='.$_REQUEST['type'].'&query=' . urlencode(strip_tags($res)) . '">' . $res . '</a></li>';
}
}
}
if (!empty($query)) {
OpenTable();
echo '<div class="title">' . _FINDMORE . '</div><br />
<div class="content">' . _DIDNOTFIND . '<br /><br />'
. _SEARCH . ' <b>' . $search_htmlstring . '</b> ' . _SEARCHINGIN . ':<br /><br />'
. '<ul>'
. $didyoumean
. $mods
. '<li><a href="http://www.google.com/search?q=' . $search_urlstring . '" target="_blank">Google</a></li>'
. '<li><a href="http://groups.google.com/groups?q=' . $search_urlstring . '" target="_blank">Google Groups</a></li>'
. '</ul></div>';
CloseTable();
}
5- add those constant to languages files modules/Search/language/lang-XXXX.php
english : define('_DIDYOUMEAN','Search instead for');
german & german_du : define('_DIDYOUMEAN','Stattdessen suchen nach');
french : define('_DIDYOUMEAN','Essayez avec l\'orthographe');
for turkish and danish you can find translation in google
test
here or
here