PageSize = 6 1.找到函数ParseDMFields 在里面找 if($ctag->GetName()=="list") { $limitstart = " />

dedecms中列表页显示条数不同的解决方法

admin 167 2022-07-24

阿里云服务器优惠多,折扣错,惊喜多,请咨询:www.wqiis.com

首先找到网站根目录/include/ arc.listview.class.PHP

这里以列表首页显示6条,其他列表页显示9条为例,即

dedecms中列表页显示条数不同的解决方法

模板页标签{dede:list pagesize="6"}{/dede:list}

$this->PageSize = 6

1.找到函数ParseDMFields 在里面找

if($ctag->GetName()=="list")

{

$limitstart = ($this->PageNo-1) * $this->PageSize;

$row = $this->PageSize;

修改为

if($ctag->GetName()=="list")

{

$limitstart = ($this->PageNo-1) * $this->PageSize;

if($this->PageNo>2)

{

$limitstart = ($this->PageNo-1) * ($this->PageSize+3)-3;

}

$row = $this->PageSize;

if($this->PageNo>1)

{

$row = $this->PageSize+3;

}

2.找到

$totalpage = ceil($this->TotalResult/$this->PageSize);//总共有两处分别为静态和动态

改为

$totalpage = ceil(1+($this->TotalResult-$this->PageSize)/($this->PageSize+3));

上一篇:360检测Dedecms重定向漏洞的解决方案(dedecms漏洞利用)
下一篇:docker run 运行容器自动结束的解决(docker常用命令)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~