Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

织梦搜索结果页调用总搜索条数的教程

dedecms教程:织梦教程dedecms搜索结果页调用总搜索条数的教程!要实现织梦dedecms搜索结果页调用总搜索条数,需修改代码,打开根目录下/include/arc.searchview.class.php

dedecms教程:织梦教程dedecms搜索结果页调用总搜索条数的教程!要实现织梦dedecms搜索结果页调用总搜索条数,需修改代码,打开根目录下/include/arc.searchview.class.php

第一步、找到大概第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));
}

第二步、继续找到大概935行:

/**
 *  获得当前的页面文件的url
 *
 * @access    public
 * @return    string
 */
在这句代码的上面添加以下代码:
 
 
//————  
//搜索输出总量www.dhaomu.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'/}

即可调用

温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

PbootCMS模板网站首页如何调用指定栏目的子栏目

2021-12-29 0:00:00

编程技巧

Shell命令使用awk删除重复的行

2022-1-21 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索