您现在的位置是:首页 > 网站制作心得 > 网站建设教程 > 文章正文 网站建设教程

PHPCMS V9 按浏览次数排行调用文章

酒醉疯子个人网站 2019-07-21 14:31:54 网站建设教程 人已围观

简介phpcms搭建企业站的时候,经常会出现根据文章浏览次数进行调用,调用某一篇文章浏览次数较多的文章,这样小白就看不懂代码了,今天酒醉疯子就带领搭建一起探讨phpcms如何根据文章浏览次数进行调用。

  频道总排行调用方法
  1. <div class=”box”> 
  2. <h5 class=”title-2″>频道总排行h5> 
  3.     {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″} 
  4.         <ul class=”content digg”> 
  5.             {loop $data $r} 
  6.                 <li> <a href=”{$r[url]}” title=”{$r[title]}”  target=”_blank”>{str_cut($r[title],36,’…’)}a>li> 
  7.             {/loop} 
  8.         ul> 
  9.     {/pc} 
  10. div> 
  频道月排行调用方法
  1. <div class=”box”> 
  2. <h5 class=”title-2″>频道本月排行h5> 
  3.     {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″} 
  4.         <ul class=”content rank”> 
  5.             {loop $data $r} 
  6.                 <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> 
  7.             {/loop} 
  8.         ul> 
  9.     {/pc} 
  10. div> 


万晓博SEO推荐服务器:

https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=zx866zjo

相关文章

文章评论

站点信息

  • 建站时间:2019年3月25日
  • 网站程序:PHPCMS V9.6 UTF-8
  • 建站流程分享新手建站流程
  • 博客模板:《今夕何夕》
  • 文章统计20 篇文章
  • 标签管理标签云
  • 统计数据百度统计
  • 网站地图网站地图
  • 微信公众号:扫描二维码,关注我们

打赏本站

  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!
  • 微信扫码:你说多少就多少~
  • 支付宝扫码:你说多少就多少~

客服在线

服务时间

周一至周日 9:00-21:00