国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms搜索結果頁調用總搜索條數的教程

2024-07-12 09:00:02
字體:
來源:轉載
供稿:網友

要實現織夢dedecms搜索結果頁調用總搜索條數,需修改代碼,打開根目錄下/include/arc.searchview.class.php

效果演示

織夢dedecms搜索結果頁調用總搜索條數的教程

第一步、找到大概第533行,找到
1
2
3
4
5
6
7
8
9
else if($tagname=="pagelist")
{
  $list_len = trim($ctag->GetAtt("listsize"));
 if($list_len=="")
 {
  $list_len = 3;
 }
  $this->dtp->Assign($tagid,$this->GetPageListDM($list_len));
}

在這句代碼的下面加入:

1
2
3
4
5
6
7
8
9
else if($tagname=="itemcount")
{   
    $list_len = trim($ctag->GetAtt("listsize"));   
    if($list_len=="")   
    {
        $list_len = 3;   
    }   
    $this->dtp->Assign($tagid,$this->GetItemsCountDM($list_len));
}
第二步、繼續找到大概935行:
1
2
3
4
5
6
/**
 *  獲得當前的頁面文件的url
 *
 * @access    public
 * @return    string
 */

在這句代碼的上面添加以下代碼:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//————  
//搜索輸出總量www.CUOxin.com織夢模板下載  
//————  
function GetItemsCountDM($list_len)  
{    
    global $oldkeyword;    
    $pagenow = ($this->PageNo-1) * 10 + 1;    
    $pagenows = $this->PageNo*10;   //當結果超過限制時,重設結果頁數    
    if($this->TotalResult > $this->SearchMaxRc)   
    { 
        $totalpage = ceil($this->SearchMaxRc/$this->PageSize);    
    }   
    $plist .= $this->TotalResult;    
    return $plist;  
}

第三步、在要顯示的地方使用 {dede:itemcount listsize='4'/} 即可調用


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 卓资县| 高青县| 临洮县| 聊城市| 利津县| 夏河县| 繁昌县| 彭水| 阿拉尔市| 石首市| 龙州县| 新密市| 六安市| 武功县| 商洛市| 弋阳县| 伊川县| 新泰市| 新巴尔虎右旗| 宜川县| 唐海县| 东莞市| 灵山县| 铁岭县| 洛浦县| 阜城县| 揭东县| 隆尧县| 禹城市| 两当县| 达州市| 固原市| 五寨县| 五河县| 清新县| 阿克苏市| 通江县| 茌平县| 木兰县| 扶余县| 青河县|