diff --git a/include/class.pagenate.php b/include/class.pagenate.php index a696ce9f5764fd976278014b18b5c615bd11c4ca..7f4be6a37ec1ff5b0269cccc67b64d3883a7a672 100644 --- a/include/class.pagenate.php +++ b/include/class.pagenate.php @@ -55,7 +55,7 @@ class PageNate { } function getStart() { - return max($this->start + 1 - $this->slack, 1); + return max($this->start - $this->slack, 0); } function getLimit() { @@ -76,7 +76,7 @@ class PageNate { function showing() { $html = ''; - $start = $this->getStart(); + $start = $this->getStart() + 1; $end = min($start + $this->limit + $this->slack - 1, $this->total); if ($end < $this->total) { $to= $end; @@ -147,7 +147,7 @@ class PageNate { } function paginate(QuerySet $qs) { - $start = $this->getStart() - 1; + $start = $this->getStart(); $end = min($start + $this->getLimit() + $this->slack + ($start > 0 ? $this->slack : 0), $this->total); return $qs->limit($end-$start)->offset($start); }