A-A+

phpcms v9 列表页面取得文章点击量及评论数量

2013年12月16日 PHP开源系统 暂无评论 阅读 213 views 次
{pc:content action="lists" catid="$catid" num="10" moreinfo="1" order="id DESC" page="$page"} 
        <!-- <div class='videoImg'><a href="{$r&#91;url&#93;}" target='_blank'><img  rel='nofollow' src="{$r&#91;thumb&#93;}" border='0' class='preimg120' alt="{$r&#91;title&#93;}" name='preimg' /></a></div> --> 
        <ul class="list lh24 f14"> 
        {loop $data $r} 
        {php $db = pc_base::load_model('hits_model');   $_r = $db->get_one(array('hitsid'=>'c-'.$modelid.'-'.$r[id])); $views = $_r213 views; } 
        {php $comment_tag = pc_base::load_app_class("comment_tag", "comment"); $comment_total = $comment_tag->count(array('commentid'=>'content_'.$catid.'-'.$r[id].'-'.$modelid));} 
        <li><span class="rt">阅读:{$views} | 评论:{if $comment_total}{$comment_total}    {else}0{/if}</span>[{date('Y-m-d',$r[inputtime])}]<a href="{$r&#91;url&#93;}" target="_blank"{title_style($r&#91;style&#93;)}>{$r[title]}</a></li> 
        {if $n%5 ==0}<li class="bk20 hr"></li>{/if}  
        {/loop} 
        </ul> 
{/pc}
标签:

给我留言