}
//Subscriptions
$NewSubscriptions = $Cache->get_value('subscriptions_user_new_'.$LoggedUser['ID']);
if($NewSubscriptions === FALSE) {
$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']."
AND l.PostID < t.LastPostID
AND s.UserID = ".$LoggedUser['ID']);
list($NewSubscriptions) = $DB->next_record();
$Cache->cache_value('subscriptions_user_new_'.$LoggedUser['ID'], $NewSubscriptions, 0);
}
?>