Phpcms V9 调用随机文章的方法
指定ID调用
{pc:content action="lists" catid="$catid" num="8" order="rand()" return="info"}
<ul class="list lh24 f13">
{loop $info $v}
<li><a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{$v['title']}</a></li>
{/loop}
</ul>
{/pc}
以数据表形式调用
{pc:get sql="select * from v9_news order by rand()" num="9"}
{loop $data $r}
<li>·<a href="{$r[url]}" target="_blank">{$r[title]}</a></li>
{/loop}
{/pc}
{pc:content action="lists" catid="$catid" num="8" order="rand()" return="info"}
<ul class="list lh24 f13">
{loop $info $v}
<li><a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{$v['title']}</a></li>
{/loop}
</ul>
{/pc}
以数据表形式调用
{pc:get sql="select * from v9_news order by rand()" num="9"}
{loop $data $r}
<li>·<a href="{$r[url]}" target="_blank">{$r[title]}</a></li>
{/loop}
{/pc}