class pageflip { private $page; private $items = array(); private $showitems; private $output; public function setPage($value) { if ($value <> "") { $this->page = $value; } else { $this->page = 1; } } private function getPage() { return $this->page; } public function setItems($value) { $this->items = $value; } private function getItems() { return $this->items; } public function setShowitems($value) { $this->showitems = $value; } private function getShowitems() { return $this->showitems; } private function setOutput($value) { $this->output = $value; } public function getOutput() { return $this->output; } public function __construct() { $itemscount = count($this->items); var_dump(count($this->items)); $pages_available = ceil($itemscount/$this->showitems); $start = (($this->page * $this->showitems) - $this->showitems) + 1; $end = $this->page * $this->showitems; for ($i = $start; $i <= $end; $i++) { $index = ($i - 1); $html .= $this->items[$index]; } // links generieren $html .= $this->generateLinks(); $this->setOutput($html); } }