";exit();}if(! strstr(ini_get('disable_functions'), 'ini_set')) {ini_set('default_charset','UTF-8');}header('Content-Type: text/html; charset=UTF-8');header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');header('Cache-Control: post-check=0, pre-check=0', false);header('Pragma: no-cache'); ?>
$length)
{
$string = wordwrap($string, $length);
$string = $mb? mb_substr($string, 0, mb_strpos($string, "\n")) : substr($string, 0, strpos($string, "\n"));
}
return $string;
}
function clip_string($string, $pos, $length, $total) {
global $mb;
if($length) {
$m = $mb ? mb_substr($string, $pos, $length) : substr($string, $pos, $length);
$before = $mb ? mb_substr($string, 0, $pos) : substr($string, 0, $pos);
$after = $mb ? mb_substr($string, $pos + $length, mb_strlen($string) - ($pos + $length)) : substr($string, $pos + $length, strlen($string) - ($pos + $length));
$before = rev_string($before);
if($total < strlen($string)) {
$half = intval(($total - $length) / 2);
} else {
$half = $total;
}
$hlPre = '
';
$hlPost = '';
$out = htmlentities(rev_string(word_trunc($before, $half))) . $hlPre . htmlentities($m) . $hlPost . htmlentities(word_trunc($after, $half));
return $out;
} else {
return htmlentities(word_trunc($string, $total));
}
}
if(count($searchResults) == 0) {
$result = '
';
$result = str_replace('{title}', htmlentities('Keine Suchergebnisse'), $result);
$result = str_replace('{text}', '', $result);
echo $result;
}
else {
echo '';
foreach($searchResults as $searchResult) {
$result = '
';
$result = str_replace('{title}', '
' . $searchResult['title'] . '', $result);
$text = "";
foreach($searchResult['snippets'] as $s) {
$pos = $s['pos'];
$m = $s['matchlen'];
$snippet = clip_string($s['text'], $pos, $m, $s['snip']);
if(strlen($text))
$text .= " … ";
$text .= " " . $snippet;
}
$result = str_replace('{text}', $text, $result);
echo $result;
}
}
?>
.pbdn{display:none}.pbc{background-color:rgba(186,115,39,.2);color:rgba(18,0,0,.6);border-color:rgba(18,0,0,.8)}';
$control = '
';
if($page > 1) {
$url = htmlspecialchars(strtok($_SERVER['REQUEST_URI'], '?'), ENT_QUOTES, 'UTF-8') . '?search=' . rawurlencode($searchFor) . '&page=' . ($page - 1);
$control = str_replace('href="#"', 'href="' . $url . '"', $control);
$control = str_replace('{lnkclass}', '', $control);
$control = str_replace('{btnclass}', '', $control);
}
else {
$control = str_replace('{lnkclass}', '', $control);
$control = str_replace('{btnclass}', 'pbdn', $control);
}
echo $control;
?>
';
$buttonPage = $start_page + 1 - 1;
if($buttonPage <= $end_page) {
$url = htmlspecialchars(strtok($_SERVER['REQUEST_URI'], '?'), ENT_QUOTES, 'UTF-8') . '?search=' . rawurlencode($searchFor) . '&page=' . $buttonPage;
if($buttonPage == $page) {
$control = str_replace('href="#"', '', $control);
$control = str_replace('{lnkclass}', 'pbc', $control);
}
else {
$control = str_replace('href="#"', 'href="' . $url . '"', $control);
$control = str_replace('{lnkclass}', '', $control);
}
$control = str_replace('{btnclass}', '', $control);
$control = str_replace('{page_num}', $buttonPage, $control);
}
else {
$control = str_replace('{lnkclass}', '', $control);
$control = str_replace('{page_num}', '', $control);
$control = str_replace('{btnclass}', 'pbdn', $control);
}
echo $control;
?>
';
$buttonPage = $start_page + 2 - 1;
if($buttonPage <= $end_page) {
$url = htmlspecialchars(strtok($_SERVER['REQUEST_URI'], '?'), ENT_QUOTES, 'UTF-8') . '?search=' . rawurlencode($searchFor) . '&page=' . $buttonPage;
if($buttonPage == $page) {
$control = str_replace('href="#"', '', $control);
$control = str_replace('{lnkclass}', 'pbc', $control);
}
else {
$control = str_replace('href="#"', 'href="' . $url . '"', $control);
$control = str_replace('{lnkclass}', '', $control);
}
$control = str_replace('{btnclass}', '', $control);
$control = str_replace('{page_num}', $buttonPage, $control);
}
else {
$control = str_replace('{lnkclass}', '', $control);
$control = str_replace('{page_num}', '', $control);
$control = str_replace('{btnclass}', 'pbdn', $control);
}
echo $control;
?>
';
$buttonPage = $start_page + 3 - 1;
if($buttonPage <= $end_page) {
$url = htmlspecialchars(strtok($_SERVER['REQUEST_URI'], '?'), ENT_QUOTES, 'UTF-8') . '?search=' . rawurlencode($searchFor) . '&page=' . $buttonPage;
if($buttonPage == $page) {
$control = str_replace('href="#"', '', $control);
$control = str_replace('{lnkclass}', 'pbc', $control);
}
else {
$control = str_replace('href="#"', 'href="' . $url . '"', $control);
$control = str_replace('{lnkclass}', '', $control);
}
$control = str_replace('{btnclass}', '', $control);
$control = str_replace('{page_num}', $buttonPage, $control);
}
else {
$control = str_replace('{lnkclass}', '', $control);
$control = str_replace('{page_num}', '', $control);
$control = str_replace('{btnclass}', 'pbdn', $control);
}
echo $control;
?>