一个月: ?=$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]

二十四小时:[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即七天

----------------------------------------------------------------------------------

统计分析昨日发布的文章内容总数

?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这2个未修改,還是延用的昨日的名字)

$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这2个未修改,還是延用的昨日的名字)

$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按钟头公布文章内容数的统计分析(详尽

一个月: ?=$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_TIMES


预约挂号



扫描二维码分享到微信