diff --git a/pagination.php b/pagination.php index 1c6e653..cf30e07 100644 --- a/pagination.php +++ b/pagination.php @@ -22,7 +22,7 @@ public function __construct($max, $total, $page = 1, $max_items = 10) $this->max_items = $max_items; # Set the page as a number, bypassing GET - $this->page = (!empty($page) && ($page <= $this->pages()) && is_numeric($page)) ? $page : 1; + $this->page = (!empty($page) && ($page <= $this->pages()) && is_numeric($page) && $page>0 ) ? $page : 1; } /** @@ -56,7 +56,7 @@ public function get_html($theme_file=null) public function start() { # Computers Calculate From 0 thus, page1 must start results from 0 - $start = $this->page - 1; + $start = abs($this->page - 1); # Calculate Our Starting Point (0x6=0(start from 0, page1), 1x6=6(start from 6, page2), etc) $calc = $start*$this->max;