From 384f1ba3c9bc94de61a515b0491960b34a1b74ae Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Mon, 19 Jan 2009 15:24:35 -0500 Subject: Remove Less and More links from search results page. Don't show extra search results link if there is only one page of results. Fix indenting and coding style. Signed-off-by: Loui Chang --- web/template/pkg_search_results.php | 54 ++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'web/template/pkg_search_results.php') diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index cae0eb49..c098b286 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -124,34 +124,40 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { + 0) { + $pages = ceil($total / $_GET['PP']); + } + + if ($pages > 1) { + ?> + - - = 0): ?> - - 0): ?> - - - - - 0) { $pages = ceil($total/$_GET['PP']); } ?> - 0) { $currentpage = ceil(($_GET['O']+1)/$_GET['PP']); } - else { $currentpage = 1; } ?> - $currentpage) : - $pagestart = ($i-1)*$_GET['PP']; ?> - - - - - 0): ?> - '> - + + 0) { + $currentpage = ceil(($_GET['O'] + 1) / $_GET['PP']); + } + else { + $currentpage = 1; + } + + for ($i = 1; $i <= $pages; $i++) { + if ($i <> $currentpage) : + $pagestart = ($i - 1) * $_GET['PP']; + ?> + + - + -- cgit v1.2.3-24-g4f1b