pagination anzahl button begrenzung

Wie erstellt man einen kompletten Pagination Code
Kommentar abgeben zu diesen Beitrag/Code ?
Dann hier klicken

Der hier verwendete Code

<?php
class Pagination{
protected
$page_offset_current,
$lines_count_all,
$lines_per_page,
$n,
$last_page_lines_count,
$pages_max_num,
$n_left,
$n_right,
$page_previous,
$page_next,
$page_jump_backwards,
$page_jump_forwards,
$left_side_nav_num,
$right_side_nav_num;
public function __construct($page_offset_current, $lines_count_all, $lines_per_page=25, $n=5){
$this->page_offset_current = (!$page_offset_current) ? 1 : (double)($page_offset_current);
$this->lines_count_all = (double)$lines_count_all;
$this->lines_per_page = (int)$lines_per_page;
$this->n = (int)$n;
$this->calc();
return;
}
public function __destruct(){
return;
}
final protected function calc(){
$this->pages_max_num = floor($this->lines_count_all/$this->lines_per_page);
(($this->last_page_lines_count=$this->lines_count_all-$this->pages_max_num*$this->lines_per_page) < 1)
or (++$this->pages_max_num);
($this->page_offset_current <= $this->pages_max_num)
or ($this->page_offset_current=$this->pages_max_num);
($this->page_offset_current >= 1)
or ($this->page_offset_current=1);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX