From 1fdecbd5a45ef631562a11937d870e4c8cf619b0 Mon Sep 17 00:00:00 2001 From: PyroPeter Date: Wed, 16 Feb 2011 18:48:09 +0100 Subject: pkg_search_results: rewrite of pagination * Most of the PHP-code was moved to pkgfuncs.php to keep the template simple. Signed-off-by: PyroPeter Signed-off-by: Lukas Fleischer --- web/template/pkg_search_results.php | 77 +++++++------------------------------ 1 file changed, 14 insertions(+), 63 deletions(-) (limited to 'web/template') diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index 4830ca8..68ba89a 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -113,73 +113,24 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { - - - -
- -
- 0): - $O = $_GET['O'] - $_GET['PP']; - - if ($_GET['O'] < $_GET['PP']) { - $O = 0; - } - ?> - "> - "> - - - 0) { - $pages = ceil($total / $_GET['PP']); - } - - if ($pages > 1) { - if ($_GET['O'] > 0) { - $currentpage = ceil(($_GET['O'] + 1) / $_GET['PP']); - } - else { - $currentpage = 1; - } - - $morepages = $currentpage + 5; - - print (($currentpage-5) > 1) ? '...' : ''; - - # Display links for more search results. - for ($i = ($currentpage - 5); $i <= $morepages && $i <= $pages; $i++) { - if ($i < 1) { - $i = 1; - } - - $pagestart = ($i - 1) * $_GET['PP']; - - if ($i <> $currentpage) : - ?> - - $i"; - endif; - } - - print ($pages > $morepages) ? '...' : ''; - ?> - - 0): ?> - '> - '> - - +
+ +
+ - - +
-- cgit v1.2.3-70-g09d2