Dedecms solution for the last article-sort by release time (pubdate)

Source: Internet
Author: User
Modify Dede/include/inc_archives_view.php

The bottom two rows are original. Note out and add the added sections. If you want to sort documents by pubdate during document management, modify the content_list.htm and content_list.php documents.

// Add by Sha Jia Jun 361_1
$ Des_arc = $ this-> dsql-> getone ("select arc. pubdate from '{$ this-> maintable} 'arc where arc. ID =' $ aid '");
$ Des_pubdate = $ des_arc ['pubdate'];
$ Next = "arc. pubdate> '$ des_pubdate' and arc. arcrank>-1 and typeid = '{$ this-> fields ['typeid']}' order by arc. pubdate ASC ";
$ Pre = "arc. pubdate <'$ des_pubdate' and arc. arcrank>-1 and typeid = '{$ this-> fields ['typeid']}' order by arc. pubdate DESC ";
// End add

// $ next = "arc. id> '$ aid' and arc. arcrank>-1 and typeid = '{$ this-> fields ['typeid']}' order by arc. id ASC ";
// $ pre =" arc. ID <'$ aid' and arc. arcrank>-1 and typeid = '{$ this-> fields ['typeid']}' order by arc. id DESC ";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.