diff options
-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; |