Empty commit

This commit is contained in:
Git 2012-11-30 08:00:19 +00:00
parent cc54d82c5d
commit 42206f96ce

View File

@ -70,6 +70,28 @@
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0); $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( print json_encode(
array( array(
'status' => 'success', 'status' => 'success',
@ -82,7 +104,8 @@
'messages' => (int) $NewMessages, 'messages' => (int) $NewMessages,
'notifications' => (int) $NewNotifications, 'notifications' => (int) $NewNotifications,
'newAnnouncement' => $MyNews < $CurrentNews, 'newAnnouncement' => $MyNews < $CurrentNews,
'newBlog' => $MyBlog < $CurrentBlog 'newBlog' => $MyBlog < $CurrentBlog,
'newSubscriptions' => $NewSubscriptions == 1
), ),
'userstats' => array( 'userstats' => array(
'uploaded' => (int)$LoggedUser['BytesUploaded'], 'uploaded' => (int)$LoggedUser['BytesUploaded'],