Modification method DedeCMS thematic content page article sorting node

In the website featured content page node sorted default are in accordance with the chronological arrangement of the update, sort of way is descending, when calling the thematic content of the page content label is called {dede: field.note /}, you want to modify Sort method calls are also possible. Pursuing a dream dede thematic content page node sort of modification method:

1, {dede: field.note} is actually {dede: arclist} {/ dede: arclist} lib_arclistDone to resolve the tag, it is possible to control and order orderby ordering method, the document is orderby sort, order descending or ascending order.

 

2, open dede / spec_add.php and dede / spec_edit.php, were found in both the code file:

  1. $notelist .= "{dede:specnote imgheight=\'$imgheight\' imgwidth=\'$imgwidth\'
  2. infolen = \ $ infolen \ 'titlelen = \ $ titlelen \' col = \ $ col \ 'idlist = \ $ okids \'
  3. name=\'$notename\' noteid=\'$noteid\' isauto='$isauto' rownum=\'$rownum\'
  4. keywords=\'$keywords\' typeid=\'$typeid\'}

2 files inside this piece of content is the same, in typeid = \ '$ typeid \' behind adding:

  1. order=\'asc\'

Note: order front has spaces.

3, open the include / taglib / channel / specialtopic.lib.php, find the code:

  1. $ctag->GetAtt('att')

In its behind adding:

  1. ,$ctag->GetAtt('order')

4, line 51 specialtopic.lib.php find the default can be changed id.

After modifying the above documents, upload cover, and then generate thematic page, you can see article has been ranked in ascending order by ID!

Guess you like

Origin www.cnblogs.com/fgghghhg/p/12010260.html