php google 風格分頁代碼
public function showCtrlPanel_g($halfPer = 5) {
$re = '
- '.$this->lineCount.'條
- '.$this->currentPage.'/'.$this->pageCount.'頁
';
if($this->currentPage-$halfPer >1){
$re .= '
- fileName.'pageno=1">1
';
if($this->currentPage-$halfPer*2 >1){
$re .= '
- fileName.'pageno='.($this->currentPage-$halfPer*2).'">...
';
}else{
$re .= '
- fileName.'pageno=1">...
';
}
}
for ( $i = $this->currentPage - $halfPer,$i > 1 || $i = 1 , $j = $this->currentPage + $halfPer, $j < $this->pageCount || $j = $this->pageCount;$i <= $j ;$i++ )
{
$re .= $i == $this->currentPage
? '
- fileName.'pageno='.$i.'">'.$i.'
'." "
: '
- fileName.'pageno='.$i.'">'.$i.'
'." ";
}
if($this->currentPage+$halfPer < $this->pageCount){
if($this->currentPage+$halfPer*2 < $this->pageCount){
$re .= '
- fileName.'pageno='.($this->currentPage+$halfPer*2).'">...
';
}else{
$re .= '
- fileName.'pageno='.$this->pageCount.'">...
';
}
$re .= '
- fileName.'pageno='.$this->pageCount.'">'.$this->pageCount.'
';
}
$re .= '
';
return $re;
}
http://www.bkjia.com/PHPjc/445013.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445013.htmlTechArticlephp google 風格分頁代碼 public function showCtrlPanel_g($halfPer = 5){ $re = 'div class=pageMore ul lispan'.$this-lineCount.'條/span/li lispan'.$this-currentPage.'/'.$this-p...