Home page >> Related Tutorials >>Body

ZBLOG calls the latest article, the hottest article, the most comments, and the tutorial is for reference only

Author: A little Jack    Time: 2023-05-07 13:55:22    Browse: 591   

ZBLOG calls the latest articles, the most popular articles, the most commented tutorials, for reference only. The following case codes call 10 articles, and the rest are self modified. The code is very poor, and it is OK to use it.

Call the latest article:

 {foreach GetList(10) as $newlist} <li><span>{$newlist.Time('m-d')}</span><a href="{$newlist.Url}" title="{$newlist.Title}">{$newlist.Title}</a></li> {/foreach}

Call the hottest articles:

 {php} $order = array('log_ViewNums'=>'DESC'); $where = array(array('=','log_Status','0')); $array = $zbp->GetArticleList(array('*'),$where,$order,array(10),''); {/php} {foreach $array as $hotlist} <li><span>{$hotlist.ViewNums}℃</span><a href="{$hotlist.Url}" title="{$hotlist.Title}">{$hotlist.Title}</a></li> {/foreach}

Call the most comment articles:

 {php} $order = array('log_CommNums'=>'DESC'); $where = array(array('=','log_Status','0')); $array = $zbp->GetArticleList(array('*'),$where,$order,array(10),''); {/php} {foreach $array as $hotlist} <li><span>{$hotlist. CommNums} Comments</span><a href="{$hotlist. Url}" title="{$hotlist. Title}">{$hotlist. Title}</a></li> {/foreach}

Text label: ZBLOG   Latest articles   The hottest article   Most commented articles  
 A little Jack

A little Jack https://lkba.cn

The blogger focuses on Z-Blog website construction, website optimization, computer troubleshooting, reinstallation, optimization, maintenance system, etc., QQ/WX: 2126245521 (please specify the purpose)

Related articles

Previous:

Next:

No comment for this article - Welcome

 Please fill in the verification code

Processed : 0.051 SQL : 14