{% else-1 %}
(18 дек 2013, 10:12) (0/0) [0]
[code]
<?

class pagination
{

public $pages;

public $page;

public $start;

public $limit;

function __construct($count,$limit)
{

$this->pages=ceil($count/$limit);

$this->page =(int) abs($_GET[\'page\']);

if($this->page<1 OR !$this->page)
{

$this->page=1;

}

if($this->page>$this->pages)
{

$this->pages;

}

$this->start=$this->page*$limit-$limit;

}


public function display($url)
{

if(($this->page-1) > 0)
{

echo\'<a href=\"\'.$url.\'page=\'.($this->page-1).\'\">\'.($this->page-1).\'</a>\';

echo\' | \';

}

echo $this->page;

if(($this->page+1)<=$this->pages)
{

echo\' | \';

echo\'<a href=\"\'.$url.\'page=\'.($this->page+1).\'\">\'.($this->page+1).\'</a>\';

}

}

}

?>
[/code]

мой.. -.-
  • 1 из 1