zblogphp call Latest articles Most commented articles hottest method

Before zblogphp1.3 era is achieved by hanging interface mode, did not think zblogphp1.4 to the whole hung up. Σ (° △ ° |||) ︴ middle of the night all night hung up the theme of restoration, and then put this code-share out of it, hoping to help people in need.

Invoke article 10 of the latest release:

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

Click to call up 10 article:

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

Most Commented invoked article 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: the code is not very good, but can ...

Guess you like

Origin www.cnblogs.com/bianfengwei/p/11635038.html