网站的最新发布文章、评论最多的文章、浏览或点击率最高的文章、置顶文章是常调用在首页,侧边栏。
能增强浏览友好度,这几段代码很多站长都喜欢用。
调用最新发布的10篇文章:{foreachGetList(10)as$newlist}
{$newlist.Time('m-d')}{$newlist.Title}
{/foreach}
调用点击最多的10篇文章:{php}
$order=array('log_ViewNums'=>'DESC');
$where=array(array('=','log_Status','0'));
$array=$zbp->GetArticleList(array('*'),$where,$order,array(10),'');
{/php}
{foreach$arrayas$hotlist}
{$hotlist.ViewNums}{$hotlist.Title}
{/foreach}
调用评论最多的10篇文章:{php}
$order=array('log_CommNums'=>'DESC');
$where=array(array('=','log_Status','0'));
$array=$zbp->GetArticleList(array('*'),$where,$order,array(10),'');
{/php}
{foreach$arrayas$hotlist}
{$mNums}评论{$hotlist.Title}
{/foreach}
调用置顶文章:{$topArray=GetList(10,null,null,null,null,null,array("only_ontop"=>true));}
{foreach$topArrayas$top}
{$top.Title}
{/foreach}
以上代码都可按自己的要求进行调整修改。
七片枫叶 | Z-BLOG | 3423 | 0 | -02-25