按照(zhào)小(xiǎo)時(shí)顯示更新數(shù)£π量
用(yòng)sql調用(yòng)
6小(xiǎo)時(shí):<?=$em↑✘pire->gettotal("selec♠λt count(*) as total ✘✔↓®from {$dbtbpre}ecms_表 where newλ↕φstime>UNIX_TIMESTAMP()-6*3600")∏€×?>
12小(xiǎo)時(shí):<?=β'€®$empire->gettotal("select count(*§→↓¶) as total from {$dbtbpre}ecms_×÷¥表 where newstime>UNIX_TIMES×←≤&TAMP()-12*3600")?>
24小(xiǎo)時(shí):<?=$empire-&♥↔gt;gettotal("select count(*) as t$±otal from {$dbtbpre}ec ms_表 where newstime>UNIX_TIMESTγ'♠≈AMP()-24*3600")?>
一(yī)個(gè)星期:<?=$empire->gettota βl("select count(*) as total fro' m {$dbtbpre}ecms_表 where newstime&gβ≥t;UNIX_TIMESTAMP()-86400*7")?>
一(yī)個(gè)月(yuè):<?=$e♦φ×mpire->gettotal("select couβ×★nt(*) as total from δ↓{$dbtbpre}ecms_表 where newstime>U≈©>©NIX_TIMESTAMP()-86400*30")?>₩₩₹;
靈動标簽調用(yòng)
6小(xiǎo)時(shí):[e:loop={'selec₽≥♦≈t count(*) as total from [!dδ ↓"b.pre!]ecms_表 where newstime>UNIX_T∏γπIMESTAMP()-6*3600',0,24,0}]<€∏?=$bqr[total]?>[/e:loop]
12小(xiǎo)時(shí):[e:loop={'select ± count(*) as total from [!db.pre!£←±✘]ecms_表 where newstime>UNIX_TIMESπσ>£TAMP()-12*3600',0,24β"→,0}]<?=$bqr[total]?>[/e:loop]
24小(xiǎo)時(shí):[e:l≥★oop={'select count(*) as total fφ¥rom [!db.pre!]ecms_表 whe ©re newstime>UNIX_TIMESTAMP()-24*↕∏¶λ3600',0,24,0}]<?=$bqr[total]?> δ;[/e:loop]
一(yī)個(gè)星期:[e:loop={'select cou∑<nt(*) as total from [!db.pre!]ecms_表 "£₩™where newstime>UNIβ&←≥X_TIMESTAMP()-86400*7',0,24,0}] ←φ<?=$bqr[total]?>[/eΩ→:loop]
一(yī)個(gè)月(yuè):[e:loop={'select coun©π✘εt(*) as total from [!d¶> b.pre!]ecms_表 where newstim¶φαe>UNIX_TIMESTAMP()-86400*30',σ✔§ 0,24,0}]<?=$bqr[totalδ≤•Ω]?>[/e:loop]
12*3600即12小(xiǎo)時(shí)
86400*7即7天
----------------------------& ∏-------------------------βδ-----------------------------
統計(jì)昨天發表的(de)文(wén)章(zhā$©∑ng)數(shù)量
<?php
$beginYesterday=mktime(0,0,0,da'λte('m'),date('d')-1,date('Y'));
$endYesterday=mktime(0,0,0,date(§™♣'m'),date('d'),date('Y♣→σ↑'))-1;
?>
[e:loop={"select count(*) as to₹≠tal from [!db.pre!]ecm✔s_news where newstime BETWEEN $beg↔♣γinYesterday and $endYesterday",1,24,β£↑0}]<?=$bqr[total]?>[/e:←₽loop] 篇 </li>
----------------------ε↓-------------------------------------✔≠×-----------------------
當前欄目本周更新:
<?=$empire->gettotal("s ∏↕elect count(*) as totalδ™λ from {$dbtbpre}ecms_news whe re classid='$GLOBALS[navclas sid]' and newstime &nbs€§↔p;>UNIX_TIMESTAMP()-86¥××400*7")?>
注釋:按欄目統計(jì)一(yī)周發布文(wén)章(zhāng)數(s > ₹hù) 加 classid='欄目id'&nλ♣bsp;
按當前欄目一(yī)周發布文(↓↓wén)章(zhāng)數(shù) 加 classid='$GLO₹±™BALS[navclassid]'
//php獲取今日(rì)開(kāi)始時(shí≈ )間(jiān)戳和(hé)結束時(shí)間(ji♥§€βān)戳
$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獲取昨日(rì)起始時(shí)₹ 間(jiān)戳和(hé)結束時(shí)間(jiān)戳 (≥&'$即:前一(yī)天)
$beginYesterday=mktime(0,0,0,dat∑π∏e('m'),date('d')-1,d₩≠≥≈ate('Y'));
$endYesterday=mktime(0,0,0,>₹date('m'),date('d'),date('Y'))-1;
//調取這(zhè)兩天(包括今天):(修改昨天)--date('dλ£×')-1:這(zhè)兩天 、date('d')-2:這(z♥✔>hè)三天、以此類推(注意:$beginYesterγ♦day、$endYesterday這(zhè)兩個(gè)未改動,還(h π↑$ái)是(shì)沿用(yòng)的(de)昨天的(de)名稱)
$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:前三天、以此類推(注意:$beginYesterdaα♥₩©y、$endYesterday這(zhè)兩個(gè)未改動,還(h↕••ái)是(shì)沿用(yòng)的(de)昨天的(d'®πe)名稱)
$beginYesterday=mktime(0,0,0,d ate('m'),date('d')-2,d✘&ate('Y'));
$endYesterday=mktime(0,0,0,date('m↕ '),date('d'),date('Y'))-1;
//php獲取上(shàng)周起始時(s∞₩♣hí)間(jiān)戳和(hé)結束時(shí✔©≠β)間(jiān)戳
$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獲取本周起始時(shí)間(jiān)戳和(hé)結束時→ε(shí)間(jiān)戳
$beginThisweek=mktime∞ ±'(0,0 ,0,date("m"),date("d" ∏ )-date("w")+1,date("Y"))"↔δ;
$endThisweek=mktime(23,5✘γ9,59,date("m"),date("d")-date("w")+7₽♠α☆,date("Y"));
//php獲取上(shàng)月(yuè)起始時(shí)間(jiān)✔ ₽戳和(hé)結束時(shí)間(jiān)戳
$beginLastmonth=mktime(∏0,0,0,date("m")-1,1,date("Y"))
$endLastmonth=mktime(23,59,59,da™>↑ te("m"),0,date("Y"))
//php獲取本月(yuè)起始時(shí©©)間(jiān)戳和(hé)結束時(shí)間(jiān)戳
$beginThismonth=mktime(0¥€★↔,0,0,date('m'),1,date('Y'));
$endThismonth=mktime(23,59,59±₹₽,date('m'),date('t'),dat<♥e('Y'))