diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-11-18 19:21:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-11-18 19:21:09 +0000 |
commit | 36cb350ef1e45ec946242cb2c52b3f4d9004600a (patch) | |
tree | fe58574bdc5b09cf1c6a0744bbba29ce54a7acc4 | |
parent | 57a9590a44ee5eb35d8929728a4afc2f676c3599 (diff) | |
download | brdo-36cb350ef1e45ec946242cb2c52b3f4d9004600a.tar.gz brdo-36cb350ef1e45ec946242cb2c52b3f4d9004600a.tar.bz2 |
- Don't display "1" when there is only one page.
-rw-r--r-- | includes/pager.inc | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/includes/pager.inc b/includes/pager.inc index a50937e9d..17a276b21 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -207,26 +207,29 @@ function pager_list($limit, $element = 0, $quantity = 5, $text = "") { } // end of generation loop preparation - $output = "$text"; - if ($i > 1) { - $output .= "... "; - } - - // finally we're ready to generate the actual pager piece - for (; $i <= $pager_last && $i <= $pager_max; $i++) { - if ($i < $pager_current) { - $output .= pager_previous($i, $limit, $element, ($pager_current - $i)) ." "; - } - if ($i == $pager_current) { - $output .= "<b>$i</b> "; + // when there is more than one page, create the pager list + if ($i != $pager_max) { + $output = "$text"; + if ($i > 1) { + $output .= "... "; } - if ($i > $pager_current) { - $output .= pager_next($i, $limit, $element, ($i - $pager_current)) ." "; + + // finally we're ready to generate the actual pager piece + for (; $i <= $pager_last && $i <= $pager_max; $i++) { + if ($i < $pager_current) { + $output .= pager_previous($i, $limit, $element, ($pager_current - $i)) ." "; + } + if ($i == $pager_current) { + $output .= "<b>$i</b> "; + } + if ($i > $pager_current) { + $output .= pager_next($i, $limit, $element, ($i - $pager_current)) ." "; + } } - } - if ($i < $pager_max) { - $output .= "..."; + if ($i < $pager_max) { + $output .= "..."; + } } return $output; |