栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

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

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

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

效果演示

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

在这句代码的上面添加以下代码:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 //————   //搜索输出总量www.dede58.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'/} 即可调用


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/8130.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号