雷火电竞-中国电竞赛事及体育赛事平台

歡迎來(lái)到入門(mén)教程網(wǎng)!

dedecms

當(dāng)前位置:主頁(yè) > CMS教程 > dedecms >

織夢(mèng)dedecms搜索結(jié)果頁(yè)調(diào)用總搜索條數(shù)的教程

來(lái)源:本站原創(chuàng)|時(shí)間:2021-08-05|欄目:dedecms|點(diǎn)擊:

要實(shí)現(xiàn)織夢(mèng)dedecms搜索結(jié)果頁(yè)調(diào)用總搜索條數(shù),需修改代碼,打開(kāi)根目錄下/include/arc.searchview.class.php
 
效果演示
 
織夢(mèng)dedecms搜索結(jié)果頁(yè)調(diào)用總搜索條數(shù)的教程
 
第一步、找到大概第533行,找到
 
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));
}
 
第二步、繼續(xù)找到大概935行:
 
/**
 *  獲得當(dāng)前的頁(yè)面文件的url
 *
 * @access    public
 * @return    string
 */
在這句代碼的上面添加以下代碼:
 
 
//————  
//搜索輸出總量www.jygsgssxh.com 織夢(mèng)模板下載  
//————  
function GetItemsCountDM($list_len)  
{    
    global $oldkeyword;    
    $pagenow = ($this->PageNo-1) * 10 + 1;    
    $pagenows = $this->PageNo*10;   //當(dāng)結(jié)果超過(guò)限制時(shí),重設(shè)結(jié)果頁(yè)數(shù)    
    if($this->TotalResult > $this->SearchMaxRc)   
    { 
        $totalpage = ceil($this->SearchMaxRc/$this->PageSize);    
    }   
    $plist .= $this->TotalResult;    
    return $plist;  
}
第三步、在要顯示的地方使用 {dede:itemcount listsize='4'/} 即可調(diào)用
 

上一篇:織夢(mèng)搜索結(jié)果頁(yè)按點(diǎn)擊排序的方法

欄    目:dedecms

下一篇:織夢(mèng)最新發(fā)表的文章在24小時(shí)內(nèi)標(biāo)題顯示紅色

本文標(biāo)題:織夢(mèng)dedecms搜索結(jié)果頁(yè)調(diào)用總搜索條數(shù)的教程

本文地址:http://www.jygsgssxh.com/a1/dedecms/16725.html

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關(guān)

隨機(jī)閱讀

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有