forked from ACICFG/youBBS-ACICFG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifications.php
49 lines (39 loc) · 1.61 KB
/
notifications.php
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
<?php
define('IN_SAESPOT', 1);
include(dirname(__FILE__) . '/config.php');
include(dirname(__FILE__) . '/common.php');
if (!$cur_user) exit('error: 401 login please');
if ($cur_user['flag']==0){
header("content-Type: text/html; charset=UTF-8");
exit('error: 403 该帐户已被禁用');
}else if($cur_user['flag']==1){
header("content-Type: text/html; charset=UTF-8");
exit('error: 401 该帐户还在审核中');
}
// 获取提醒文章列表
$cur_user = $DBS->fetch_one_array("SELECT * FROM yunbbs_users WHERE id='".$cur_uid."' LIMIT 1");
if($cur_user['notic']){
$ids = implode(',', array_unique(explode(',', substr($cur_user['notic'], 0, -1))));
$query_sql = "SELECT a.id,a.uid,a.cid,a.ruid,a.title,a.addtime,a.edittime,a.comments,c.name as cname,u.avatar as uavatar,u.name as author,ru.name as rauthor
FROM yunbbs_articles a
LEFT JOIN yunbbs_categories c ON c.id=a.cid
LEFT JOIN yunbbs_users u ON a.uid=u.id
LEFT JOIN yunbbs_users ru ON a.ruid=ru.id
WHERE a.id in(".$ids.")";
$query = $DBS->query($query_sql);
$articledb=array();
while ($article = $DBS->fetch_array($query)) {
// 格式化内容
$article['addtime'] = showtime($article['addtime']);
$article['edittime'] = showtime($article['edittime']);
$articledb[] = $article;
}
unset($article);
$DBS->free_result($query);
}
// 页面变量
$title = '站内提醒';
$newest_nodes = get_newest_nodes();
$pagefile = dirname(__FILE__) . '/templates/default/'.$tpl.'notifications.php';
include(dirname(__FILE__) . '/templates/default/'.$tpl.'layout.php');
?>