国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 帝國Empire > 正文

帝國CMS二次開發調用一周之內的信息

2024-08-28 12:26:41
字體:
來源:轉載
供稿:網友

調用一周之內的信息,如果本周內某天沒有發布信息,調用上周的信息:

帝國CMS二次開發調用一周之內的信息

最終效果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
//生成一個7天的數組
$datearr=array(1,2,3,4,5,6,0);
$asno=1;
foreach($datearr as $v)
{
echo '<dd id="week'.$asno.'">'.ret_info(ret_date($v)).'</dd>';
//echo '<li>'.date('Y-m-d',ret_date($v)).'</li>';
$asno++;
}
//返回日期的時間戳
function ret_date($val)
{
//今天是星期中的第幾天
$this_xingqi=date('w',time());
$no=0;
//如果參數大于幾天那么就相減
while($this_xingqi!=$val)
{
$no++;
$this_xingqi=date('w',time()-3600*24*$no);
}
$this_time=time()-3600*24*$no;
return $this_time;
}
//查詢當前日期的信息
function ret_info($time)
{
global $empire,$dbtbpre;
//格式化為當前0點
$this_0=strtotime(date('Y-m-d',$time));
//當天 23:59:59
$this_23=strtotime(date('Y-m-d',$time))+3600*23+60*59+59;
$sql=$empire->fetch1("select * from {$dbtbpre}ecms_info where newstime between '{$this_0}' and '{$this_23}'");
if(!$sql)
{
$time=$time-3600*24*7;
ret_info();
}
$str='<ul>';
$str_no=1;
$sql2=$empire->query("select * from {$dbtbpre}ecms_info where newstime between '{$this_0}' and '{$this_23}' order by onclick desc limit 8");
while($r2=$empire->fetch($sql2))
{
//查關聯標題
$gl=$empire->fetch1("select * from {$dbtbpre}ecms_list where comicid = '{$r2[comicid]}'");
$lmurl=sys_ReturnBqTitleLink($gl);
$titleurl=sys_ReturnBqTitleLink($r2);
$str.='<li><em class="rank rank-'.$str_no.'">'.$str_no.'</em><a href="'.$lmurl.'" title="'.$gl['title'].'">'.$gl['title'].'</a>[更新<a href="'.$titleurl.'" title="'.$r2['title'].'" class="set">'.$r2['title'].'</a>]
</li>';
$str_no++;
}
$str.='</ul>';
return $str;
}
?>

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 行唐县| 卫辉市| 东城区| 东乡| 鄂托克前旗| 中方县| 德江县| 永新县| 兴宁市| 余庆县| 资兴市| 枣庄市| 颍上县| 定日县| 罗甸县| 当阳市| 湘潭县| 晋江市| 洛浦县| 都匀市| 工布江达县| 昌宁县| 南岸区| 涪陵区| 陇川县| 卢龙县| 汉阴县| 东山县| 余江县| 阿克陶县| 东乌珠穆沁旗| 乌苏市| 兖州市| 英吉沙县| 苍山县| 固原市| 云南省| 油尖旺区| 安宁市| 富顺县| 定兴县|