帝國cms和織夢對比「織夢免費模板多嗎」

織夢dede中列表頁顯示條數不同的解決方法

首先找到網站根目錄/include/ arc.listview.class.php

這裡以列表首頁顯示6條,其他列表頁顯示9條為例,即

模板頁標籤{dede:list pagesize=”6″}{/dede:list}

$this->PageSize = 6

1.找到函數ParseDMFields

在裡面找

1if($ctag->GetName()==”list”)2 {3 $limitstart = ($this->PageNo-1) * $this->PageSize;4 $row = $this->PageSize;

修改為:

01if($ctag->GetName()==”list”)02 {03 $limitstart = ($this->PageNo-1) * $this->PageSize;04 if($this->PageNo>2)05{06 $limitstart = ($this->PageNo-1) * ($this->PageSize+3)-3;07 }08 $row = $this->PageSize;09 if($this->PageNo>1)10{11 $row = $this->PageSize+3;12 }

2.找到

1$totalpage = ceil($this->TotalResult/$this->PageSize);//總共有兩處分別為靜態和動態

改為

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

原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/234726.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
投稿專員的頭像投稿專員
上一篇 2024-12-12 11:49
下一篇 2024-12-12 11:49

相關推薦

發表回復

登錄後才能評論