mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
Empty commit
This commit is contained in:
parent
cc54d82c5d
commit
42206f96ce
@ -70,6 +70,28 @@
|
||||
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0);
|
||||
}
|
||||
|
||||
// Subscriptions
|
||||
$NewSubscriptions = $Cache->get_value('subscriptions_user_new_' . $LoggedUser['ID']);
|
||||
if ($NewSubscriptions === FALSE) {
|
||||
if ($LoggedUser['CustomForums']) {
|
||||
unset($LoggedUser['CustomForums']['']);
|
||||
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
|
||||
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
|
||||
}
|
||||
$DB->query("SELECT COUNT(s.TopicID)
|
||||
FROM users_subscriptions AS s
|
||||
JOIN forums_last_read_topics AS l ON s.UserID = l.UserID AND s.TopicID = l.TopicID
|
||||
JOIN forums_topics AS t ON l.TopicID = t.ID
|
||||
JOIN forums AS f ON t.ForumID = f.ID
|
||||
WHERE (f.MinClassRead <= " . $LoggedUser['Class'] . " OR f.ID IN ('$PermittedForums'))
|
||||
AND l.PostID < t.LastPostID
|
||||
AND s.UserID = " . $LoggedUser['ID'] .
|
||||
(!empty($RestrictedForums) ? "
|
||||
AND f.ID NOT IN ('" . $RestrictedForums . "')" : ""));
|
||||
list($NewSubscriptions) = $DB->next_record();
|
||||
$Cache->cache_value('subscriptions_user_new_' . $LoggedUser['ID'], $NewSubscriptions, 0);
|
||||
}
|
||||
|
||||
print json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
@ -82,7 +104,8 @@
|
||||
'messages' => (int) $NewMessages,
|
||||
'notifications' => (int) $NewNotifications,
|
||||
'newAnnouncement' => $MyNews < $CurrentNews,
|
||||
'newBlog' => $MyBlog < $CurrentBlog
|
||||
'newBlog' => $MyBlog < $CurrentBlog,
|
||||
'newSubscriptions' => $NewSubscriptions == 1
|
||||
),
|
||||
'userstats' => array(
|
||||
'uploaded' => (int)$LoggedUser['BytesUploaded'],
|
||||
|
Loading…
Reference in New Issue
Block a user