一起源码网

  • QingYuanMa.com
  • 全球最大的互联网技术和资源下载平台
搜索
一起源码网 门户 织梦CMS 查看主题

织梦搜索页面搜索结果总数调用方法

发布者: 5900352 | 发布时间: 2018-3-10 18:38| 查看数: 4919| 评论数: 1|帖子模式

由于dedecms原生不支持搜索页面结 果总数的调用,所以得自己修改文件来支持了。搜索页面调用的代码全在/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));
}
第二步:在
/**
*  获得当前的页面文件的url
*
* @access    public
* @return    string
*/
前面添加下面代码:
//————   
//搜索输出总量   
//————   
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'/} 即可

最新评论

风向决定发型d 发表于 2022-5-27 09:27
小储云源码下载站

浏览过的版块

轻源码让程序更轻更快

QingYuanMa.com

工作时间 周一至周六 8:00-17:30

侵权处理

客服QQ点击咨询

关注抖音号

定期抽VIP

Copyright © 2016-2021 https://www.171739.xyz/ 滇ICP备13200218号

快速回复 返回顶部 返回列表