forked from lincanbin/Carbon-Forum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifications.php
29 lines (29 loc) · 1.12 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
<?php
require(__DIR__ . '/common.php');
require(__DIR__ . '/language/' . ForumLanguage . '/notifications.php');
Auth(1);
$ReplyArray = $DB->query('SELECT n.ID as NID, n.Type, n.IsRead, p.ID, p.TopicID, p.IsTopic, p.UserID, p.UserName, p.Subject, p.Content, p.PostTime, p.IsDel
FROM ' . $Prefix . 'notifications n LEFT JOIN ' . $Prefix . 'posts p
on p.ID=n.PostID
Where n.UserID = ? and n.Type=1
ORDER BY n.Time DESC LIMIT 30', array(
$CurUserID
));
$MentionArray = $DB->query('SELECT n.ID as NID, n.Type, n.IsRead, p.ID, p.TopicID, p.IsTopic, p.UserID, p.UserName, p.Subject, p.Content, p.PostTime, p.IsDel
FROM ' . $Prefix . 'notifications n
LEFT JOIN ' . $Prefix . 'posts p
on p.ID=n.PostID
Where n.UserID = ? and n.Type=2
ORDER BY n.Time DESC LIMIT 30', array(
$CurUserID
));
//Clear unread marks
UpdateUserInfo(array(
'NewMessage' => 0
));
$CurUserInfo['NewMessage'] = 0;
$DB->CloseConnection();
// 页面变量
$PageTitle = $Lang['Notifications'];
$ContentFile = $TemplatePath . 'notifications.php';
include($TemplatePath . 'layout.php');