In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the unweaving dream dedecms using weight sorting invalid method, the article introduces in great detail, has a certain reference value, interested friends must read it!
What if dream-weaving dedecms uses invalid weight sorting?
In this paper, an example is given to illustrate the solution to the invalid sorting of dream weaving dedecms using weight. Share it with you for your reference. The specific methods are as follows:
Recommended study: dream weaving cms
Dedecms5.7 has bug for weight sorting, so here's a step-by-step way to show you how to solve the problem of invalid weight.
The file involved is the includetaglibarclist.lib.php file, around line 570:
The code is as follows:
If ($isweight=='y')
This line of code is nothing but useless.
The code is as follows:
$orderWeight = list_sort_by ($orderWeight,'weight', 'asc')
Sorting the results is problematic because before getting this $orderWeight, the statement to retrieve the document table is:
The code is as follows:
SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_ archives` arc LEFT JOIN `dede_ arctype` tp ON arc.typeid=tp.id WHERE arc.typeid IN (29) AND arc.arcrank >-1 ORDER BY arc.sortrank DESC
Obviously, when we write the label, we write:
The code is as follows:
{dede:arclist orderby='weight' typeid='29' isweight='y' limit='4,1' titlelen='100' infolen='100'}
The original intention is that the data is sorted by weight, while the processor is the database retrieved by sortrank, and the specified isweight='y' only serves to sort the retrieved dataset according to weight.
So the solution is very simple: add a processing statement sorted by weight at line 330 of the program file:
The code is as follows:
Else if ($orderby = = 'weight') $ordersql = "orderby arc.weight asc"
Let's separate another one so that the list tag supports weight sorting:
The code is as follows:
{dede:list pagesize='10' titlelen='50' orderby='weight'}? [field:textlink/] {/ dede:list}
Solution:
1. Open the file arc.listview.class.php
2. Find
The code is as follows:
Else if ($orderby== "lastpost") {
Statement, approximately at line 609, press enter before this line and insert the following statement:
The code is as follows:
Else if ($orderby== "weight") {$ordersql = "orderby arc.weight $orderWay";}
3. Continue to search
The code is as follows
If (ereg ('hot | click | lastpost',$orderby))
Statement, modified to:
The code is as follows:
If (ereg ('hot | click | weight | lastpost',$orderby))
After the modification is completed, save it. If weight sorting has been used in the target, generate it, and you can see that weight sorting has been installed in the document list.
4. Template call:
The code is as follows:
{dede:arclist row='10' titlelen='50' orderby='weight'}? [field:textlink/] {/ dede:arclist} above is all the content of the unweaving dream dedecms using the invalid method of weight sorting, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.