|
@@ -1,4 +1,4 @@
|
1
|
|
-<?
|
|
1
|
+<?php
|
2
|
2
|
|
3
|
3
|
define('FOOTER_FILE', SERVER_ROOT.'/design/privatefooter.php');
|
4
|
4
|
|
|
@@ -26,16 +26,15 @@ define('FOOTER_FILE', SERVER_ROOT.'/design/privatefooter.php');
|
26
|
26
|
<link rel="alternate" type="application/rss+xml"
|
27
|
27
|
href="feeds.php?feed=torrents_notify_<?=G::$LoggedUser['torrent_pass']?>&user=<?=G::$LoggedUser['ID']?>&auth=<?=G::$LoggedUser['RSS_Auth']?>&passkey=<?=G::$LoggedUser['torrent_pass']?>&authkey=<?=G::$LoggedUser['AuthKey']?>"
|
28
|
28
|
title="<?=SITE_NAME?> - P.T.N.">
|
29
|
|
-<?
|
|
29
|
+<?php
|
30
|
30
|
if (isset(G::$LoggedUser['Notify'])) {
|
31
|
|
- foreach (G::$LoggedUser['Notify'] as $Filter) {
|
32
|
|
- list($FilterID, $FilterName) = $Filter;
|
33
|
|
-?>
|
|
31
|
+ foreach (G::$LoggedUser['Notify'] as $Filter) {
|
|
32
|
+ list($FilterID, $FilterName) = $Filter; ?>
|
34
|
33
|
<link rel="alternate" type="application/rss+xml"
|
35
|
34
|
href="feeds.php?feed=torrents_notify_<?=$FilterID?>_<?=G::$LoggedUser['torrent_pass']?>&user=<?=G::$LoggedUser['ID']?>&auth=<?=G::$LoggedUser['RSS_Auth']?>&passkey=<?=G::$LoggedUser['torrent_pass']?>&authkey=<?=G::$LoggedUser['AuthKey']?>&name=<?=urlencode($FilterName)?>"
|
36
|
35
|
title="<?=SITE_NAME?> - <?=display_str($FilterName)?>">
|
37
|
|
-<?
|
38
|
|
- }
|
|
36
|
+ <?php
|
|
37
|
+ }
|
39
|
38
|
}
|
40
|
39
|
?>
|
41
|
40
|
<link rel="alternate" type="application/rss+xml"
|
|
@@ -59,57 +58,56 @@ if (isset(G::$LoggedUser['Notify'])) {
|
59
|
58
|
<link rel="stylesheet" type="text/css"
|
60
|
59
|
href="<?=STATIC_SERVER?>styles/global.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css')?>">
|
61
|
60
|
<link rel="stylesheet" href="<?=STATIC_SERVER?>styles/tooltipster/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/tooltipster/style.css')?>" type="text/css" media="screen">
|
62
|
|
-<?
|
|
61
|
+<?php
|
63
|
62
|
if (empty(G::$LoggedUser['StyleURL'])) {
|
64
|
|
- if (($StyleColors = G::$Cache->get_value('stylesheet_colors')) === false) {
|
65
|
|
- G::$DB->query('SELECT LOWER(REPLACE(Name, " ", "_")) AS Name, Color FROM stylesheets WHERE COLOR IS NOT NULL');
|
66
|
|
- while (list($StyleName, $StyleColor) = G::$DB->next_record()) {
|
67
|
|
- $StyleColors[$StyleName] = $StyleColor;
|
|
63
|
+ if (($StyleColors = G::$Cache->get_value('stylesheet_colors')) === false) {
|
|
64
|
+ G::$DB->query('SELECT LOWER(REPLACE(Name, " ", "_")) AS Name, Color FROM stylesheets WHERE COLOR IS NOT NULL');
|
|
65
|
+ while (list($StyleName, $StyleColor) = G::$DB->next_record()) {
|
|
66
|
+ $StyleColors[$StyleName] = $StyleColor;
|
|
67
|
+ }
|
|
68
|
+ G::$Cache->cache_value('stylesheet_colors', $StyleColors, 0);
|
68
|
69
|
}
|
69
|
|
- G::$Cache->cache_value('stylesheet_colors', $StyleColors, 0);
|
70
|
|
- }
|
71
|
|
- if (isset($StyleColors[G::$LoggedUser['StyleName']])) { ?>
|
|
70
|
+ if (isset($StyleColors[G::$LoggedUser['StyleName']])) { ?>
|
72
|
71
|
<meta name="theme-color" content="<?=$StyleColors[G::$LoggedUser['StyleName']]?>">
|
73
|
|
-<? } ?>
|
|
72
|
+ <?php } ?>
|
74
|
73
|
<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen" href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.G::$LoggedUser['StyleName'].'/style.css')?>">
|
75
|
|
-<?
|
|
74
|
+ <?php
|
76
|
75
|
} else {
|
77
|
|
- $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
|
78
|
|
- if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
|
|
76
|
+ $StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);
|
|
77
|
+ if (substr(G::$LoggedUser['StyleURL'], -4) == '.css'
|
79
|
78
|
&& empty($StyleURLInfo['query']) && empty($StyleURLInfo['fragment'])
|
80
|
79
|
&& ($StyleURLInfo['host'] == SITE_DOMAIN)
|
81
|
80
|
&& file_exists(SERVER_ROOT.$StyleURLInfo['path'])) {
|
82
|
|
- $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
|
83
|
|
- } else {
|
84
|
|
- $StyleURL = G::$LoggedUser['StyleURL'];
|
85
|
|
- }
|
86
|
|
-?>
|
|
81
|
+ $StyleURL = G::$LoggedUser['StyleURL'].'?v='.filemtime(SERVER_ROOT.$StyleURLInfo['path']);
|
|
82
|
+ } else {
|
|
83
|
+ $StyleURL = G::$LoggedUser['StyleURL'];
|
|
84
|
+ } ?>
|
87
|
85
|
<link rel="stylesheet" type="text/css" media="screen" href="<?=$StyleURL?>" title="External CSS">
|
88
|
|
-<?
|
|
86
|
+ <?php
|
89
|
87
|
}
|
90
|
88
|
$ExtraCSS = explode(',', $CSSIncludes);
|
91
|
89
|
foreach ($ExtraCSS as $CSS) {
|
92
|
|
- if (trim($CSS) == '') {
|
93
|
|
- continue;
|
94
|
|
- }
|
95
|
|
-?>
|
|
90
|
+ if (trim($CSS) == '') {
|
|
91
|
+ continue;
|
|
92
|
+ } ?>
|
96
|
93
|
<link rel="stylesheet" type="text/css" media="screen" href="<?=STATIC_SERVER."styles/$CSS/style.css?v=".filemtime(SERVER_ROOT.STATIC_SERVER."styles/$CSS/style.css")?>">
|
97
|
|
-<?
|
|
94
|
+ <?php
|
98
|
95
|
}
|
99
|
96
|
|
100
|
97
|
$Scripts = array_merge(array('jquery', 'global', 'ajax.class', 'jquery.autocomplete', 'autocomplete', 'tooltipster'), explode(',', $JSIncludes));
|
101
|
98
|
foreach ($Scripts as $Script) {
|
102
|
|
- if (trim($Script) == '') { continue; }
|
103
|
|
- $Async = (in_array($Script, ['jquery','global','ajax.class'])) ? '' : 'async';
|
104
|
|
- if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js")) {
|
105
|
|
- $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js");
|
106
|
|
- $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true));
|
107
|
|
- $ScriptStats['algo'] = INTEGRITY_ALGO;
|
108
|
|
- G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
|
109
|
|
- }
|
110
|
|
-?>
|
|
99
|
+ if (trim($Script) == '') {
|
|
100
|
+ continue;
|
|
101
|
+ }
|
|
102
|
+ $Async = (in_array($Script, ['jquery','global','ajax.class'])) ? '' : 'async';
|
|
103
|
+ if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js")) {
|
|
104
|
+ $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js");
|
|
105
|
+ $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true));
|
|
106
|
+ $ScriptStats['algo'] = INTEGRITY_ALGO;
|
|
107
|
+ G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
|
|
108
|
+ } ?>
|
111
|
109
|
<script src="<?=STATIC_SERVER."functions/$Script.js?v=$ScriptStats[mtime]"?>" type="text/javascript" integrity="<?="$ScriptStats[algo]-$ScriptStats[hash]"?>" <?=$Async?>></script>
|
112
|
|
-<?
|
|
110
|
+ <?php
|
113
|
111
|
}
|
114
|
112
|
|
115
|
113
|
global $ClassLevels;
|
|
@@ -121,25 +119,25 @@ $UseNoty = $NotificationsManager->use_noty();
|
121
|
119
|
$NewSubscriptions = false;
|
122
|
120
|
$NotificationSpans = [];
|
123
|
121
|
foreach ($Notifications as $Type => $Notification) {
|
124
|
|
- if ($Type === NotificationsManager::SUBSCRIPTIONS) {
|
125
|
|
- $NewSubscriptions = true;
|
126
|
|
- }
|
127
|
|
- if ($UseNoty) {
|
128
|
|
- $NotificationSpans[] = "<span class=\"noty-notification\" style=\"display: none;\" data-noty-type=\"$Type\" data-noty-id=\"$Notification[id]\" data-noty-importance=\"$Notification[importance]\" data-noty-url=\"$Notification[url]\">$Notification[message]</span>";
|
129
|
|
- }
|
|
122
|
+ if ($Type === NotificationsManager::SUBSCRIPTIONS) {
|
|
123
|
+ $NewSubscriptions = true;
|
|
124
|
+ }
|
|
125
|
+ if ($UseNoty) {
|
|
126
|
+ $NotificationSpans[] = "<span class=\"noty-notification\" style=\"display: none;\" data-noty-type=\"$Type\" data-noty-id=\"$Notification[id]\" data-noty-importance=\"$Notification[importance]\" data-noty-url=\"$Notification[url]\">$Notification[message]</span>";
|
|
127
|
+ }
|
130
|
128
|
}
|
131
|
129
|
if ($UseNoty && !empty($NotificationSpans)) {
|
132
|
|
- NotificationsManagerView::load_js();
|
|
130
|
+ NotificationsManagerView::load_js();
|
133
|
131
|
}
|
134
|
132
|
if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) {
|
135
|
|
- $NewSubscriptions = Subscriptions::has_new_subscriptions();
|
|
133
|
+ $NewSubscriptions = Subscriptions::has_new_subscriptions();
|
136
|
134
|
}
|
137
|
135
|
?>
|
138
|
136
|
</head>
|
139
|
|
-<?
|
140
|
|
- if (!empty(G::$LoggedUser['StyleAdditions'])) {
|
|
137
|
+<?php
|
|
138
|
+if (!empty(G::$LoggedUser['StyleAdditions'])) {
|
141
|
139
|
$BodyStyles = 'style_'.implode(' style_', G::$LoggedUser['StyleAdditions']);
|
142
|
|
- }
|
|
140
|
+}
|
143
|
141
|
?>
|
144
|
142
|
<body id="<?=$Document == 'collages' ? 'collage' : $Document?>" class="<?=($BodyStyles??'')?>">
|
145
|
143
|
<div id="wrapper">
|
|
@@ -196,9 +194,9 @@ if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) {
|
196
|
194
|
<a href="staffpm.php">Staff Inbox</a>
|
197
|
195
|
<a href="torrents.php?type=uploaded&userid=<?=G::$LoggedUser['ID']?>">Uploads</a>
|
198
|
196
|
<a href="bookmarks.php?type=torrents">Bookmarks</a>
|
199
|
|
-<? if (check_perms('site_torrents_notify')) { ?>
|
|
197
|
+<?php if (check_perms('site_torrents_notify')) { ?>
|
200
|
198
|
<a href="user.php?action=notify">Notifications</a>
|
201
|
|
-<? } ?>
|
|
199
|
+<?php } ?>
|
202
|
200
|
<a href="userhistory.php?action=subscriptions">Subscriptions</a>
|
203
|
201
|
<a href="comments.php">Comments</a>
|
204
|
202
|
<a href="friends.php">Friends</a>
|
|
@@ -207,18 +205,18 @@ if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) {
|
207
|
205
|
</li>
|
208
|
206
|
</ul>
|
209
|
207
|
</div>
|
210
|
|
-<?
|
|
208
|
+<?php
|
211
|
209
|
if (isset(G::$LoggedUser['SearchType']) && G::$LoggedUser['SearchType']) { // Advanced search
|
212
|
|
- $UseAdvancedSearch = true;
|
|
210
|
+ $UseAdvancedSearch = true;
|
213
|
211
|
} else {
|
214
|
|
- $UseAdvancedSearch = false;
|
|
212
|
+ $UseAdvancedSearch = false;
|
215
|
213
|
}
|
216
|
214
|
?>
|
217
|
215
|
<div id="searchbars">
|
218
|
216
|
<form class="search_form" name="torrents" action="torrents.php" method="get">
|
219
|
|
-<? if ($UseAdvancedSearch) { ?>
|
|
217
|
+<?php if ($UseAdvancedSearch) { ?>
|
220
|
218
|
<input type="hidden" name="action" value="advanced">
|
221
|
|
-<? } ?>
|
|
219
|
+<?php } ?>
|
222
|
220
|
<input id="torrentssearch" aria-label="Search torrents" accesskey="t" spellcheck="false" autocomplete="off" placeholder="Torrents" type="text" name="<?=$UseAdvancedSearch ? 'advgroupname' : 'searchstr' ?>" size="17">
|
223
|
221
|
</form>
|
224
|
222
|
<form class="search_form" name="artists" action="artist.php" method="get">
|
|
@@ -250,23 +248,23 @@ if (isset(G::$LoggedUser['SearchType']) && G::$LoggedUser['SearchType']) { // Ad
|
250
|
248
|
<li id="nav_upload" class="brackets<?=Format::add_class($PageID, array('upload'), 'active', false)?>">
|
251
|
249
|
<a href="upload.php">Upload</a>
|
252
|
250
|
</li>
|
253
|
|
-<?
|
|
251
|
+<?php
|
254
|
252
|
if (check_perms('site_send_unlimited_invites')) {
|
255
|
|
- $Invites = ' (∞)';
|
|
253
|
+ $Invites = ' (∞)';
|
256
|
254
|
} elseif (G::$LoggedUser['Invites'] > 0) {
|
257
|
|
- $Invites = ' ('.G::$LoggedUser['Invites'].')';
|
|
255
|
+ $Invites = ' ('.G::$LoggedUser['Invites'].')';
|
258
|
256
|
} else {
|
259
|
|
- $Invites = '';
|
|
257
|
+ $Invites = '';
|
260
|
258
|
}
|
261
|
259
|
?>
|
262
|
260
|
<li id="nav_invite" class="brackets<?=Format::add_class($PageID, array('user','invite'), 'active', false)?>">
|
263
|
261
|
<a href="user.php?action=invite">Invite<?=$Invites?></a>
|
264
|
262
|
</li>
|
265
|
|
-<? if (FEATURE_DONATE) { ?>
|
|
263
|
+<?php if (FEATURE_DONATE) { ?>
|
266
|
264
|
<li id="nav_donate" class="brackets<?=Format::add_class($PageID, array('donate'), 'active', false)?>">
|
267
|
265
|
<a href="donate.php">Donate</a>
|
268
|
266
|
</li>
|
269
|
|
-<? } ?>
|
|
267
|
+<?php } ?>
|
270
|
268
|
<li id="nav_staff" class="brackets<?=Format::add_class($PageID, array('staff'), 'active', false)?>">
|
271
|
269
|
<a href="staff.php">Staff</a>
|
272
|
270
|
</li>
|
|
@@ -283,21 +281,21 @@ if (check_perms('site_send_unlimited_invites')) {
|
283
|
281
|
<li id="stats_ratio">
|
284
|
282
|
Ratio: <span class="stat"><?=Format::get_ratio_html(G::$LoggedUser['BytesUploaded'], G::$LoggedUser['BytesDownloaded'])?></span>
|
285
|
283
|
</li>
|
286
|
|
-<? if (!empty(G::$LoggedUser['RequiredRatio']) && G::$LoggedUser['RequiredRatio'] > 0) { ?>
|
|
284
|
+<?php if (!empty(G::$LoggedUser['RequiredRatio']) && G::$LoggedUser['RequiredRatio'] > 0) { ?>
|
287
|
285
|
<li id="stats_required">
|
288
|
286
|
<a href="rules.php?p=ratio">Required</a>:
|
289
|
287
|
<span class="stat tooltip" title="<?=number_format(G::$LoggedUser['RequiredRatio'], 5)?>"><?=number_format(G::$LoggedUser['RequiredRatio'], 2)?></span>
|
290
|
288
|
</li>
|
291
|
|
-<? }
|
|
289
|
+<?php }
|
292
|
290
|
|
293
|
|
- if (G::$LoggedUser['FLTokens'] > 0) { ?>
|
|
291
|
+if (G::$LoggedUser['FLTokens'] > 0) { ?>
|
294
|
292
|
<li id="fl_tokens">
|
295
|
293
|
<a href="wiki.php?action=article&name=tokens">Tokens</a>:
|
296
|
294
|
<span class="stat">
|
297
|
295
|
<a href="userhistory.php?action=token_history&userid=<?=G::$LoggedUser['ID']?>"><?=G::$LoggedUser['FLTokens']?></a>
|
298
|
296
|
</span>
|
299
|
297
|
</li>
|
300
|
|
-<? }
|
|
298
|
+<?php }
|
301
|
299
|
?>
|
302
|
300
|
<li id="bonus_points">
|
303
|
301
|
<a href="wiki.php?action=article&name=bonuspoints"><?=BONUS_POINTS?></a>:
|
|
@@ -305,228 +303,227 @@ if (check_perms('site_send_unlimited_invites')) {
|
305
|
303
|
<a href="store.php"><?=number_format(G::$LoggedUser['BonusPoints'])?></a>
|
306
|
304
|
</span>
|
307
|
305
|
</li>
|
308
|
|
-<? if (G::$LoggedUser['HnR'] > 0) { ?>
|
|
306
|
+<?php if (G::$LoggedUser['HnR'] > 0) { ?>
|
309
|
307
|
<li id="hnr">
|
310
|
308
|
<a href="snatchlist.php">HnRs</a>:
|
311
|
309
|
<span class="stat">
|
312
|
310
|
<a><?=G::$LoggedUser['HnR']?></a>
|
313
|
311
|
</span>
|
314
|
312
|
</li>
|
315
|
|
-<? }
|
|
313
|
+<?php }
|
316
|
314
|
?>
|
317
|
315
|
</ul>
|
318
|
316
|
</div>
|
319
|
|
-<? if (!apcu_exists('DBKEY')) { ?>
|
|
317
|
+<?php if (!apcu_exists('DBKEY')) { ?>
|
320
|
318
|
<a id="dbcrypt" class="tooltip" href="wiki.php?action=article&name=databaseencryption" title="Database is not fully decrypted. Site functionality will be reduced until staff can provide the decryption key. Click to learn more."></a>
|
321
|
|
-<? } ?>
|
|
319
|
+<?php } ?>
|
322
|
320
|
</div>
|
323
|
|
-<?
|
|
321
|
+<?php
|
324
|
322
|
//Start handling alert bars
|
325
|
323
|
$Alerts = [];
|
326
|
324
|
$ModBar = [];
|
327
|
325
|
|
328
|
326
|
// Staff blog
|
329
|
327
|
if (check_perms('users_mod')) {
|
330
|
|
- global $SBlogReadTime, $LatestSBlogTime;
|
331
|
|
- if (!$SBlogReadTime && ($SBlogReadTime = G::$Cache->get_value('staff_blog_read_'.G::$LoggedUser['ID'])) === false) {
|
332
|
|
- G::$DB->query("
|
|
328
|
+ global $SBlogReadTime, $LatestSBlogTime;
|
|
329
|
+ if (!$SBlogReadTime && ($SBlogReadTime = G::$Cache->get_value('staff_blog_read_'.G::$LoggedUser['ID'])) === false) {
|
|
330
|
+ G::$DB->query("
|
333
|
331
|
SELECT Time
|
334
|
332
|
FROM staff_blog_visits
|
335
|
333
|
WHERE UserID = ".G::$LoggedUser['ID']);
|
336
|
|
- if (list($SBlogReadTime) = G::$DB->next_record()) {
|
337
|
|
- $SBlogReadTime = strtotime($SBlogReadTime);
|
338
|
|
- } else {
|
339
|
|
- $SBlogReadTime = 0;
|
|
334
|
+ if (list($SBlogReadTime) = G::$DB->next_record()) {
|
|
335
|
+ $SBlogReadTime = strtotime($SBlogReadTime);
|
|
336
|
+ } else {
|
|
337
|
+ $SBlogReadTime = 0;
|
|
338
|
+ }
|
|
339
|
+ G::$Cache->cache_value('staff_blog_read_'.G::$LoggedUser['ID'], $SBlogReadTime, 1209600);
|
340
|
340
|
}
|
341
|
|
- G::$Cache->cache_value('staff_blog_read_'.G::$LoggedUser['ID'], $SBlogReadTime, 1209600);
|
342
|
|
- }
|
343
|
|
- if (!$LatestSBlogTime && ($LatestSBlogTime = G::$Cache->get_value('staff_blog_latest_time')) === false) {
|
344
|
|
- G::$DB->query("
|
|
341
|
+ if (!$LatestSBlogTime && ($LatestSBlogTime = G::$Cache->get_value('staff_blog_latest_time')) === false) {
|
|
342
|
+ G::$DB->query("
|
345
|
343
|
SELECT MAX(Time)
|
346
|
344
|
FROM staff_blog");
|
347
|
|
- list($LatestSBlogTime) = G::$DB->next_record();
|
348
|
|
- if ($LatestSBlogTime) {
|
349
|
|
- $LatestSBlogTime = strtotime($LatestSBlogTime);
|
350
|
|
- } else {
|
351
|
|
- $LatestSBlogTime = 0;
|
|
345
|
+ list($LatestSBlogTime) = G::$DB->next_record();
|
|
346
|
+ if ($LatestSBlogTime) {
|
|
347
|
+ $LatestSBlogTime = strtotime($LatestSBlogTime);
|
|
348
|
+ } else {
|
|
349
|
+ $LatestSBlogTime = 0;
|
|
350
|
+ }
|
|
351
|
+ G::$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600);
|
|
352
|
+ }
|
|
353
|
+ if ($SBlogReadTime < $LatestSBlogTime) {
|
|
354
|
+ $Alerts[] = '<a href="staffblog.php">New staff blog post!</a>';
|
352
|
355
|
}
|
353
|
|
- G::$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600);
|
354
|
|
- }
|
355
|
|
- if ($SBlogReadTime < $LatestSBlogTime) {
|
356
|
|
- $Alerts[] = '<a href="staffblog.php">New staff blog post!</a>';
|
357
|
|
- }
|
358
|
356
|
}
|
359
|
357
|
|
360
|
358
|
// Inbox
|
361
|
359
|
if ($NotificationsManager->is_traditional(NotificationsManager::INBOX)) {
|
362
|
|
- $NotificationsManager->load_inbox();
|
363
|
|
- $NewMessages = $NotificationsManager->get_notifications();
|
364
|
|
- if (isset($NewMessages[NotificationsManager::INBOX])) {
|
365
|
|
- $Alerts[] = NotificationsManagerView::format_traditional($NewMessages[NotificationsManager::INBOX]);
|
366
|
|
- }
|
367
|
|
- $NotificationsManager->clear_notifications_array();
|
|
360
|
+ $NotificationsManager->load_inbox();
|
|
361
|
+ $NewMessages = $NotificationsManager->get_notifications();
|
|
362
|
+ if (isset($NewMessages[NotificationsManager::INBOX])) {
|
|
363
|
+ $Alerts[] = NotificationsManagerView::format_traditional($NewMessages[NotificationsManager::INBOX]);
|
|
364
|
+ }
|
|
365
|
+ $NotificationsManager->clear_notifications_array();
|
368
|
366
|
}
|
369
|
367
|
|
370
|
368
|
if (G::$LoggedUser['RatioWatch']) {
|
371
|
|
- $Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: You have '.time_diff(G::$LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
|
369
|
+ $Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: You have '.time_diff(G::$LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
372
|
370
|
} elseif (G::$LoggedUser['CanLeech'] != 1) {
|
373
|
|
- $Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: Your downloading privileges are disabled until you meet your required ratio.';
|
|
371
|
+ $Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: Your downloading privileges are disabled until you meet your required ratio.';
|
374
|
372
|
}
|
375
|
373
|
|
376
|
374
|
// Torrents
|
377
|
375
|
if ($NotificationsManager->is_traditional(NotificationsManager::TORRENTS)) {
|
378
|
|
- $NotificationsManager->load_torrent_notifications();
|
379
|
|
- $NewTorrents = $NotificationsManager->get_notifications();
|
380
|
|
- if (isset($NewTorrents[NotificationsManager::TORRENTS])) {
|
381
|
|
- $Alerts[] = NotificationsManagerView::format_traditional($NewTorrents[NotificationsManager::TORRENTS]);
|
382
|
|
- }
|
383
|
|
- $NotificationsManager->clear_notifications_array();
|
|
376
|
+ $NotificationsManager->load_torrent_notifications();
|
|
377
|
+ $NewTorrents = $NotificationsManager->get_notifications();
|
|
378
|
+ if (isset($NewTorrents[NotificationsManager::TORRENTS])) {
|
|
379
|
+ $Alerts[] = NotificationsManagerView::format_traditional($NewTorrents[NotificationsManager::TORRENTS]);
|
|
380
|
+ }
|
|
381
|
+ $NotificationsManager->clear_notifications_array();
|
384
|
382
|
}
|
385
|
383
|
|
386
|
384
|
// Contests
|
387
|
385
|
if ($ContestSettings = G::$Cache->get_value('contest_settings')) {
|
388
|
|
- if (time() > $ContestSettings['start'] && time() < $ContestSettings['end']) {
|
389
|
|
- $Alerts[] = '<a href="/contest.php">A Contest is Underway!</a>';
|
390
|
|
- }
|
|
386
|
+ if (time() > $ContestSettings['start'] && time() < $ContestSettings['end']) {
|
|
387
|
+ $Alerts[] = '<a href="/contest.php">A Contest is Underway!</a>';
|
|
388
|
+ }
|
391
|
389
|
}
|
392
|
390
|
|
393
|
391
|
if (check_perms('users_mod')) {
|
394
|
|
- $ModBar[] = '<a href="tools.php">Toolbox</a>';
|
|
392
|
+ $ModBar[] = '<a href="tools.php">Toolbox</a>';
|
395
|
393
|
}
|
396
|
394
|
if (check_perms('users_mod')) {
|
397
|
|
- $NumStaffPMs = G::$Cache->get_value('num_staff_pms_'.G::$LoggedUser['ID']);
|
398
|
|
- if ($NumStaffPMs === false) {
|
399
|
|
- if (check_perms('users_mod')) {
|
|
395
|
+ $NumStaffPMs = G::$Cache->get_value('num_staff_pms_'.G::$LoggedUser['ID']);
|
|
396
|
+ if ($NumStaffPMs === false) {
|
|
397
|
+ if (check_perms('users_mod')) {
|
|
398
|
+ $LevelCap = 1000;
|
400
|
399
|
|
401
|
|
- $LevelCap = 1000;
|
402
|
|
-
|
403
|
|
- G::$DB->query("
|
|
400
|
+ G::$DB->query("
|
404
|
401
|
SELECT COUNT(ID)
|
405
|
402
|
FROM staff_pm_conversations
|
406
|
403
|
WHERE Status = 'Unanswered'
|
407
|
404
|
AND (AssignedToUser = ".G::$LoggedUser['ID']."
|
408
|
405
|
OR (LEAST('$LevelCap', Level) <= '".G::$LoggedUser['EffectiveClass']."'
|
409
|
406
|
AND Level <= ".G::$LoggedUser['Class']."))");
|
410
|
|
- }
|
411
|
|
- if (G::$LoggedUser['PermissionID'] == FORUM_MOD) {
|
412
|
|
- G::$DB->query("
|
|
407
|
+ }
|
|
408
|
+ if (G::$LoggedUser['PermissionID'] == FORUM_MOD) {
|
|
409
|
+ G::$DB->query("
|
413
|
410
|
SELECT COUNT(ID)
|
414
|
411
|
FROM staff_pm_conversations
|
415
|
412
|
WHERE Status='Unanswered'
|
416
|
413
|
AND (AssignedToUser = ".G::$LoggedUser['ID']."
|
417
|
414
|
OR Level = '". $Classes[FORUM_MOD]['Level'] . "')");
|
|
415
|
+ }
|
|
416
|
+ list($NumStaffPMs) = G::$DB->next_record();
|
|
417
|
+ G::$Cache->cache_value('num_staff_pms_'.G::$LoggedUser['ID'], $NumStaffPMs, 1000);
|
418
|
418
|
}
|
419
|
|
- list($NumStaffPMs) = G::$DB->next_record();
|
420
|
|
- G::$Cache->cache_value('num_staff_pms_'.G::$LoggedUser['ID'], $NumStaffPMs , 1000);
|
421
|
|
- }
|
422
|
419
|
|
423
|
|
- if ($NumStaffPMs > 0) {
|
424
|
|
- $ModBar[] = '<a href="staffpm.php">'.$NumStaffPMs.' Staff PMs</a>';
|
425
|
|
- }
|
|
420
|
+ if ($NumStaffPMs > 0) {
|
|
421
|
+ $ModBar[] = '<a href="staffpm.php">'.$NumStaffPMs.' Staff PMs</a>';
|
|
422
|
+ }
|
426
|
423
|
}
|
427
|
424
|
if (check_perms('admin_reports')) {
|
428
|
|
-// Torrent reports code
|
429
|
|
- $NumTorrentReports = G::$Cache->get_value('num_torrent_reportsv2');
|
430
|
|
- if ($NumTorrentReports === false) {
|
431
|
|
- G::$DB->query("
|
|
425
|
+ // Torrent reports code
|
|
426
|
+ $NumTorrentReports = G::$Cache->get_value('num_torrent_reportsv2');
|
|
427
|
+ if ($NumTorrentReports === false) {
|
|
428
|
+ G::$DB->query("
|
432
|
429
|
SELECT COUNT(ID)
|
433
|
430
|
FROM reportsv2
|
434
|
431
|
WHERE Status = 'New'");
|
435
|
|
- list($NumTorrentReports) = G::$DB->next_record();
|
436
|
|
- G::$Cache->cache_value('num_torrent_reportsv2', $NumTorrentReports, 0);
|
437
|
|
- }
|
|
432
|
+ list($NumTorrentReports) = G::$DB->next_record();
|
|
433
|
+ G::$Cache->cache_value('num_torrent_reportsv2', $NumTorrentReports, 0);
|
|
434
|
+ }
|
438
|
435
|
|
439
|
|
- $ModBar[] = '<a href="reportsv2.php">'.$NumTorrentReports.(($NumTorrentReports == 1) ? ' Report' : ' Reports').'</a>';
|
|
436
|
+ $ModBar[] = '<a href="reportsv2.php">'.$NumTorrentReports.(($NumTorrentReports == 1) ? ' Report' : ' Reports').'</a>';
|
440
|
437
|
|
441
|
|
-// Other reports code
|
442
|
|
- $NumOtherReports = G::$Cache->get_value('num_other_reports');
|
443
|
|
- if ($NumOtherReports === false) {
|
444
|
|
- G::$DB->query("
|
|
438
|
+ // Other reports code
|
|
439
|
+ $NumOtherReports = G::$Cache->get_value('num_other_reports');
|
|
440
|
+ if ($NumOtherReports === false) {
|
|
441
|
+ G::$DB->query("
|
445
|
442
|
SELECT COUNT(ID)
|
446
|
443
|
FROM reports
|
447
|
444
|
WHERE Status = 'New'");
|
448
|
|
- list($NumOtherReports) = G::$DB->next_record();
|
449
|
|
- G::$Cache->cache_value('num_other_reports', $NumOtherReports, 0);
|
450
|
|
- }
|
|
445
|
+ list($NumOtherReports) = G::$DB->next_record();
|
|
446
|
+ G::$Cache->cache_value('num_other_reports', $NumOtherReports, 0);
|
|
447
|
+ }
|
451
|
448
|
|
452
|
|
- if ($NumOtherReports > 0) {
|
453
|
|
- $ModBar[] = '<a href="reports.php">'.$NumOtherReports.(($NumTorrentReports == 1) ? ' Other report' : ' Other reports').'</a>';
|
454
|
|
- }
|
|
449
|
+ if ($NumOtherReports > 0) {
|
|
450
|
+ $ModBar[] = '<a href="reports.php">'.$NumOtherReports.(($NumTorrentReports == 1) ? ' Other report' : ' Other reports').'</a>';
|
|
451
|
+ }
|
455
|
452
|
} elseif (check_perms('project_team')) {
|
456
|
|
- $NumUpdateReports = G::$Cache->get_value('num_update_reports');
|
457
|
|
- if ($NumUpdateReports === false) {
|
458
|
|
- G::$DB->query("
|
|
453
|
+ $NumUpdateReports = G::$Cache->get_value('num_update_reports');
|
|
454
|
+ if ($NumUpdateReports === false) {
|
|
455
|
+ G::$DB->query("
|
459
|
456
|
SELECT COUNT(ID)
|
460
|
457
|
FROM reports
|
461
|
458
|
WHERE Status = 'New'
|
462
|
459
|
AND Type = 'request_update'");
|
463
|
|
- list($NumUpdateReports) = G::$DB->next_record();
|
464
|
|
- G::$Cache->cache_value('num_update_reports', $NumUpdateReports, 0);
|
465
|
|
- }
|
|
460
|
+ list($NumUpdateReports) = G::$DB->next_record();
|
|
461
|
+ G::$Cache->cache_value('num_update_reports', $NumUpdateReports, 0);
|
|
462
|
+ }
|
466
|
463
|
|
467
|
|
- if ($NumUpdateReports > 0) {
|
468
|
|
- $ModBar[] = '<a href="reports.php">Request update reports</a>';
|
469
|
|
- }
|
|
464
|
+ if ($NumUpdateReports > 0) {
|
|
465
|
+ $ModBar[] = '<a href="reports.php">Request update reports</a>';
|
|
466
|
+ }
|
470
|
467
|
} elseif (check_perms('site_moderate_forums')) {
|
471
|
|
- $NumForumReports = G::$Cache->get_value('num_forum_reports');
|
472
|
|
- if ($NumForumReports === false) {
|
473
|
|
- G::$DB->query("
|
|
468
|
+ $NumForumReports = G::$Cache->get_value('num_forum_reports');
|
|
469
|
+ if ($NumForumReports === false) {
|
|
470
|
+ G::$DB->query("
|
474
|
471
|
SELECT COUNT(ID)
|
475
|
472
|
FROM reports
|
476
|
473
|
WHERE Status = 'New'
|
477
|
474
|
AND Type IN('artist_comment', 'collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment')");
|
478
|
|
- list($NumForumReports) = G::$DB->next_record();
|
479
|
|
- G::$Cache->cache_value('num_forum_reports', $NumForumReports, 0);
|
480
|
|
- }
|
|
475
|
+ list($NumForumReports) = G::$DB->next_record();
|
|
476
|
+ G::$Cache->cache_value('num_forum_reports', $NumForumReports, 0);
|
|
477
|
+ }
|
481
|
478
|
|
482
|
|
- if ($NumForumReports > 0) {
|
483
|
|
- $ModBar[] = '<a href="reports.php">'.$NumForumReports.(($NumForumReports == 1) ? ' Forum report' : ' Forum reports').'</a>';
|
484
|
|
- }
|
|
479
|
+ if ($NumForumReports > 0) {
|
|
480
|
+ $ModBar[] = '<a href="reports.php">'.$NumForumReports.(($NumForumReports == 1) ? ' Forum report' : ' Forum reports').'</a>';
|
|
481
|
+ }
|
485
|
482
|
}
|
486
|
483
|
|
487
|
484
|
if (check_perms('users_mod')) {
|
488
|
|
- $NumDeleteRequests = G::$Cache->get_value('num_deletion_requests');
|
489
|
|
- if ($NumDeleteRequests === false) {
|
490
|
|
- G::$DB->query("SELECT COUNT(*) FROM deletion_requests");
|
491
|
|
- list($NumDeleteRequests) = G::$DB->next_record();
|
492
|
|
- G::$Cache->cache_value('num_deletion_requests', $NumDeleteRequests);
|
493
|
|
- }
|
494
|
|
- if ($NumDeleteRequests > 0) {
|
495
|
|
- $ModBar[] = '<a href="tools.php?action=expunge_requests">' . $NumDeleteRequests . " Expunge request".($NumDeleteRequests > 1 ? 's' : '')."</a>";
|
496
|
|
- }
|
|
485
|
+ $NumDeleteRequests = G::$Cache->get_value('num_deletion_requests');
|
|
486
|
+ if ($NumDeleteRequests === false) {
|
|
487
|
+ G::$DB->query("SELECT COUNT(*) FROM deletion_requests");
|
|
488
|
+ list($NumDeleteRequests) = G::$DB->next_record();
|
|
489
|
+ G::$Cache->cache_value('num_deletion_requests', $NumDeleteRequests);
|
|
490
|
+ }
|
|
491
|
+ if ($NumDeleteRequests > 0) {
|
|
492
|
+ $ModBar[] = '<a href="tools.php?action=expunge_requests">' . $NumDeleteRequests . " Expunge request".($NumDeleteRequests > 1 ? 's' : '')."</a>";
|
|
493
|
+ }
|
497
|
494
|
}
|
498
|
495
|
|
499
|
496
|
if (check_perms('users_mod') && FEATURE_EMAIL_REENABLE) {
|
500
|
|
- $NumEnableRequests = G::$Cache->get_value(AutoEnable::CACHE_KEY_NAME);
|
501
|
|
- if ($NumEnableRequests === false) {
|
502
|
|
- G::$DB->query("SELECT COUNT(1) FROM users_enable_requests WHERE Outcome IS NULL");
|
503
|
|
- list($NumEnableRequests) = G::$DB->next_record();
|
504
|
|
- G::$Cache->cache_value(AutoEnable::CACHE_KEY_NAME, $NumEnableRequests);
|
505
|
|
- }
|
|
497
|
+ $NumEnableRequests = G::$Cache->get_value(AutoEnable::CACHE_KEY_NAME);
|
|
498
|
+ if ($NumEnableRequests === false) {
|
|
499
|
+ G::$DB->query("SELECT COUNT(1) FROM users_enable_requests WHERE Outcome IS NULL");
|
|
500
|
+ list($NumEnableRequests) = G::$DB->next_record();
|
|
501
|
+ G::$Cache->cache_value(AutoEnable::CACHE_KEY_NAME, $NumEnableRequests);
|
|
502
|
+ }
|
506
|
503
|
|
507
|
|
- if ($NumEnableRequests > 0) {
|
508
|
|
- $ModBar[] = '<a href="tools.php?action=enable_requests">' . $NumEnableRequests . " Enable requests</a>";
|
509
|
|
- }
|
|
504
|
+ if ($NumEnableRequests > 0) {
|
|
505
|
+ $ModBar[] = '<a href="tools.php?action=enable_requests">' . $NumEnableRequests . " Enable requests</a>";
|
|
506
|
+ }
|
510
|
507
|
}
|
511
|
508
|
|
512
|
509
|
if (!empty($Alerts) || !empty($ModBar)) { ?>
|
513
|
510
|
<div id="alerts">
|
514
|
|
-<? foreach ($Alerts as $Alert) { ?>
|
|
511
|
+ <?php foreach ($Alerts as $Alert) { ?>
|
515
|
512
|
<div class="alertbar"><?=$Alert?></div>
|
516
|
|
-<?
|
517
|
|
- }
|
518
|
|
- if (!empty($ModBar)) { ?>
|
|
513
|
+ <?php
|
|
514
|
+ }
|
|
515
|
+ if (!empty($ModBar)) { ?>
|
519
|
516
|
<div class="alertbar modbar">
|
520
|
|
- <?=implode(' ', $ModBar); echo "\n"?>
|
|
517
|
+ <?=implode(' ', $ModBar); echo "\n"?>
|
521
|
518
|
</div>
|
522
|
|
-<? }
|
523
|
|
-if (check_perms('site_debug') && !apcu_exists('DBKEY')) { ?>
|
|
519
|
+ <?php }
|
|
520
|
+ if (check_perms('site_debug') && !apcu_exists('DBKEY')) { ?>
|
524
|
521
|
<div class="alertbar error">
|
525
|
522
|
Warning: <a href="tools.php?action=database_key">no DB key</a>
|
526
|
523
|
</div>
|
527
|
|
-<? } ?>
|
|
524
|
+ <?php } ?>
|
528
|
525
|
</div>
|
529
|
|
-<?
|
|
526
|
+ <?php
|
530
|
527
|
}
|
531
|
528
|
//Done handling alertbars
|
532
|
529
|
?>
|