Browse Source

Upload files to 'design'

Stortebeker 6 years ago
parent
commit
8950164e08
4 changed files with 229 additions and 233 deletions
  1. 27
    27
      design/privatefooter.php
  2. 187
    190
      design/privateheader.php
  3. 0
    0
      design/publicfooter.php
  4. 15
    16
      design/publicheader.php

+ 27
- 27
design/privatefooter.php View File

@@ -1,33 +1,33 @@
1 1
 </div>
2 2
 <?php TEXTAREA_PREVIEW::JavaScript(); ?>
3 3
 <div id="footer">
4
-<?  if (!empty($Options['disclaimer'])) { ?>
4
+<?php  if (!empty($Options['disclaimer'])) { ?>
5 5
   <br /><br />
6 6
   <div id="disclaimer_container" class="thin" style="text-align: center; margin-bottom: 20px;">
7 7
     None of the files shown here are actually hosted on this server. The links are provided solely by this site's users. These BitTorrent files are meant for the distribution of backup files. By downloading the BitTorrent file, you are claiming that you own the original file. The administrator of this site (<?=site_url()?>) holds NO RESPONSIBILITY if these files are misused in any way and cannot be held responsible for what its users post, or any other actions of it.
8 8
   </div>
9 9
   <div class='thin'><a href='/canary.php'>Warrant Canary</a></div>
10
-<?
11
-  }
12
-  if (count($UserSessions) > 1) {
10
+    <?php
11
+}
12
+if (count($UserSessions) > 1) {
13 13
     foreach ($UserSessions as $ThisSessionID => $Session) {
14
-      if ($ThisSessionID != $SessionID) {
15
-        $LastActive = $Session;
16
-        break;
17
-      }
14
+        if ($ThisSessionID != $SessionID) {
15
+            $LastActive = $Session;
16
+            break;
17
+        }
18 18
     }
19
-  }
19
+}
20 20
 
21 21
   $Load = sys_getloadavg();
22 22
 ?>
23 23
   <p>Site and design &copy; <?=date('Y')?> <?=SITE_NAME?></p>
24
-<?  if (!empty($LastActive)) { ?>
24
+<?php  if (!empty($LastActive)) { ?>
25 25
   <p>
26 26
     <a href="user.php?action=sessions">
27 27
       <span class="tooltip" title="Manage sessions">Last activity: </span><?=time_diff($LastActive['LastUpdate'])?><span class="tooltip" title="Manage sessions"> from <?=(apcu_exists('DBKEY')?(Crypto::decrypt($LastActive['IP'])):'[Encrypted]') ?></span>
28 28
     </a>
29 29
   </p>
30
-<?  } ?>
30
+<?php  } ?>
31 31
   <p>
32 32
     <strong>Time:</strong> <span><?=number_format(((microtime(true) - $ScriptStartTime) * 1000), 5)?> ms</span>
33 33
     <strong>Used:</strong> <span><?=Format::get_size(memory_get_usage(true))?></span>
@@ -36,30 +36,30 @@
36 36
 
37 37
   </p>
38 38
   </div>
39
-<? if (DEBUG_MODE || check_perms('site_debug')) { ?>
39
+<?php if (DEBUG_MODE || check_perms('site_debug')) { ?>
40 40
   <!-- Begin Debugging -->
41 41
   <div id="site_debug">
42
-<?
43
-$Debug->perf_table();
44
-$Debug->flag_table();
45
-$Debug->error_table();
46
-$Debug->sphinx_table();
47
-$Debug->query_table();
48
-$Debug->cache_table();
49
-$Debug->vars_table();
50
-$Debug->ocelot_table();
51
-?>
42
+    <?php
43
+    $Debug->perf_table();
44
+    $Debug->flag_table();
45
+    $Debug->error_table();
46
+    $Debug->sphinx_table();
47
+    $Debug->query_table();
48
+    $Debug->cache_table();
49
+    $Debug->vars_table();
50
+    $Debug->ocelot_table();
51
+    ?>
52 52
   </div>
53 53
   <!-- End Debugging -->
54
-<? } ?>
54
+<?php } ?>
55 55
 
56 56
 </div>
57
-<?
57
+<?php
58 58
 global $NotificationSpans;
