Hello,
I have installed the DGS search on my site, but the stats module does not work, I think it is because the string replace too long, it can not work on PHP4.01, can anybody help me to change it without using the language pack, I don't want to use any other language only english, Thank you in advance.
the statc.php as follows:
<?php
/
DGS Search
stats.php written by James Sella
Copyright (c) 2000-2001 Digital Genesis Software, LLC. All Rights Reserved.
Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
/
function stats($retVal, $q, $r, $o, $s, $timer) {
global $config, $lang;
$size = ($s < 1) ? count($retVal) : $s;
$fonts = $config['fonts'];
$target = $config['target'];
$lowerBound = $o + 1;
$upperBound = ($r + $o < $size) ? $o + $r : $size;
$searchTime = sprintf('%.1f', getTime() - $timer);
$searchTime = ($searchTime > 0.0) ? $searchTime : 0.1;
if ($size > 0) {
$lang['stats'] = str_replace('@QUERY@', $q, $lang['stats']);
$lang['stats'] = str_replace('@SEARCHTIME@', $searchTime, $lang['stats']);
$lang['stats'] = str_replace('@LOWERBOUND@', $lowerBound, $lang['stats']);
$lang['stats'] = str_replace('@UPPERBOUND@', $upperBound, $lang['stats']);
$lang['stats'] = str_replace('@TOTALRESULTS@', $size, $lang['stats']);
printf("\t<DIV> <!-- Display Module: stats -->\n\t\t<FONT FACE=\"%s\">%s", $fonts, $lang['stats']);
} else if (!$q) {
$lang['noQuery'] = str_replace('@QUERY@', $q, $lang['noQuery']);
$lang['noQuery'] = str_replace('@SEARCHTIME@', $searchTime, $lang['noQuery']);
printf("\t\t<FONT FACE=\"%s\">%s", $fonts, $lang['noQuery']);
} else {
$lang['noResults'] = str_replace('@QUERY@', $q, $lang['noResults']);
$lang['noResults'] = str_replace('@SEARCHTIME@', $searchTime, $lang['noResults']);
printf("\t\t<FONT FACE=\"%s\">%s", $fonts, $lang['noResults']);
}
if ($config['timed'] && $q) {
$lang['searchTime'] = str_replace('@QUERY@', $q, $lang['searchTime']);
$lang['searchTime'] = str_replace('@TOTALRESULTS@', $size, $lang['searchTime']);
$lang['searchTime'] = str_replace('@SEARCHTIME@', $searchTime, $lang['searchTime']);
printf(' %s', $lang['searchTime']);
}
printf("\t</FONT>\n\t</DIV>\n");
return true;
}
?>
****** And the English package as follows:
<?php
/
DGS Search
english.php written by James Sella
Copyright (c) 2000-2001 Digital Genesis Software, LLC. All Rights Reserved.
Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
/
/* English Language Pack */
$lang['header'] = 'DGS Search Results';
$lang['query'] = '<B>Query:</B>';
$lang['submit'] = 'Search';
$lang['stats'] = 'Displaying results <B>@LOWERBOUND@</B>-<B>@UPPERBOUND@</B> of <B>@TOTALRESULTS@</B> matches for query \'<B>@QUERY@</B>\'.';
$lang['noQuery'] = '<B>No search query was entered. Please search again.</B>';
$lang['noResults'] = 'Search for query \'<B>@QUERY@</B>\' found no results.';
$lang['searchTime'] = 'Search took @SEARCHTIME@ sec.';
$lang['translate'] = 'Translate';
$lang['resultPages'] = 'Result Pages';
$lang['next'] = '[Next >>]';
$lang['prev'] = '[<< Prev]';
/* Add error messages here. */
?>