自带分页类Page.class.php有BUG

浏览:1259 发布日期:2013/06/11 分类:站务建议 关键字: 分页 BUG
比如总也数为7,当前分页为5,那么显示的下5页是第10页,而实际上没有10页的存在。

应该把118行到131行替换为        }else{
            $preRow     =   $this->nowPage-$this->rollPage;
            if($preRow < 1){
                $prePage    =   "<a href='".str_replace('__PAGE__',$preRow,$url)."' >上".$this->rollPage."页</a>";
            }
            $theFirst   =   "<a href='".str_replace('__PAGE__',1,$url)."' >".$this->config['first']."</a>";
        }
        if($nowCoolPage == $this->coolPages){
            $nextPage   =   '';
            $theEnd     =   '';
        }else{
            $nextRow    =   $this->nowPage+$this->rollPage;
            $theEndRow  =   $this->totalPages;
            if($theEndRow > $nextRow){
                   $nextPage   =   "<a href='".str_replace('__PAGE__',$nextRow,$url)."' >下".$this->rollPage."页</a>";
            }
            $theEnd     =   "<a href='".str_replace('__PAGE__',$theEndRow,$url)."' >".$this->config['last']."</a>";
        }
这样修改后,下午页大雨最大页数时就不会现实,上5页小于1时也不会显示,这样才合理。
最佳答案
评论( 相关
后面还有条评论,点击查看>>