X-Git-Url: https://git.cweiske.de/phinde.git/blobdiff_plain/87670eb07d1b0e82e0a8b4c1f9b9d20e3cafdb42..cb78e8dbc0351660d0c5c15be2a7b9b969ad9dbe:/www/index.php diff --git a/www/index.php b/www/index.php index 54d5da8..6bdaf9d 100644 --- a/www/index.php +++ b/www/index.php @@ -6,8 +6,8 @@ require 'www-header.php'; if (!isset($_GET['q'])) { $_GET['q'] = ''; } +$query = trim($_GET['q']); -$query = $_GET['q']; $page = 0; if (isset($_GET['page'])) { if (!is_numeric($_GET['page'])) { @@ -137,11 +137,20 @@ $urlSortRelevance = buildLink( ); $urlSortDate = $urlSortRelevance . '&sort=date'; +if (isset($_GET['format']) && $_GET['format'] == 'opensearch') { + $template = 'opensearch'; + $baseLink .= '&format=opensearch'; + header('Content-type: application/atom+xml'); +} else { + $template = 'search'; +} + render( - 'search', + $template, array( 'queryTime' => round($timeEnd - $timeBegin, 2) . 's', 'query' => $query, + 'fullUrl' => Helper::fullUrl($baseLink), 'cleanQuery' => $cleanQuery, 'urlNoSite' => $urlNoSite, 'site' => $site,