Can\'t Open HTDIG Search.'
.'Please make sure that HTDIG installed correctly.';
}
} else {
// htdig cgi binary search URL
$url = $htdigBin.'?config='.$config.'&restrict='.$restrict.'&exclude='.$exclude.'&method='.$method.'&format='.$format.'&sort='.$sort.'&words='.$words.'&page='.$page;
$handle = @fopen($url, 'r');
if (!$handle) {
echo '
Can\'t Open HTDIG for search.'
.'Please make sure that HTDIG installed correctly.
';
}
}
// output
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
if (preg_match('/PAGING_SEARCH_RESULT/i', $buffer)) {
$buffer = preg_replace('/cgi-bin/i', str_replace('/', '', SWB), $buffer);
$buffer = preg_replace('/htsearch/', 'index.php', $buffer);
$buffer = preg_replace('/\?/', '', $buffer);
$buffer = preg_replace('/index.php/', 'index.php?p=htdig&', $buffer);
$buffer = preg_replace('/;/', '&', $buffer);
}
echo $buffer;
}
fclose($handle);
}