Current location: home page > course >Body

Modify the sorting of ZBlog1.7 article list, which can be sorted according to the update time (views, comments, popularity, id, author, etc.)

There are always various needs in website construction. For example, recently I need to sort the website article list of a ZB program by the update time.

ZBLOG It provides rich interfaces for webmasters to personalize, so it is easy to reorder articles.

The specific operation process is as follows:

Hanging interface:

 Add_Filter_Plugin('Filter_Plugin_LargeData_Article','Jz52_xxx');

Function Body:

 function Jz52_xxx(&$select,&$where,&$order,&$limit,&$option){          global $zbp;            $order = array('log_UpdateTime' => 'DESC');// Descending by update time }

The log_UpdateTime can be replaced by:

 Log_PostTime//According to the publishing time Log_UpdateTime//According to the update time Log_CommNums//According to the number of comments Log_ViewNums//By the number of views Log_ID//According to ID Log_CateID//According to the classification ID Log_AuthorID//According to the author ID

DESC can be replaced by:

 DESC//Descending ASC//Ascending

Problem solving.

 Modify the sorting of ZBlog1.7 article list. The first page can be sorted according to the update time (views, comments, popularity, id, author, etc.)