get_value('stylesheet_colors')) === false) { G::$DB->query('SELECT LOWER(REPLACE(Name, " ", "_")) AS Name, Color FROM stylesheets WHERE COLOR IS NOT NULL'); while (list($StyleName, $StyleColor) = G::$DB->next_record()) { $StyleColors[$StyleName] = $StyleColor; } G::$Cache->cache_value('stylesheet_colors', $StyleColors, 0); } if (isset($StyleColors[G::$LoggedUser['StyleName']])) { ?> " /> get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js")) { $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js"); $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true)); $ScriptStats['algo'] = INTEGRITY_ALGO; G::$Cache->cache_value("script_stats_$Script", $ScriptStats); } ?> get_notifications(); $UseNoty = $NotificationsManager->use_noty(); $NewSubscriptions = false; $NotificationSpans = []; foreach ($Notifications as $Type => $Notification) { if ($Type === NotificationsManager::SUBSCRIPTIONS) { $NewSubscriptions = true; } if ($UseNoty) { $NotificationSpans[] = "$Notification[message]"; } } if ($UseNoty && !empty($NotificationSpans)) { NotificationsManagerView::load_js(); } if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) { $NewSubscriptions = Subscriptions::has_new_subscriptions(); } ?>

get_value('staff_blog_read_'.G::$LoggedUser['ID'])) === false) { G::$DB->query(" SELECT Time FROM staff_blog_visits WHERE UserID = ".G::$LoggedUser['ID']); if (list($SBlogReadTime) = G::$DB->next_record()) { $SBlogReadTime = strtotime($SBlogReadTime); } else { $SBlogReadTime = 0; } G::$Cache->cache_value('staff_blog_read_'.G::$LoggedUser['ID'], $SBlogReadTime, 1209600); } if (!$LatestSBlogTime && ($LatestSBlogTime = G::$Cache->get_value('staff_blog_latest_time')) === false) { G::$DB->query(" SELECT MAX(Time) FROM staff_blog"); list($LatestSBlogTime) = G::$DB->next_record(); if ($LatestSBlogTime) { $LatestSBlogTime = strtotime($LatestSBlogTime); } else { $LatestSBlogTime = 0; } G::$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600); } if ($SBlogReadTime < $LatestSBlogTime) { $Alerts[] = 'New staff blog post!'; } } // Inbox if ($NotificationsManager->is_traditional(NotificationsManager::INBOX)) { $NotificationsManager->load_inbox(); $NewMessages = $NotificationsManager->get_notifications(); if (isset($NewMessages[NotificationsManager::INBOX])) { $Alerts[] = NotificationsManagerView::format_traditional($NewMessages[NotificationsManager::INBOX]); } $NotificationsManager->clear_notifications_array(); } if (G::$LoggedUser['RatioWatch']) { $Alerts[] = 'Ratio Watch: You have '.time_diff(G::$LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.'; } elseif (G::$LoggedUser['CanLeech'] != 1) { $Alerts[] = 'Ratio Watch: Your downloading privileges are disabled until you meet your required ratio.'; } // Torrents if ($NotificationsManager->is_traditional(NotificationsManager::TORRENTS)) { $NotificationsManager->load_torrent_notifications(); $NewTorrents = $NotificationsManager->get_notifications(); if (isset($NewTorrents[NotificationsManager::TORRENTS])) { $Alerts[] = NotificationsManagerView::format_traditional($NewTorrents[NotificationsManager::TORRENTS]); } $NotificationsManager->clear_notifications_array(); } // Contests if ($ContestSettings = G::$Cache->get_value('contest_settings')) { if (time() > $ContestSettings['start'] && time() < $ContestSettings['end']) { $Alerts[] = 'A Contest is Underway!'; } } if (check_perms('users_mod')) { $ModBar[] = 'Toolbox'; } if (check_perms('users_mod')) { $NumStaffPMs = G::$Cache->get_value('num_staff_pms_'.G::$LoggedUser['ID']); if ($NumStaffPMs === false) { if (check_perms('users_mod')) { $LevelCap = 1000; G::$DB->query(" SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status = 'Unanswered' AND (AssignedToUser = ".G::$LoggedUser['ID']." OR (LEAST('$LevelCap', Level) <= '".G::$LoggedUser['EffectiveClass']."' AND Level <= ".G::$LoggedUser['Class']."))"); } if (G::$LoggedUser['PermissionID'] == FORUM_MOD) { G::$DB->query(" SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser = ".G::$LoggedUser['ID']." OR Level = '". $Classes[FORUM_MOD]['Level'] . "')"); } list($NumStaffPMs) = G::$DB->next_record(); G::$Cache->cache_value('num_staff_pms_'.G::$LoggedUser['ID'], $NumStaffPMs , 1000); } if ($NumStaffPMs > 0) { $ModBar[] = ''.$NumStaffPMs.' Staff PMs'; } } if (check_perms('admin_reports')) { // Torrent reports code $NumTorrentReports = G::$Cache->get_value('num_torrent_reportsv2'); if ($NumTorrentReports === false) { G::$DB->query(" SELECT COUNT(ID) FROM reportsv2 WHERE Status = 'New'"); list($NumTorrentReports) = G::$DB->next_record(); G::$Cache->cache_value('num_torrent_reportsv2', $NumTorrentReports, 0); } $ModBar[] = ''.$NumTorrentReports.(($NumTorrentReports == 1) ? ' Report' : ' Reports').''; // Other reports code $NumOtherReports = G::$Cache->get_value('num_other_reports'); if ($NumOtherReports === false) { G::$DB->query(" SELECT COUNT(ID) FROM reports WHERE Status = 'New'"); list($NumOtherReports) = G::$DB->next_record(); G::$Cache->cache_value('num_other_reports', $NumOtherReports, 0); } if ($NumOtherReports > 0) { $ModBar[] = ''.$NumOtherReports.(($NumTorrentReports == 1) ? ' Other report' : ' Other reports').''; } } elseif (check_perms('project_team')) { $NumUpdateReports = G::$Cache->get_value('num_update_reports'); if ($NumUpdateReports === false) { G::$DB->query(" SELECT COUNT(ID) FROM reports WHERE Status = 'New' AND Type = 'request_update'"); list($NumUpdateReports) = G::$DB->next_record(); G::$Cache->cache_value('num_update_reports', $NumUpdateReports, 0); } if ($NumUpdateReports > 0) { $ModBar[] = 'Request update reports'; } } elseif (check_perms('site_moderate_forums')) { $NumForumReports = G::$Cache->get_value('num_forum_reports'); if ($NumForumReports === false) { G::$DB->query(" SELECT COUNT(ID) FROM reports WHERE Status = 'New' AND Type IN('artist_comment', 'collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment')"); list($NumForumReports) = G::$DB->next_record(); G::$Cache->cache_value('num_forum_reports', $NumForumReports, 0); } if ($NumForumReports > 0) { $ModBar[] = ''.$NumForumReports.(($NumForumReports == 1) ? ' Forum report' : ' Forum reports').''; } } if (check_perms('users_mod')) { $NumDeleteRequests = G::$Cache->get_value('num_deletion_requests'); if ($NumDeleteRequests === false) { G::$DB->query("SELECT COUNT(*) FROM deletion_requests"); list($NumDeleteRequests) = G::$DB->next_record(); G::$Cache->cache_value('num_deletion_requests', $NumDeleteRequests); } if ($NumDeleteRequests > 0) { $ModBar[] = '' . $NumDeleteRequests . " Expunge request".($NumDeleteRequests > 1 ? 's' : '').""; } } if (check_perms('users_mod') && FEATURE_EMAIL_REENABLE) { $NumEnableRequests = G::$Cache->get_value(AutoEnable::CACHE_KEY_NAME); if ($NumEnableRequests === false) { G::$DB->query("SELECT COUNT(1) FROM users_enable_requests WHERE Outcome IS NULL"); list($NumEnableRequests) = G::$DB->next_record(); G::$Cache->cache_value(AutoEnable::CACHE_KEY_NAME, $NumEnableRequests); } if ($NumEnableRequests > 0) { $ModBar[] = '' . $NumEnableRequests . " Enable requests"; } } if (!empty($Alerts) || !empty($ModBar)) { ?>
Warning: no DB key