帝国CMS文章数统计,帝国CMS按小时发布文章数的统计
YLM
2021-10-21 14:14:45
【收藏】
浏览
【加QQ群620332298】
编号:2021102111272
简介帝国CMS文章数统计,帝国CMS按小时发布文章数的统计"
按照小时显示更新数量
用sql调用
6小时:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_表 where newstime>UNIX_TIMESTAMP()-6*3600")?>
12小时:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_表 where newstime>UNIX_TIMESTAMP()-12*3600")?>
24小时:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_表 where newstime>UNIX_TIMESTAMP()-24*3600")?>
一个星期:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_表 where newstime>UNIX_TIMESTAMP()-86400*7")?>
一个月:<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_表 where newstime>UNIX_TIMESTAMP()-86400*30")?>
灵动标签调用
6小时:[e:loop={'select count(*) as total from [!db.pre!]ecms_表 where newstime>UNIX_TIMESTAMP()-6*3600',0,24,0}]<?=$bqr[total]?>[/e:loop]
12小时:[e:loop={'select count(*) as total from [!db.pre!]ecms_表 where newstime>UNIX_TIMESTAMP()-12*3600',0,24,0}]<?=$bqr[total]?>[/e:loop]
24小时:[e:loop={'select count(*) as total from [!db.pre!]ecms_表 where newstime>UNIX_TIMESTAMP()-24*3600',0,24,0}]<?=$bqr[total]?>[/e:loop]
一个星期:[e:loop={'select count(*) as total from [!db.pre!]ecms_表 where newstime>UNIX_TIMESTAMP()-86400*7',0,24,0}]<?=$bqr[total]?>[/e:loop]
一个月:[e:loop={'select count(*) as total from [!db.pre!]ecms_表 where newstime>UNIX_TIMESTAMP()-86400*30',0,24,0}]<?=$bqr[total]?>[/e:loop]
12*3600即12小时
86400*7即7天
----------------------------------------------------------------------------------
统计昨天发表的文章数量
<?php
$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
?>
[e:loop={"select count(*) as total from [!db.pre!]ecms_news where newstime BETWEEN $beginYesterday and $endYesterday",1,24,0}]<?=$bqr[total]?>[/e:loop] 篇 </li>
----------------------------------------------------------------------------------
当前栏目本周更新:
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news where classid='$GLOBALS[navclassid]' and newstime >UNIX_TIMESTAMP()-86400*7")?>
注释:按栏目统计一周发布文章数 加 classid='栏目id'
按当前栏目一周发布文章数 加 classid='$GLOBALS[navclassid]'
//php获取今日开始时间戳和结束时间戳
$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
$endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
//php获取昨日起始时间戳和结束时间戳 (即:前一天)
$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
//调取这两天(包括今天):(修改昨天)--date('d')-1:这两天 、date('d')-2:这三天、以此类推(注意:$beginYesterday、$endYesterday这两个未改动,还是沿用的昨天的名称)
$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
$endYesterday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
//调取前两天(修改昨天)--date('d')-2:前两天 、date('d')-3:前三天、以此类推(注意:$beginYesterday、$endYesterday这两个未改动,还是沿用的昨天的名称)
$beginYesterday=mktime(0,0,0,date('m'),date('d')-2,date('Y'));
$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
//php获取上周起始时间戳和结束时间戳
$beginLastweek=mktime(0,0,0,date('m'),date('d')-date('w')+1-7,date('Y'));
$endLastweek=mktime(23,59,59,date('m'),date('d')-date('w')+7-7,date('Y'));
//php获取本周起始时间戳和结束时间戳
$beginThisweek=mktime(0,0 ,0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek=mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
//php获取上月起始时间戳和结束时间戳
$beginLastmonth=mktime(0,0,0,date("m")-1,1,date("Y"))
$endLastmonth=mktime(23,59,59,date("m"),0,date("Y"))
//php获取本月起始时间戳和结束时间戳
$beginThismonth=mktime(0,0,0,date('m'),1,date('Y'));
$endThismonth=mktime(23,59,59,date('m'),date('t'),date('Y'))
很赞哦!()
- 帝国cms按照文章id调用单个文章的使用方法
- 帝国cms多值字段内容页调用方法可分开调用
- 帝国cms统计显示没有标题图片的文章栏目id 以及文章id及数量
- 帝国cms内容页上一篇下一篇的用法总结大全
- 帝国CMS7.5首页列表内容页调用TAG详解
- 帝国cms首页灵动标签调用多图单独无图显示,帝国cms首页灵动标签调用判断文章多少个图多来展示
- 帝国CMS7.5登录后才能查看信息内容,如果未登录自动提示登录后查看
- 帝国cms统计某个数据表里有多少文章,帝国cms如何实现统计某个数据表里有多少文章
- 帝国CMS文章数统计,帝国CMS按小时发布文章数的统计
- 帝国cms列表内容多图单独无图显示,帝国cms列表判断文章多少个图多来展示

-
防168开奖(1)
有一部分接口大多都是自己服务器省的成的(1)
自己开发的彩票开奖系统(1)
A1579【全民养狗运营版】陀螺国际AP(1)
A1731GEC挖矿区块挖矿机系统+UI(1)
新版两融双融3.0新股申购股票交易股票配(1)
A1176PHPBTC合约余额宝理财化钱(1)
A1235仿火币模式交易所源码+VUE源(1)
A1346二开GFCH5伪微交易理财盘最(1)
A1531学习培训专用型5G投资理财产品(1)
A1362二开投资理财股票基金源码支持公(1)
A1414战机舰艇全新UI区块链投资源码(1)
A1467猫力币区块链多币种量化钱包+新(1)
A1488基金定投源码-理财程序数字币货(1)
A1513华夏基金理财程序独一无二的功能(1)
JI卫云域名防红防封系统最新版源码免授权(1)
wordpress网址导航主题模板自适应(1)
帝国cms按照文章id调用单个文章的使用(1)
领峰国际白色简洁微盘交易微盘二开K线完美(1)
EMC区块链交易S挖矿安全透明化交易平台(1)
- 文章统计:373条
- QQ 群:扫描加入,开通会员
