X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/f54be9a638c1f0d8f6a04bc2e0b8e0eb0731a720..256dda0773f9d540ab4b276949b4f98215261828:/www/search.php diff --git a/www/search.php b/www/search.php index 9461b0d..82b40a7 100644 --- a/www/search.php +++ b/www/search.php @@ -3,10 +3,11 @@ namespace phorkie; /** * Search for a search term */ +$reqWritePermissions = false; require_once 'www-header.php'; if (!isset($_GET['q']) || $_GET['q'] == '') { - header('Location: ' . Tools::fullUrl('/list')); + header('Location: ' . Tools::fullUrl('list')); exit(); } $query = $_GET['q']; @@ -19,28 +20,16 @@ if (isset($_GET['page'])) { //PEAR Pager begins at 1 $page = (int)$_GET['page'] - 1; } -$perPage = 10; +$perPage = $GLOBALS['phorkie']['cfg']['perPage']; $db = new Database(); $search = $db->getSearch(); $sres = $search->search($query, $page, $perPage); -//fix non-static factory method error -error_reporting(error_reporting() & ~E_STRICT); -$pager = \Pager::factory( - array( - 'mode' => 'Sliding', - 'perPage' => 10, - 'delta' => 2, - 'totalItems' => $sres->getResults(), - 'currentPage' => $page + 1, - 'urlVar' => 'page', - 'path' => '/', - 'fileName' => $sres->getLink($query), - ) +$pager = new Html_Pager( + $sres->getResults(), $perPage, $page + 1, $sres->getLink($query) ); - render( 'search', array(