{

$list_len=trim($ctag->GetAtt("lis" />

"景先生毕设|www.jxszl.com

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

2022-10-29 16:27编辑: www.jxszl.com景先生毕设
由于织梦CMS原生不支持搜索页面结果总数的调用,所以得自己修改文件来支持了.

搜索页面调用的代码全在/include/arc.searchview.class.php里,我们先打开/include/arc.searchview.class.php文件,然后按下面步骤修改文件.

 更多精彩就在: 51免费论文网|www.jxszl.com 
/>
第I.步:在

elseif($tagname=="pagelist")

{

$list_len=trim($ctag->GetAtt("listsize"));

if($list_len=="")

{

$list_len=III;

}

$this->dtp->Assign($tagid,$this->GetPageListDM($list_len));

}

下面添加:

elseif($tagname=="itemcount")

{

$list_len=trim($ctag->GetAtt("listsize"));

if($list_len=="")

{

$list_len=III;

}

$this->dtp->Assign($tagid,$this->GetItemsCountDM($list_len));

}

第II步:在

/**

*获得当前的页面文件的url

*

*@accesspublic

*@returnstring

*/

前面添加下面代码:

//__

//搜索输出总量

//__

functionGetItemsCountDM($list_len)

{

global$oldkeyword;

$pagenow=($this->PageNo-I.)*I.0+I.;

$pagenows=$this->PageNo*I.0;//当结果超过限制时,重设结果页数

if($this->TotalResult>$this->SearchMaxRc)

{

$totalpage=ceil($this->SearchMaxRc/$this->PageSize);

}

$plist.=$this->TotalResult;

return$plist;

}

第III步:

在要显示的地方加入

{dede:itemcountlistsize=’IV′/}即可.


原文链接:http://www.jxszl.com/biancheng/dedecms/74897.html