最新评论组件制作

  1. <php>$last_comments=sp_get_comments("field:*;limit:0,5;order:createtime desc;");</php>
  2. <foreach name="last_comments" item="vo">
  3. <div class="comment-ranking-inner">
  4. <i class="fa fa-comment"></i>
  5. <a href="{:U('user/index/index',array('id'=>$vo['uid']))}">{$vo.full_name}:</a>
  6. <span>{$vo.content}</span>
  7. <a href="__ROOT__/{$vo.url}#comment{$vo.id}">查看原文</a>
  8. <span class="comment-time">{:date('m月d日 H:i',strtotime($vo['createtime']))}
  9. </span>
  10. </div>
  11. </foreach>