PHPCMS V9 首页调用最新、热门文章

必力  2018-03-19   5685


首页调用最新文章:

{pc:get sql="SELECT * FROM `v9_news` Order by id DESC " num="10"}
{loop $data $r}
<li>·<a href="{$r[url]}" target="_blank">{str_cut(strip_tags($r[title]),33)}</a></li>
{/loop}
{/pc}

首页调用热门文章:

{pc:content action="hits" catid="$r[catid]" num="10" order="views DESC" cache="3600"}
{loop $data $r}
<li>·<a href="{$r[url]}" title="{$r[title]}" target="_blank">{str_cut(strip_tags($r[title]),33)}</a></li>
{/loop}
{/pc}


PHPCMS 热门 文章