花魁直播高品质美女在线视频互动社区 - 花魁直播官方版

 歡迎來(lái)到素材無(wú)憂(yōu)網(wǎng),按 + 收藏我們
登錄 注冊(cè) 退出 找回密碼

帝國(guó)CMS靈動(dòng)標(biāo)簽按照點(diǎn)擊數(shù)實(shí)現(xiàn)天、周、月排行榜調(diào)用

時(shí)間: 2024-02-25 09:30 閱讀: 作者:素材無(wú)憂(yōu)網(wǎng)

方法1、
顯示一周內(nèi)信息點(diǎn)擊排行
[e:loop={"select * from {$dbtbpre}ecms_news where FROM_UNIXTIME(newstime)>SUBDATE(NOW(),INTERVAL 7 DAY) order by onclick desc limit 10",0,24,0}]


[/e:loop]

或者

[e:loop={"select * from {$dbtbpre}ecms_news where newstime>UNIX_TIMESTAMP()-86400*7 order by onclick desc limit 10",0,24,0}]


[/e:loop]



[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}]


[/e:loop]


newstime:文章發(fā)布時(shí)間
其中86400*7中的7表示天,如果是月就是30 年就是365


其排列方式:文章發(fā)布時(shí)間起統(tǒng)計(jì)

今天(24小時(shí)):newstime>UNIX_TIMESTAMP()-86400*1 必須是今天發(fā)布的文章
一周:newstime>UNIX_TIMESTAMP()-86400*7 必須是一周內(nèi)發(fā)布的文章


舉例:

昨天:

$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 * from [!db.pre!]ecms_news where newstime BETWEEN $beginYesterday and $endYesterday order by onclick desc limit 10",0,24,0}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]

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

今天:

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*1','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]

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

一周:

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]

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

一月:

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*30','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]


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

三月:

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*90','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]


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

一年:

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*365','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]

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

全部:

[e:loop={'news',10,18,0,'','onclick desc'}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]



方法2、

昨天:
$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 * from [!db.pre!]ecms_news where newstime BETWEEN $beginYesterday and $endYesterday order by onclick desc limit 10",0,24,0}]
標(biāo)題:---點(diǎn)擊:

[/e:loop]

注釋?zhuān)?br />
//php獲取今日開(kāi)始時(shí)間戳和結(jié)束時(shí)間戳
$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獲取昨日起始時(shí)間戳和結(jié)束時(shí)間戳 (即:前一天)
$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;

//調(diào)取這兩天(包括今天):(修改昨天)--date('d')-1:這兩天 、date('d')-2:這三天、以此類(lèi)推(注意:$beginYesterday、$endYesterday這兩個(gè)未改動(dòng),還是沿用的昨天的名稱(chēng))
$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;

//調(diào)取前兩天(修改昨天)--date('d')-2:前兩天 、date('d')-3:前三天、以此類(lèi)推(注意:$beginYesterday、$endYesterday這兩個(gè)未改動(dòng),還是沿用的昨天的名稱(chēng))
$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獲取上周起始時(shí)間戳和結(jié)束時(shí)間戳
$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é)束時(shí)間戳
$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獲取上月起始時(shí)間戳和結(jié)束時(shí)間戳
$beginLastmonth=mktime(0,0,0,date("m")-1,1,date("Y"))
$endLastmonth=mktime(23,59,59,date("m"),0,date("Y"))

//php獲取本月起始時(shí)間戳和結(jié)束時(shí)間戳
$beginThismonth=mktime(0,0,0,date('m'),1,date('Y'));
$endThismonth=mktime(23,59,59,date('m'),date('t'),date('Y'))

版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!

轉(zhuǎn)載請(qǐng)注明: 帝國(guó)CMS靈動(dòng)標(biāo)簽按照點(diǎn)擊數(shù)實(shí)現(xiàn)天、周、月排行榜調(diào)用

相關(guān)文章
模板推薦