Commit 345fbfe9 authored by Loui Chang's avatar Loui Chang
Browse files

Only print links for up to five previous and next search results pages.


Signed-off-by: default avatarLoui Chang <louipc.ist@gmail.com>
parent 60d63cc6
......@@ -142,9 +142,19 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
$currentpage = 1;
}
for ($i = 1; $i <= $pages; $i++) {
if ($currentpage + 5 < $pages) {
$pages = $currentpage + 5;
}
# Display links for more search results.
for ($i = ($currentpage - 5); $i <= ($pages); $i++) {
if ($i < 1) {
$i = 1;
}
$pagestart = ($i - 1) * $_GET['PP'];
if ($i <> $currentpage) :
$pagestart = ($i - 1) * $_GET['PP'];
?>
<a href='packages.php?<?php print mkurl('O=' . ($pagestart))?>'><?php print "$i " ?></a>
<?php else : print "[$i] ";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment