热门文章组件制作

热门文章

  1. <!--获取最热的5条文章-->
  2. <php>$hot_articles=sp_sql_posts("cid:$portal_index_lastnews;field:post_title,post_excerpt,object_id,term_id,smeta;order:post_hits desc;limit:5;"); </php>
  3. <ul class="unstyled">
  4. <foreach name="hot_articles" item="vo">
  5. <php>$top=$key<3?"top3":"";</php>
  6. <li class="{$top}">
  7. <i>{$key+1}</i>
  8. <a title="{$vo.post_title}" href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">{$vo.post_title}</a></li>
  9. </foreach>
  10. </ul>