zblogphp调用最新文章 最热文章 最多评论的方法

风中赏雪 Zblog Zblog 2025-09-27 140 0

调用最新发布的10篇文章:


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

调用点击最多的10篇文章:


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

调用评论最多的10篇文章:


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