59 59
 if (!empty($NotificationSpans)) {
60
-  foreach ($NotificationSpans as $Notification) {
61
-    echo "$Notification\n";
62
-  }
60
+    foreach ($NotificationSpans as $Notification) {
61
+        echo "$Notification\n";
62
+    }
63 63
 }
64 64
 ?>
65 65
 </body>

+ 187
- 190
design/privateheader.php View File

@@ -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']?>&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;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']?>&amp;user=<?=G::$LoggedUser['ID']?>&amp;auth=<?=G::$LoggedUser['RSS_Auth']?>&amp;passkey=<?=G::$LoggedUser['torrent_pass']?>&amp;authkey=<?=G::$LoggedUser['AuthKey']?>&amp;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&amp;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&amp;name=tokens">Tokens</a>:
296 294
             <span class="stat">
297 295
               <a href="userhistory.php?action=token_history&amp;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&amp;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&amp;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
 ?>

+ 0
- 0
design/publicfooter.php View File


+ 15
- 16
design/publicheader.php View File

@@ -1,6 +1,6 @@
1
-<?
1
+<?php
2 2
 global $LoggedUser;
3
-define('FOOTER_FILE',SERVER_ROOT.'/design/publicfooter.php');
3
+define('FOOTER_FILE', SERVER_ROOT.'/design/publicfooter.php');
4 4
 ?>
5 5
 <!DOCTYPE html>
6 6
 <html>
@@ -12,32 +12,31 @@ define('FOOTER_FILE',SERVER_ROOT.'/design/publicfooter.php');
12 12
   <link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico');?>">
13 13
   <link rel="manifest" href="/manifest.php">
14 14
   <link href="<?=STATIC_SERVER ?>styles/public/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/public/style.css')?>" rel="stylesheet" type="text/css">
15
-<?
15
+<?php
16 16
   $Scripts = ['jquery', 'global', 'ajax.class', 'cookie.class', 'storage.class', 'public', 'u2f'];
17
-  foreach($Scripts as $Script) {
17
+foreach ($Scripts as $Script) {
18 18
     if (($ScriptStats = G::$Cache->get_value("script_stats_$Script")) === false || $ScriptStats['mtime'] != filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js")) {
19
-      $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js");
20
-      $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true));
21
-      $ScriptStats['algo'] = INTEGRITY_ALGO;
22
-      G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
23
-    }
24
-?>
19
+        $ScriptStats['mtime'] = filemtime(SERVER_ROOT.STATIC_SERVER."functions/$Script.js");
20
+        $ScriptStats['hash'] = base64_encode(hash_file(INTEGRITY_ALGO, SERVER_ROOT.STATIC_SERVER."functions/$Script.js", true));
21
+        $ScriptStats['algo'] = INTEGRITY_ALGO;
22
+        G::$Cache->cache_value("script_stats_$Script", $ScriptStats);
23
+    } ?>
25 24
     <script src="<?=STATIC_SERVER."functions/$Script.js?v=$ScriptStats[mtime]"?>" type="text/javascript" integrity="<?="$ScriptStats[algo]-$ScriptStats[hash]"?>"></script>
26
-<?
27
-  }
25
+    <?php
26
+}
28 27
   $img = array_diff(scandir(SERVER_ROOT.'/misc/bg', 1), array('.', '..')); ?>
29
-  <meta name="bg_data" content="<?=$img[rand(0,count($img)-1)]?>">
28
+  <meta name="bg_data" content="<?=$img[rand(0, count($img)-1)]?>">
30 29
 </head>
31 30
 <body>
32 31
 <div id="head"><span>
33 32
 <a href="login.php">Log in</a>
34
-<? if (OPEN_REGISTRATION) { ?>
33
+<?php if (OPEN_REGISTRATION) { ?>
35 34
  | <a href="register.php">Register</a>
36
-<? } ?>
35
+<?php } ?>
37 36
 </span></div>
38 37
 <div id="content">
39 38
   <table class="layout" id="maincontent">
40 39
     <tr>
41 40
       <td class="centered">
42 41
         <a href="index.php"><div id="logo"></div></a>
43
-<?
42
+<?php

Loading…
Cancel
Save