perPage = $perPage; if (!empty($_GET[$this->getURL])) { $this->page = $_GET[$this->getURL]; } else { $this->page = 1; } $this->length = count($array); //total pageLinks generated, count(array) $this->pages = ceil($this->length / $this->perPage); // $this->start = ceil(($this->page - 1) * $this->perPage); return array_slice($array, $this->start, $this->perPage); } function getNumPages(){ if (count()) return FALSE; return ceil(mysql_num_rows($this->results) / (float)$this->pageSize); } function links(){ $plinks = array(); $links = array(); $slinks = array(); // Concatenate the get variables to add to the page numbering string if (count($_GET)) { $queryURL = ''; foreach ($_GET as $key => $value) { if (($key != $this->getURL)&&($key != 'mod')) { $queryURL .= '&'.$key.'='.$value; } } } if (($this->pages) > 1){ if ($this->page != 1) { if ($this->showFirstAndLast) { $plinks[] = '
'; } $plinks[] = ' '; } // Create numLinks if(($this->numLinks=='all')||($this->numLinks<1)){ for ($j = 1; $j < ($this->pages + 1); $j++) { if ($this->page == $j) { $links[] = '