最新公告
  • 欢迎您光临站壳网,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境!立即加入我们
  • 织梦CMS搜索页面搜索结果总数调用办法

    详解dedecms搜索页面单独调用搜索结果条数的实现方法,织梦DedeCMS搜索页调用搜索结果条数的实现方法,织梦CMS搜索页面搜索结果总数调用办法,织梦搜索结果页单独调用搜索结果条数的方法,下面小编来给大家介绍一下,一起来了解一下吧!

    由于织梦CMS原生不支持搜索页面结 果总数的调用,所以得自己修改文件来支持了。
     
    搜索页面调用的代码全在/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′/} 即可 。
     

    更多教程关注FF推源码网。

    • 18785会员总数(位)
    • 5454资源总数(个)
    • 98本周发布(个)
    • 15 今日发布(个)
    • 1507稳定运行(天)

    提供最优质的资源集合

    立即查看 了解详情