
歡迎訪問全國企業(yè)網(wǎng)站設(shè)計(jì)NO.1網(wǎng)站開發(fā)商平臺(tái) | 付款方式 |
POST TIME:2020-09-08
由于dedecms原生不支持搜索頁面結(jié) 果總數(shù)的調(diào)用,所以得自己修改文件來支持了。搜索頁面調(diào)用的代碼全在/include/arc.searchview.class.php里,我們先打開 /include/arc.searchview.class.php文件,然后按下面步驟修改文件
第一步:在
else if($tagname=="pagelist")
{
$list_len = trim($ctag->GetAtt("listsize"));
if($list_len=="")
{
$list_len = 3;
}
$this->dtp->Assign($tagid,$this->GetPageListDM($list_len));
}
下面添加:
else if($tagname=="itemcount")
{
$list_len = trim($ctag->GetAtt("listsize"));
if($list_len=="")
{
$list_len = 3;
}
$this->dtp->Assign($tagid,$this->GetItemsCountDM($list_len));
}
第二步:在
/**
* 獲得當(dāng)前的頁面文件的url
*
* @access public
* @return string
*/
前面添加下面代碼:
//————
//搜索輸出總量
//————
function GetItemsCountDM($list_len)
{
global $oldkeyword;
$pagenow = ($this->PageNo-1) * 10 + 1;
$pagenows = $this->PageNo*10; //當(dāng)結(jié)果超過限制時(shí),重設(shè)結(jié)果頁數(shù)
if($this->TotalResult > $this->SearchMaxRc)
{
$totalpage = ceil($this->SearchMaxRc/$this->PageSize);
}
$plist .= $this->TotalResult;
return $plist;
}
第三步:
在要顯示的地方加入
{dede:itemcount listsize='4'/} 即可
巨號網(wǎng)網(wǎng)站開發(fā)部為全國企業(yè)提供網(wǎng)頁設(shè)計(jì)和專業(yè)的公司網(wǎng)站制作等相關(guān)建站服務(wù),并提供24小時(shí)企業(yè)網(wǎng)站設(shè)計(jì)咨詢!
關(guān)于我們 建站知識(shí) 榮譽(yù)資質(zhì)網(wǎng)站地圖