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

之前zblogphp1.3时代用的是挂接口方式实现的,没想到zblogphp1.4来了全挂了。Σ( ° △ °|||)︴晚上半夜把所有挂了的主题修复了,然后就把这个代码共享出来吧,希望能帮助到有需要的人。

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

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

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

{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}

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

{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}评论</span> <a href="{$hotlist.Url}" title="{$hotlist.Title}">{$hotlist.Title}</a></li> {/foreach}

ps:代码不是很好,不过能用...

猜你喜欢

转载自www.cnblogs.com/bianfengwei/p/11635038.html