DEDE的搜索結果數量都集成在了列表分頁標簽里,并沒有使用單獨的函數來提供這個結果數量,因此對有單獨調用搜索結果數量的用戶來說,就有使用問題,這里提供二次開發的方法。
非常簡單只要修改幾個地方就行了:
第一步,打開/include/arc.searchview.class.php文件,查找代碼(大概在第525行):
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));} |
第二步,查找代碼(大概在第925行):
/** * 獲得當前的頁面文件的url * * @access public * @return string */
在其上面添加下面的這段代碼:
|
第三步,在搜索結果頁模板里要顯示結果條數的地方通過如下標簽調用:
{dede:itemcount listsize='4'/}
這樣就可以實現搜索結果頁的搜索結果數量的單獨調用了。
else if($tagname=="itemcount"){$list_len = trim($ctag->GetAtt("listsize"));if($list_len==""){$list_len = 3;}$this->dtp->Assign($tagid,$this->GetItemsCountDM($list_len));} |
新聞熱點
疑難解答