[code]totalpage=$objpage; } //设置当前页 function setcurrentpage($objpage=1){ $this->currentpage=$objpage; } //设置跨度 function setstride($objstride=1){ $this->stride=$objstride; }//获得总页数 function gettotalpage(){ return $this->totalpage; }//获得跨读 function getstride($objstride=1){ return $this->stride; } //获取当前页 function getcurrentpage($objpage=1){ return $this->currentpage; } //打印分页 public function pageprint(){ for($tmpa=1;$tmpatotalpage;$tmpa++){ if($tmpa+$this->stridecurrentpage){//加了跨度还小于当前页的不显示 continue; } if($tmpa+$this->stride==$this->currentpage){//刚好够跨度的页数 $p=$this->currentpage-1; $willprint.=首页 上一页 ; } if($tmpa>$this->currentpage+$this->stride){//大于当前页+跨度的页面 break; } $willprint.=[$tmpa]; if($tmpa==$this->currentpage+$this->stride){//刚好够跨度的页数 $p=$this->currentpage+$this->stride+1; $willprint.=下一页 totalpage\>末页; } } echo $willprint; }}
class cut_page extends page{ var $filename; var $showtotal; function __construct($filename){ $this->cachefile = $filename; $this->showtotal = yes; } public function filename(){ if (file_exists($this->cachefile)){ return 1; } else return 0; } private $type; public function typelist($typeid){ $this->type = $typeid; $fp = fopen($this->cachefile,rb); $str= fread($fp,filesize($this->cachefile)); //echo $this->type.
; //分类id $arr= explode(::,$str);
for ($i=0;$itype){ //return $arr2[1]; if(isset($_get