频道总排行调用方法
<div class=”box”>
<h5 class=”title-2″>频道总排行</h5>
{pc:get sql=”select a.id,a.title,a.url,a.catid,b.hitsid,b.views from v9_news a left join v9_hits b on a.id=substring(b.hitsid,5) where a.catid in ($arrchildid) order by b.views desc” num=”10″ cache=”3600″}
<ul class=”content digg”>
{loop $data $r}
<li> <a href=”{$r[url]}” title=”{$r[title]}” target=”_blank”>{str_cut($r[title],36,’…’)}</a></li>
{/loop}
</ul>
{/pc}
</div>
频道月排行调用方法
<div class=”box”>
<h5 class=”title-2″>频道本月排行</h5>
{pc:get sql=”select a.id,a.title,a.url,a.catid,b.hitsid,b.views from v9_news a left join v9_hits b on a.id=substring(b.hitsid,5) where a.catid in ($arrchildid) order by b.monthviews desc” num=”8″ cache=”3600″}
<ul class=”content rank”>
{loop $data $r}
<li><span>{number_format($r[views])}</span><a href=”{$r[url]}”{title_style($r[style])} class=”title” title=”{$r[title]}”>{str_cut($r[title],56,’…’)}</a></li>
{/loop}
</ul>
{/pc}
</div>