您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

一直超简单的php分页代码-支持smarty模板分页

2025/5/9 5:44:09发布18次查看
param;
            unset($param['page']);
            if(is_array($param) && !empty($param)){
                foreach($param as $key=>$value){
                    $data[] = $key./.$value;
                }
                $this->url = implode(/,$data);
                $this->param = $this->url;
                $this->url = /.$this->url;
            }else{
                if(!empty($param)){
                    $this->url = $param;
                    $this->param = $this->url;
                    $this->url = /.$this->url;
                }
            }
        }
function pagedate(){
            $this->setparam();
            $num = ceil($this->lun/2);
            $this->page = intval($this->page);
            $this->page = $this->page page;
$cpage['countpage'] = ceil($this->count/$this->size); //总页数
            $cpage['page'] = $this->page > $cpage['countpage'] ? $cpage['countpage']:$this->page ;
            //当前页
            //显示总数
            $cpage['lun'] = $cpage['countpage'] lun ? $cpage['countpage'] : $this->lun;
            //开始页码
            $cpage['start'] = $this->page > $num-1 ? $this->page-$num+1 : 1;
$cpage['start'] = ($cpage['start']+$cpage['lun'])>=$cpage['countpage'] ? $cpage['countpage']-$cpage['lun']+1 : $cpage['start'];
//参数显示
            $cpage['url'] = $this->url;
            //控制跳转
            $cpage['run'] = $this->run ? 1 : 0;
            $cpage['param'] = is_array($this->param) ? '': ?.$this->param;
            return $cpage;
        }
    }
    /*include ../inc/smarty.php;
    $cp = new page;
empty($_request['page']) || $cp->page = $_request['page'];
    $cp->count = 70000;
    $cp->param =  $_get;
    $cp->size = 100;
    $cp->lun = 7;
    $cp->run = true;
    $data = $cp->pagedate();
    $smarty->assign(page,$data);
    $smarty->display(cpage.html);
    */
?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product