Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the dedecms search page call the number of search results separately

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how the dedecms search page invokes the number of search results individually. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How does the dedecms search page call the number of search results separately?

The number of search results in DEDE is integrated into the list paging tab, and there is no separate function to provide this number of results, so there is a problem for users who have a separate number of search results to call, and here is a method for secondary development.

It's very simple, just change a few things:

The first step is to open the / include/arc.searchview.class.php file and look for the code (about line 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));}

Add the code below:

Else if ($tagname== "itemcount") {$list_len= trim ($ctag- > GetAtt ("listsize")); if ($list_len== ") {$list_len= 3;} $this- > dtp- > Assign ($tagid,$this- > GetItemsCountDM ($list_len));}

The second step is to find the code (about line 925):

/ * get the url * * @ access public * @ return string * / of the current page file

Add the following code to it:

Function GetItemsCountDM ($list_len) {global $oldkeyword; $pagenow = ($this- > PageNo-1) * 10 + 1; $pagenows = $this- > PageNo*10; / / when the result exceeds the limit, reset the result pages if ($this- > TotalResult > $this- > SearchMaxRc) {$totalpage = ceil ($this- > SearchMaxRc/$this- > PageSize);} $plist. = $this- > TotalResult; return $plist;}

The third step is to call the following tag where you want to display the number of results in the search results page template:

{dede:itemcount listsize='4'/}

This allows individual calls to the number of search results for the search results page.

Thank you for reading! On the dedecms search page how to call the search results to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report