Get the App
SLTechnology News&Howtos  ›  Servers  › 

DEDE 5.7the method of sorting the home page by weight

Shulou Source: shulou.com Published: 2022-06-02 04:59:47 10月02日 Update

DEDE 5.7 how to sort the home page by weight? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

DEDE 5.7How is the home page sorted by weight?

DEDE 5.7Home page [arclist] add sort by weight

1. Find the arclist.lib.php file in the following directory\ include\ taglib in the dream weaving system and open it.

Find it on lines 74 or 75:

/ / whether weight sorting is required for arclist. Default is "N". If sorting is required, set to "Y" $isweight = $ctag- > GetAtt ('isweight').

Change this line to:

$weight = $ctag- > GetAtt ('weight')

Find it at about line 327

/ / how documents are sorted $ordersql =''; if ($orderby=='hot' | | $orderby=='click') $ordersql = "ORDER BY arc.click $orderWay"; else if ($orderby==' sortrank' | | $orderby=='pubdate') $ordersql = "ORDER BY arc.sortrank $orderWay"; else if ($orderby==' id') $ordersql = "ORDER BY arc.id $orderWay"; else if ($orderby==' near') $ordersql = "ORDER BY ABS (arc.id -". $arcid. ")" Else if ($orderby = = 'lastpost') $ordersql = "ORDER BY arc.lastpost $orderWay"; else if ($orderby = =' scores') $ordersql = "ORDER BY arc.scores $orderWay"; else if ($orderby = = 'rand') $ordersql = "ORDER BY rand ()"; else $ordersql = "ORDER BY arc.sortrank $orderWay"

Modified to:

/ / how documents are sorted $ordersql =''; if ($orderby=='hot' | | $orderby=='click') $ordersql = "ORDER BY arc.click $orderWay"; else if ($orderby==' sortrank' | | $orderby=='pubdate') $ordersql = "ORDER BY arc.sortrank $orderWay"; else if ($orderby==' id') $ordersql = "ORDER BY arc.id $orderWay"; else if ($orderby==' near') $ordersql = "ORDER BY ABS (arc.id -". $arcid. ")" Else if ($orderby = = 'lastpost') $ordersql = "ORDER BY arc.lastpost $orderWay"; else if ($orderby = =' scores') $ordersql = "ORDER BY arc.scores $orderWay"; else if ($orderby = = 'rand') $ordersql = "ORDER BY rand ()"; else if ($orderby = =' weight') $ordersql = "orderby arc.weight $orderWay"; / / sort else $ordersql = "ORDER BY arc.sortrank $orderWay" by weight if there are no specific settings

Now that OK has saved this document, we can sort it on the home page using orderby='weight'.

Thank you for reading! After reading the above, do you have a general understanding of the method of sorting the home page of DEDE 5.7by weight? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Tags: Sorting weight home page content document method article method question document more directory look system industry information information channel channel reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno NVidia Redmi Huawei