diff --git a/design/privateheader.php b/design/privateheader.php index 93c0a67f..9457b017 100644 --- a/design/privateheader.php +++ b/design/privateheader.php @@ -80,9 +80,9 @@ - + Up:
  • Down:
  • Ratio:
  • - +
  • Required:
  • 0) { ?> + if ($LoggedUser['FLTokens'] > 0) { ?>
  • Tokens:
  • 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); + 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); } ?> -