mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Only print links for up to five previous and next search results pages.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
60d63cc6b7
commit
345fbfe99f
1 changed files with 12 additions and 2 deletions
|
@ -142,9 +142,19 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
|
|||
$currentpage = 1;
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= $pages; $i++) {
|
||||
if ($i <> $currentpage) :
|
||||
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) :
|
||||
?>
|
||||
<a href='packages.php?<?php print mkurl('O=' . ($pagestart))?>'><?php print "$i " ?></a>
|
||||
<?php else : print "[$i] ";
|
||||
|
|
Loading…
Add table
Reference in a new issue