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

歡迎來到入門教程網(wǎng)!

dedecms

當前位置:主頁 > CMS教程 > dedecms >

織夢DedeCMS搜索頁調(diào)用搜索結(jié)果條數(shù)的實現(xiàn)方法

來源:本站原創(chuàng)|時間:2021-08-05|欄目:dedecms|點擊:

織夢的搜索結(jié)果數(shù)量都集成在了列表分頁標簽里,并沒有使用單獨的函數(shù)來提供這個結(jié)果數(shù)量,因此對有單獨調(diào)用搜索結(jié)果數(shù)量的用戶來說,就有使用問題,這里提供二次開發(fā)的方法。
 
DedeCMS搜索頁調(diào)用搜索結(jié)果條數(shù)的實現(xiàn)方法
 
非常簡單只要修改幾個地方就行了:
 
第一步,打開/include/arc.searchview.class.php文件,查找代碼(大概在第525行):
 
 
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));
}
 
第二步,查找代碼(大概在第925行):
 
 
/** * 獲得當前的頁面文件的url * * @access public * @return string */
 
在其上面添加下面的這段代碼:
 
 
function GetItemsCountDM($list_len)
{
                global $oldkeyword;
                $pagenow = ($this->PageNo-1) * 10 + 1;
                $pagenows = $this->PageNo*10;//當結(jié)果超過限制時,重設結(jié)果頁數(shù)
                if($this->TotalResult > $this->SearchMaxRc)
                {
                                $totalpage = ceil($this->SearchMaxRc/$this->PageSize);
                }
                $plist .= $this->TotalResult;
                return $plist;
}
 
第三步,在搜索結(jié)果頁織夢模板里要顯示結(jié)果條數(shù)的地方通過如下標簽調(diào)用:
 
 
{dede:itemcount listsize='4'/}
 
這樣就可以實現(xiàn)搜索結(jié)果頁的搜索結(jié)果數(shù)量的單獨調(diào)用了。
 

上一篇:織夢ckeditor編輯器附件圖標不顯示的解決方法

欄    目:dedecms

下一篇:織夢后臺左側(cè)菜單空白不顯示的解決辦法

本文標題:織夢DedeCMS搜索頁調(diào)用搜索結(jié)果條數(shù)的實現(xiàn)方法

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

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關

隨機閱讀

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

如果侵犯了您的權利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

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

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