Browse Source

Start using internal API calls to fetch database info

biotorrents 4 years ago
parent
commit
6d60b0baef

+ 300
- 0
sections/api/index.php View File

1
+<?php
2
+declare(strict_types = 1);
3
+
4
+/**
5
+ * AJAX Switch Center
6
+ *
7
+ * This page acts as an AJAX "switch" - it's called by scripts, and it includes the required pages.
8
+ * The required page is determined by $_GET['action'].
9
+ */
10
+
11
+# $_POST login cookie
12
+if (!isset($FullToken)) {
13
+    enforce_login();
14
+}
15
+
16
+
17
+/**
18
+ * These users aren't rate limited.
19
+ * This array should contain user IDs.
20
+ */
21
+
22
+# Get people with Donor permissions
23
+$Donors = $DB->query("
24
+SELECT
25
+  `ID`
26
+FROM
27
+  `users_main`
28
+WHERE
29
+  `PermissionID` = 20
30
+");
31
+
32
+# Add Donors to $UserExceptions or define manually
33
+if ($DB->record_count()) {
34
+    $UserExceptions = array_unique($DB->collect('ID'));
35
+} else {
36
+    $UserExceptions = array(
37
+      # 1, 2, 3, etc.
38
+    );
39
+}
40
+
41
+# System and admin fix
42
+array_push($UserExceptions, 0, 1);
43
+
44
+
45
+/**
46
+ * AJAX_LIMIT = array($x, $y) = $x requests every $y seconds,
47
+ * e.g., array(5, 10) = 5 requests every 10 seconds.
48
+ */
49
+$AJAX_LIMIT = array(1, 6);
50
+$UserID = $LoggedUser['ID'];
51
+
52
+# Set proper headers for JSON output
53
+# https://github.com/OPSnet/Gazelle/blob/master/sections/ajax/index.php
54
+if (!empty($_SERVER['CONTENT_TYPE']) && substr($_SERVER['CONTENT_TYPE'], 0, 16) === 'application/json') {
55
+    $_POST = json_decode(file_get_contents('php://input'), true);
56
+}
57
+header('Content-Type: application/json; charset=utf-8');
58
+
59
+#  Enforce rate limiting everywhere
60
+if (!in_array($UserID, $UserExceptions) && isset($_GET['action'])) {
61
+    if (!$UserRequests = $Cache->get_value("ajax_requests_$UserID")) {
62
+        $UserRequests = 0;
63
+        $Cache->cache_value("ajax_requests_$UserID", '0', $AJAX_LIMIT[1]);
64
+    }
65
+
66
+    if ($UserRequests > $AJAX_LIMIT[0]) {
67
+        json_die('failure', 'rate limit exceeded');
68
+    } else {
69
+        $Cache->increment_value("ajax_requests_$UserID");
70
+    }
71
+}
72
+
73
+
74
+/**
75
+ * Actions
76
+ */
77
+
78
+switch ($_GET['action']) {
79
+
80
+  /**
81
+   * Torrents
82
+   */
83
+
84
+  case 'torrent':
85
+    require 'torrents/torrent.php';
86
+    break;
87
+
88
+  case 'group':
89
+    require 'torrents/group.php';
90
+    break;
91
+
92
+  // So the album art script can function without breaking the rate limit
93
+  case 'torrentgroupalbumart':
94
+    require SERVER_ROOT.'/sections/ajax/torrentgroupalbumart.php';
95
+    break;
96
+
97
+  case 'browse':
98
+    require SERVER_ROOT.'/sections/ajax/browse.php';
99
+    break;
100
+  
101
+   case 'tcomments':
102
+    require SERVER_ROOT.'/sections/ajax/tcomments.php';
103
+    break;
104
+
105
+
106
+  /**
107
+   * Features
108
+   */
109
+
110
+  case 'collage':
111
+    require SERVER_ROOT.'/sections/ajax/collage.php';
112
+    break;
113
+  
114
+  case 'artist':
115
+    require SERVER_ROOT.'/sections/ajax/artist.php';
116
+    break;
117
+
118
+  case 'request':
119
+    require SERVER_ROOT.'/sections/ajax/request.php';
120
+    break;
121
+
122
+  case 'requests':
123
+    require SERVER_ROOT.'/sections/ajax/requests.php';
124
+    break;
125
+
126
+  case 'top10':
127
+    require SERVER_ROOT.'/sections/ajax/top10/index.php';
128
+    break;
129
+
130
+
131
+  /**
132
+   * Users
133
+   */
134
+
135
+  case 'user':
136
+    require SERVER_ROOT.'/sections/ajax/user.php';
137
+    break;
138
+
139
+  case 'usersearch':
140
+    require SERVER_ROOT.'/sections/ajax/usersearch.php';
141
+    break;
142
+  
143
+  case 'community_stats':
144
+    require SERVER_ROOT.'/sections/ajax/community_stats.php';
145
+    break;
146
+
147
+  case 'user_recents':
148
+    require SERVER_ROOT.'/sections/ajax/user_recents.php';
149
+    break;
150
+
151
+  case 'userhistory':
152
+    require SERVER_ROOT.'/sections/ajax/userhistory/index.php';
153
+    break;
154
+
155
+
156
+  /**
157
+   * Account
158
+   */
159
+
160
+  case 'inbox':
161
+    require SERVER_ROOT.'/sections/ajax/inbox/index.php';
162
+    break;
163
+
164
+  case 'bookmarks':
165
+    require SERVER_ROOT.'/sections/ajax/bookmarks/index.php';
166
+    break;
167
+
168
+  case 'notifications':
169
+    require SERVER_ROOT.'/sections/ajax/notifications.php';
170
+    break;
171
+
172
+  case 'get_user_notifications':
173
+    require SERVER_ROOT.'/sections/ajax/get_user_notifications.php';
174
+    break;
175
+
176
+  case 'clear_user_notification':
177
+    require SERVER_ROOT.'/sections/ajax/clear_user_notification.php';
178
+    break;
179
+
180
+
181
+  /**
182
+   * Forums
183
+   */
184
+
185
+  case 'forum':
186
+    require SERVER_ROOT.'/sections/ajax/forum/index.php';
187
+    break;
188
+
189
+
190
+  case 'subscriptions':
191
+    require SERVER_ROOT.'/sections/ajax/subscriptions.php';
192
+    break;
193
+
194
+  case 'raw_bbcode':
195
+    require SERVER_ROOT.'/sections/ajax/raw_bbcode.php';
196
+    break;
197
+
198
+
199
+  /**
200
+   * Meta
201
+   */
202
+
203
+  case 'index':
204
+    require SERVER_ROOT.'/sections/ajax/info.php';
205
+    break;
206
+
207
+  case 'manifest':
208
+    require SERVER_ROOT.'/manifest.php';
209
+    json_die('success', manifest());
210
+    break;
211
+
212
+  case 'stats':
213
+    require SERVER_ROOT.'/sections/ajax/stats.php';
214
+    break;
215
+
216
+  case 'loadavg':
217
+    require SERVER_ROOT.'/sections/ajax/loadavg.php';
218
+    break;
219
+
220
+  case 'announcements':
221
+    require SERVER_ROOT.'/sections/ajax/announcements.php';
222
+    break;
223
+
224
+  case 'wiki':
225
+    require SERVER_ROOT.'/sections/ajax/wiki.php';
226
+    break;
227
+  
228
+  case 'ontology':
229
+    require SERVER_ROOT.'/sections/ajax/ontology.php';
230
+    break;
231
+  
232
+
233
+  /**
234
+   * Under construction
235
+   */
236
+
237
+  case 'preview':
238
+    require 'preview.php';
239
+    break;
240
+
241
+  case 'better':
242
+    require SERVER_ROOT.'/sections/ajax/better/index.php';
243
+    break;
244
+
245
+  case 'get_friends':
246
+    require SERVER_ROOT.'/sections/ajax/get_friends.php';
247
+    break;
248
+
249
+  case 'news_ajax':
250
+    require SERVER_ROOT.'/sections/ajax/news_ajax.php';
251
+    break;
252
+
253
+  case 'send_recommendation':
254
+    require SERVER_ROOT.'/sections/ajax/send_recommendation.php';
255
+    break;
256
+
257
+  /*
258
+  case 'similar_artists':
259
+    require SERVER_ROOT.'/sections/ajax/similar_artists.php';
260
+    break;
261
+  */
262
+
263
+  /*
264
+  case 'votefavorite':
265
+    require SERVER_ROOT.'/sections/ajax/takevote.php';
266
+    break;
267
+  */
268
+
269
+  /*
270
+  case 'torrent_info':
271
+    require 'torrent_info.php';
272
+    break;
273
+  */
274
+
275
+  /*
276
+  case 'checkprivate':
277
+    include 'checkprivate.php';
278
+    break;
279
+  */
280
+
281
+  case 'autofill':
282
+    /*
283
+    if ($_GET['cat'] === 'anime') {
284
+        require SERVER_ROOT.'/sections/ajax/autofill/anime.php';
285
+    }
286
+
287
+    if ($_GET['cat'] === 'jav') {
288
+        require SERVER_ROOT.'/sections/ajax/autofill/jav.php';
289
+    }
290
+
291
+    if ($_GET['cat'] === 'manga') {
292
+        require SERVER_ROOT.'/sections/ajax/autofill/manga.php';
293
+    }
294
+    */
295
+    break;
296
+
297
+  default:
298
+    // If they're screwing around with the query string
299
+    json_die('failure');
300
+}

+ 101
- 0
sections/api/torrents/group.php View File

1
+<?php
2
+#declare(strict_types=1);
3
+
4
+require SERVER_ROOT.'/sections/torrents/functions.php';
5
+
6
+$GroupID = (int) $_GET['id'];
7
+$TorrentHash = (string) $_GET['hash'];
8
+
9
+if ($GroupID && $TorrentHash) {
10
+    json_die('failure', 'bad parameters');
11
+}
12
+
13
+if ($TorrentHash) {
14
+    if (!is_valid_torrenthash($TorrentHash)) {
15
+        json_die('failure', 'bad hash parameter');
16
+    } else {
17
+        $GroupID = (int) torrenthash_to_groupid($TorrentHash);
18
+        if (!$GroupID) {
19
+            json_die('failure', 'bad hash parameter');
20
+        }
21
+    }
22
+}
23
+
24
+if ($GroupID <= 0) {
25
+    json_die('failure', 'bad id parameter');
26
+}
27
+
28
+$TorrentCache = get_group_info($GroupID, true, 0, true, true);
29
+if (!$TorrentCache) {
30
+    json_die('failure', 'bad id parameter');
31
+}
32
+
33
+list($TorrentDetails, $TorrentList) = $TorrentCache;
34
+$Artists = Artists::get_artist($GroupID);
35
+
36
+if ($TorrentDetails['CategoryID'] === 0) {
37
+    $CategoryName = 'Unknown';
38
+} else {
39
+    $CategoryName = $Categories[$TorrentDetails['CategoryID'] - 1];
40
+}
41
+
42
+$TagList = explode('|', $TorrentDetails['GROUP_CONCAT(DISTINCT tags.Name SEPARATOR \'|\')']);
43
+
44
+$JsonTorrentDetails = [
45
+  'description'  => Text::full_format($TorrentDetails['WikiBody']),
46
+  'picture'      => $TorrentDetails['WikiImage'],
47
+  'id'           => (int) $TorrentDetails['ID'],
48
+  'name'         => $TorrentDetails['Name'],
49
+  'organism'     => $TorrentDetails['Title2'],
50
+  'strain'       => $TorrentDetails['NameJP'],
51
+  'authors'      => $Artists,
52
+  'year'         => (int) $TorrentDetails['Year'],
53
+  'accession'    => $TorrentDetails['CatalogueNumber'],
54
+  'categoryId'   => (int) $TorrentDetails['CategoryID'],
55
+  'categoryName' => $CategoryName,
56
+  'time'         => $TorrentDetails['Time'],
57
+  'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
58
+  'tags'         => $TagList
59
+];
60
+
61
+$JsonTorrentList = [];
62
+foreach ($TorrentList as $Torrent) {
63
+    // Convert file list back to the old format
64
+    $FileList = explode("\n", $Torrent['FileList']);
65
+    foreach ($FileList as &$File) {
66
+        $File = Torrents::filelist_old_format($File);
67
+    }
68
+
69
+    unset($File);
70
+    $FileList = implode('|||', $FileList);
71
+    $Userinfo = Users::user_info($Torrent['UserID']);
72
+
73
+    $Reports = Torrents::get_reports($Torrent['ID']);
74
+    $Torrent['Reported'] = count($Reports) > 0;
75
+
76
+    $JsonTorrentList[] = [
77
+      'id'          => (int) $Torrent['ID'],
78
+      'infoHash'    => $Torrent['InfoHash'],
79
+      'platform'    => $Torrent['Media'],
80
+      'format'      => $Torrent['Container'],
81
+      'license'     => $Torrent['Codec'],
82
+      'scope'       => $Torrent['Resolution'],
83
+      'annotated'   => (bool) $Torrent['Censored'],
84
+      'archive'     => $Torrent['Archive'],
85
+      'fileCount'   => (int) $Torrent['FileCount'],
86
+      'size'        => (int) $Torrent['Size'],
87
+      'seeders'     => (int) $Torrent['Seeders'],
88
+      'leechers'    => (int) $Torrent['Leechers'],
89
+      'snatched'    => (int) $Torrent['Snatched'],
90
+      'freeTorrent' => ($Torrent['FreeTorrent'] == 1),
91
+      'reported'    => (bool) $Torrent['Reported'],
92
+      'time'        => $Torrent['Time'],
93
+      'description' => $Torrent['Description'],
94
+      'fileList'    => $FileList,
95
+      'filePath'    => $Torrent['FilePath'],
96
+      'userId'      => (int) ($Torrent['Anonymous'] ? 0 : $Torrent['UserID']),
97
+      'username'    => ($Torrent['Anonymous'] ? 'Anonymous' : $Userinfo['Username'])
98
+    ];
99
+}
100
+
101
+json_die('success', ['group' => $JsonTorrentDetails, 'torrents' => $JsonTorrentList]);

+ 105
- 0
sections/api/torrents/torrent.php View File

1
+<?php
2
+#declare(strict_types=1);
3
+
4
+require SERVER_ROOT.'/sections/torrents/functions.php';
5
+
6
+$TorrentID = (int) $_GET['id'];
7
+$TorrentHash = (string) $_GET['hash'];
8
+
9
+if ($TorrentID && $TorrentHash) {
10
+    json_die('failure', 'bad parameters');
11
+}
12
+
13
+if ($TorrentHash) {
14
+    if (!is_valid_torrenthash($TorrentHash)) {
15
+        json_die('failure', 'bad hash parameter');
16
+    } else {
17
+        $TorrentID = (int) torrenthash_to_torrentid($TorrentHash);
18
+        if (!$TorrentID) {
19
+            json_die('failure', 'bad hash parameter');
20
+        }
21
+    }
22
+}
23
+
24
+if ($TorrentID <= 0) {
25
+    json_die('failure', 'bad id parameter');
26
+}
27
+
28
+$TorrentCache = get_torrent_info($TorrentID, true, 0, true, true);
29
+if (!$TorrentCache) {
30
+    json_die('failure', 'bad id parameter');
31
+}
32
+
33
+list($TorrentDetails, $TorrentList) = $TorrentCache;
34
+if (!isset($TorrentList[$TorrentID])) {
35
+    json_die('failure', 'bad id parameter');
36
+}
37
+
38
+$GroupID = $TorrentDetails['ID'];
39
+$Artists = Artists::get_artist($GroupID);
40
+
41
+if ($TorrentDetails['CategoryID'] === 0) {
42
+    $CategoryName = 'Unknown';
43
+} else {
44
+    $CategoryName = $Categories[$TorrentDetails['CategoryID'] - 1];
45
+}
46
+
47
+$TagList = explode('|', $TorrentDetails['GROUP_CONCAT(DISTINCT tags.Name SEPARATOR \'|\')']);
48
+
49
+$JsonTorrentDetails = [
50
+  'description'  => Text::full_format($TorrentDetails['WikiBody']),
51
+  'picture'      => $TorrentDetails['WikiImage'],
52
+  'id'           => (int) $TorrentDetails['ID'],
53
+  'name'         => $TorrentDetails['Name'],
54
+  'organism'     => $TorrentDetails['Title2'],
55
+  'strain'       => $TorrentDetails['NameJP'],
56
+  'authors'      => $Artists,
57
+  'year'         => (int) $TorrentDetails['Year'],
58
+  'accession'    => $TorrentDetails['CatalogueNumber'],
59
+  'categoryId'   => (int) $TorrentDetails['CategoryID'],
60
+  'categoryName' => $CategoryName,
61
+  'time'         => $TorrentDetails['Time'],
62
+  'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
63
+  'tags'         => $TagList
64
+];
65
+
66
+$Torrent = $TorrentList[$TorrentID];
67
+
68
+$Reports = Torrents::get_reports($TorrentID);
69
+$Torrent['Reported'] = (count($Reports) > 0);
70
+
71
+// Convert file list back to the old format
72
+$FileList = explode("\n", $Torrent['FileList']);
73
+foreach ($FileList as &$File) {
74
+    $File = Torrents::filelist_old_format($File);
75
+}
76
+
77
+unset($File);
78
+$FileList = implode('|||', $FileList);
79
+$Userinfo = Users::user_info($Torrent['UserID']);
80
+
81
+$JsonTorrentList[] = [
82
+  'id'          => (int) $Torrent['ID'],
83
+  'infoHash'    => $Torrent['InfoHash'],
84
+  'platform'    => $Torrent['Media'],
85
+  'format'      => $Torrent['Container'],
86
+  'license'     => $Torrent['Codec'],
87
+  'scope'       => $Torrent['Resolution'],
88
+  'annotated'   => (bool) $Torrent['Censored'],
89
+  'archive'     => $Torrent['Archive'],
90
+  'fileCount'   => (int) $Torrent['FileCount'],
91
+  'size'        => (int) $Torrent['Size'],
92
+  'seeders'     => (int) $Torrent['Seeders'],
93
+  'leechers'    => (int) $Torrent['Leechers'],
94
+  'snatched'    => (int) $Torrent['Snatched'],
95
+  'freeTorrent' => ($Torrent['FreeTorrent'] == 1),
96
+  'reported'    => (bool) $Torrent['Reported'],
97
+  'time'        => $Torrent['Time'],
98
+  'description' => $Torrent['Description'],
99
+  'fileList'    => $FileList,
100
+  'filePath'    => $Torrent['FilePath'],
101
+  'userId'      => (int) ($Torrent['Anonymous'] ? 0 : $Torrent['UserID']),
102
+  'username'    => ($Torrent['Anonymous'] ? 'Anonymous' : $Userinfo['Username'])
103
+];
104
+
105
+json_die('success', ['group' => $JsonTorrentDetails, 'torrent' => array_pop($JsonTorrentList)]);

+ 1
- 1
sections/pwgen/diceware.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 # Load the dictionary
4
 # Load the dictionary
5
 require_once 'wordlist.php';
5
 require_once 'wordlist.php';

+ 1
- 1
sections/pwgen/wordlist.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 # https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
4
 # https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
5
 $eff_large_wordlist = [
5
 $eff_large_wordlist = [

+ 1
- 1
sections/rules/chat.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 # Formerly Rules::display_forum_rules()
4
 # Formerly Rules::display_forum_rules()
5
 # and Rules::display_irc_chat_rules()
5
 # and Rules::display_irc_chat_rules()

+ 1
- 1
sections/rules/clients.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 View::show_header('Client rules');
4
 View::show_header('Client rules');
5
 
5
 

+ 1
- 1
sections/rules/collages.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 View::show_header('Collection rules');
4
 View::show_header('Collection rules');
5
 ?>
5
 ?>

+ 1
- 1
sections/rules/index.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 enforce_login();
4
 enforce_login();
5
 
5
 

+ 5
- 0
sections/rules/jump.php View File

1
+<?php
2
+declare(strict_types=1);
3
+
4
+?>
5
+
1
 <h3 id="jump">Other sections</h3>
6
 <h3 id="jump">Other sections</h3>
2
 <div class="box pad rule_table">
7
 <div class="box pad rule_table">
3
   <table>
8
   <table>

+ 1
- 1
sections/rules/ratio.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 View::show_header('Ratio requirements');
4
 View::show_header('Ratio requirements');
5
 ?>
5
 ?>

+ 1
- 1
sections/rules/requests.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 View::show_header('Request rules');
4
 View::show_header('Request rules');
5
 ?>
5
 ?>

+ 1
- 1
sections/rules/tag.php View File

1
 <?php
1
 <?php
2
-#declare(strict_types=1);
2
+declare(strict_types=1);
3
 
3
 
4
 # Formerly Rules::display_site_tag_rules()
4
 # Formerly Rules::display_site_tag_rules()
5
 View::show_header('Tagging rules');
5
 View::show_header('Tagging rules');

+ 206
- 149
sections/user/community_stats.php View File

1
-<?
1
+<?php
2
+declare(strict_types=1);
3
+
2
 $DB->query("
4
 $DB->query("
3
   SELECT Page, COUNT(1)
5
   SELECT Page, COUNT(1)
4
   FROM comments
6
   FROM comments
32
 list($UniqueGroups) = $DB->next_record();
34
 list($UniqueGroups) = $DB->next_record();
33
 
35
 
34
 ?>
36
 ?>
35
-    <div class="box box_info box_userinfo_community">
36
-      <div class="head colhead_dark">Community</div>
37
-      <ul class="stats nobullet">
38
-        <li id="comm_posts">Forum posts: <?=number_format($ForumPosts)?> <a href="userhistory.php?action=posts&amp;userid=<?=$UserID?>" class="brackets">View</a></li>
39
-        <li id="comm_irc">IRC lines: <?=number_format($IRCLines)?></li>
40
-<?php if ($Override = check_paranoia_here('torrentcomments+')) { ?>
41
-        <li id="comm_torrcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Torrent comments: <?=number_format($NumComments)?>
42
-<?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
43
-          <a href="comments.php?id=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
44
-<?php } ?>
45
-        </li>
46
-        <li id="comm_artcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Artist comments: <?=number_format($NumArtistComments)?>
47
-<?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
48
-          <a href="comments.php?id=<?=$UserID?>&amp;action=artist" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
49
-<?php } ?>
50
-        </li>
51
-        <li id="comm_collcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collage comments: <?=number_format($NumCollageComments)?>
52
-<?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
53
-          <a href="comments.php?id=<?=$UserID?>&amp;action=collages" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
54
-<?php } ?>
55
-        </li>
56
-        <li id="comm_reqcomm"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Request comments: <?=number_format($NumRequestComments)?>
57
-<?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
58
-          <a href="comments.php?id=<?=$UserID?>&amp;action=requests" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
59
-<?php } ?>
60
-        </li>
61
-<?
37
+<div class="box box_info box_userinfo_community">
38
+        <div class="head colhead_dark">Community</div>
39
+        <ul class="stats nobullet">
40
+                <li id="comm_posts">Forum posts: <?=number_format($ForumPosts)?> <a
41
+                                href="userhistory.php?action=posts&amp;userid=<?=$UserID?>"
42
+                                class="brackets">View</a></li>
43
+                <li id="comm_irc">IRC lines: <?=number_format($IRCLines)?>
44
+                </li>
45
+                <?php if ($Override = check_paranoia_here('torrentcomments+')) { ?>
46
+                <li id="comm_torrcomm" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Torrent
47
+                        comments: <?=number_format($NumComments)?>
48
+                        <?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
49
+                        <a href="comments.php?id=<?=$UserID?>"
50
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
51
+                        <?php } ?>
52
+                </li>
53
+                <li id="comm_artcomm" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Artist
54
+                        comments: <?=number_format($NumArtistComments)?>
55
+                        <?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
56
+                        <a href="comments.php?id=<?=$UserID?>&amp;action=artist"
57
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
58
+                        <?php } ?>
59
+                </li>
60
+                <li id="comm_collcomm" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collage
61
+                        comments: <?=number_format($NumCollageComments)?>
62
+                        <?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
63
+                        <a href="comments.php?id=<?=$UserID?>&amp;action=collages"
64
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
65
+                        <?php } ?>
66
+                </li>
67
+                <li id="comm_reqcomm" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Request
68
+                        comments: <?=number_format($NumRequestComments)?>
69
+                        <?php if ($Override = check_paranoia_here('torrentcomments')) { ?>
70
+                        <a href="comments.php?id=<?=$UserID?>&amp;action=requests"
71
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
72
+                        <?php } ?>
73
+                </li>
74
+                <?php
62
   }
75
   }
63
   if (($Override = check_paranoia_here('collages+'))) { ?>
76
   if (($Override = check_paranoia_here('collages+'))) { ?>
64
-        <li id="comm_collstart"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages started: <?=number_format($NumCollages)?>
65
-<?php if ($Override = check_paranoia_here('collages')) { ?>
66
-          <a href="collages.php?userid=<?=$UserID?>" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
67
-<?php } ?>
68
-        </li>
69
-<?
77
+                <li id="comm_collstart" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages
78
+                        started: <?=number_format($NumCollages)?>
79
+                        <?php if ($Override = check_paranoia_here('collages')) { ?>
80
+                        <a href="collages.php?userid=<?=$UserID?>"
81
+                                class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
82
+                        <?php } ?>
83
+                </li>
84
+                <?php
70
   }
85
   }
71
   if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
86
   if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
72
-        <li id="comm_collcontrib"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
73
-<?php if ($Override = check_paranoia_here('collagecontribs')) { ?>
74
-          <a href="collages.php?userid=<?=$UserID?>&amp;contrib=1" class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
75
-<?php } ?>
76
-        </li>
77
-<?
87
+                <li id="comm_collcontrib" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Collages
88
+                        contributed to:
89
+                        <?php echo number_format($NumCollageContribs); ?>
90
+                        <?php if ($Override = check_paranoia_here('collagecontribs')) { ?>
91
+                        <a href="collages.php?userid=<?=$UserID?>&amp;contrib=1"
92
+                                class="brackets<?=(($Override === 2) ? ' paranoia_override' : '')?>">View</a>
93
+                        <?php } ?>
94
+                </li>
95
+                <?php
78
   }
96
   }
79
 
97
 
80
   //Let's see if we can view requests because of reasons
98
   //Let's see if we can view requests because of reasons
83
   $ViewBounty = check_paranoia_here('requestsfilled_bounty');
101
   $ViewBounty = check_paranoia_here('requestsfilled_bounty');
84
 
102
 
85
   if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
103
   if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
86
-        <li>Requests filled: <?=number_format($RequestsFilled)?></li>
87
-<?php } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
88
-        <li>Requests filled: <?=Format::get_size($TotalBounty)?> collected</li>
89
-<?php } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
90
-        <li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?></li>
91
-<?php } elseif ($ViewAll) { ?>
92
-        <li>
93
-          <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests filled: <?=number_format($RequestsFilled)?></span>
94
-          <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalBounty) ?></span>
95
-          <a href="requests.php?type=filled&amp;userid=<?=$UserID?>" class="brackets<?=(($ViewAll === 2) ? ' paranoia_override' : '')?>">View</a>
96
-        </li>
97
-<?
104
+                <li>Requests filled: <?=number_format($RequestsFilled)?>
105
+                </li>
106
+                <?php } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
107
+                <li>Requests filled: <?=Format::get_size($TotalBounty)?> collected</li>
108
+                <?php } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
109
+                <li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?>
110
+                </li>
111
+                <?php } elseif ($ViewAll) { ?>
112
+                <li>
113
+                        <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests
114
+                                filled: <?=number_format($RequestsFilled)?></span>
115
+                                <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>>
116
+                                        for <?=Format::get_size($TotalBounty) ?></span>
117
+                                        <a href="requests.php?type=filled&amp;userid=<?=$UserID?>"
118
+                                                class="brackets<?=(($ViewAll === 2) ? ' paranoia_override' : '')?>">View</a>
119
+                </li>
120
+                <?php
98
   }
121
   }
99
 
122
 
100
   //Let's see if we can view requests because of reasons
123
   //Let's see if we can view requests because of reasons
103
   $ViewBounty = check_paranoia_here('requestsvoted_bounty');
126
   $ViewBounty = check_paranoia_here('requestsvoted_bounty');
104
 
127
 
105
   if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
128
   if ($ViewCount && !$ViewBounty && !$ViewAll) { ?>
106
-        <li>Requests created: <?=number_format($RequestsCreated)?></li>
107
-        <li>Requests voted: <?=number_format($RequestsVoted)?></li>
108
-<?php } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
109
-        <li>Requests created: <?=Format::get_size($RequestsCreatedSpent)?> spent</li>
110
-        <li>Requests voted: <?=Format::get_size($TotalSpent)?> spent</li>
111
-<?php } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
112
-        <li>Requests created: <?=number_format($RequestsCreated)?> for <?=Format::get_size($RequestsCreatedSpent)?></li>
113
-        <li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?></li>
114
-<?php } elseif ($ViewAll) { ?>
115
-        <li>
116
-          <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests created: <?=number_format($RequestsCreated)?></span>
117
-          <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($RequestsCreatedSpent)?></span>
118
-          <a href="requests.php?type=created&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
119
-        </li>
120
-        <li>
121
-          <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests voted: <?=number_format($RequestsVoted)?></span>
122
-          <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>> for <?=Format::get_size($TotalSpent)?></span>
123
-          <a href="requests.php?type=voted&amp;userid=<?=$UserID?>" class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
124
-        </li>
125
-<?
129
+                <li>Requests created: <?=number_format($RequestsCreated)?>
130
+                </li>
131
+                <li>Requests voted: <?=number_format($RequestsVoted)?>
132
+                </li>
133
+                <?php } elseif (!$ViewCount && $ViewBounty && !$ViewAll) { ?>
134
+                <li>Requests created: <?=Format::get_size($RequestsCreatedSpent)?> spent
135
+                </li>
136
+                <li>Requests voted: <?=Format::get_size($TotalSpent)?> spent</li>
137
+                <?php } elseif ($ViewCount && $ViewBounty && !$ViewAll) { ?>
138
+                <li>Requests created: <?=number_format($RequestsCreated)?> for <?=Format::get_size($RequestsCreatedSpent)?>
139
+                </li>
140
+                <li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?>
141
+                </li>
142
+                <?php } elseif ($ViewAll) { ?>
143
+                <li>
144
+                        <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests
145
+                                created: <?=number_format($RequestsCreated)?></span>
146
+                                <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>>
147
+                                        for <?=Format::get_size($RequestsCreatedSpent)?></span>
148
+                                        <a href="requests.php?type=created&amp;userid=<?=$UserID?>"
149
+                                                class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
150
+                </li>
151
+                <li>
152
+                        <span<?=($ViewCount === 2 ? ' class="paranoia_override"' : '')?>>Requests
153
+                                voted: <?=number_format($RequestsVoted)?></span>
154
+                                <span<?=($ViewBounty === 2 ? ' class="paranoia_override"' : '')?>>
155
+                                        for <?=Format::get_size($TotalSpent)?></span>
156
+                                        <a href="requests.php?type=voted&amp;userid=<?=$UserID?>"
157
+                                                class="brackets<?=($ViewAll === 2 ? ' paranoia_override' : '')?>">View</a>
158
+                </li>
159
+                <?php
126
   }
160
   }
127
 
161
 
128
   if ($Override = check_paranoia_here('screenshotcount')) {
162
   if ($Override = check_paranoia_here('screenshotcount')) {
129
-  $DB->query("
163
+      $DB->query("
130
     SELECT COUNT(*)
164
     SELECT COUNT(*)
131
     FROM torrents_doi
165
     FROM torrents_doi
132
     WHERE UserID = '$UserID'");
166
     WHERE UserID = '$UserID'");
133
-  list($Screenshots) = $DB->next_record();
134
-?>
135
-        <li id="comm_screenshots">Screenshots added: <?=number_format($Screenshots)?></li>
136
-<?
167
+      list($Screenshots) = $DB->next_record(); ?>
168
+                <li id="comm_screenshots">Screenshots added: <?=number_format($Screenshots)?>
169
+                </li>
170
+                <?php
137
   }
171
   }
138
 
172
 
139
   if ($Override = check_paranoia_here('uploads+')) { ?>
173
   if ($Override = check_paranoia_here('uploads+')) { ?>
140
-        <li id="comm_upload"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Uploaded: <?=number_format($Uploads)?>
141
-<?php if ($Override = check_paranoia_here('uploads')) { ?>
142
-          <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
143
-<?php if (check_perms('zip_downloader')) { ?>
144
-          <a href="torrents.php?action=redownload&amp;type=uploads&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">Download</a>
145
-<?
174
+                <li id="comm_upload" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Uploaded:
175
+                        <?=number_format($Uploads)?>
176
+                        <?php if ($Override = check_paranoia_here('uploads')) { ?>
177
+                        <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>"
178
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
179
+                        <?php if (check_perms('zip_downloader')) { ?>
180
+                        <a href="torrents.php?action=redownload&amp;type=uploads&amp;userid=<?=$UserID?>"
181
+                                onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');"
182
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">Download</a>
183
+                        <?php
146
             }
184
             }
147
           }
185
           }
148
 ?>
186
 ?>
149
-        </li>
150
-<?
187
+                </li>
188
+                <?php
151
   }
189
   }
152
   if ($Override = check_paranoia_here('uniquegroups+')) { ?>
190
   if ($Override = check_paranoia_here('uniquegroups+')) { ?>
153
-        <li id="comm_uniquegroup"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Unique groups: <?=number_format($UniqueGroups)?>
154
-<?php if ($Override = check_paranoia_here('uniquegroups')) { ?>
155
-          <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>&amp;filter=uniquegroup" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
156
-<?php } ?>
157
-        </li>
158
-<?
191
+                <li id="comm_uniquegroup" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Unique
192
+                        groups: <?=number_format($UniqueGroups)?>
193
+                        <?php if ($Override = check_paranoia_here('uniquegroups')) { ?>
194
+                        <a href="torrents.php?type=uploaded&amp;userid=<?=$UserID?>&amp;filter=uniquegroup"
195
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
196
+                        <?php } ?>
197
+                </li>
198
+                <?php
159
   }
199
   }
160
   if ($Override = check_paranoia_here('seeding+')) {
200
   if ($Override = check_paranoia_here('seeding+')) {
161
-?>
162
-        <li id="comm_seeding"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Seeding:
163
-          <span class="user_commstats" id="user_commstats_seeding"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
164
-<?php if ($Override = check_paranoia_here('snatched+')) { ?>
165
-          <span<?=($Override === 2 ? ' class="paranoia_override"' : '')?> id="user_commstats_seedingperc"></span>
166
-<?
201
+      ?>
202
+                <li id="comm_seeding" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Seeding:
203
+                        <span class="user_commstats" id="user_commstats_seeding"><a href="#" class="brackets"
204
+                                        onclick="commStats(<?=$UserID?>); return false;">Show
205
+                                        stats</a></span>
206
+                        <?php if ($Override = check_paranoia_here('snatched+')) { ?>
207
+                        <span<?=($Override === 2 ? ' class="paranoia_override"' : '')?>
208
+                                id="user_commstats_seedingperc"></span>
209
+                                <?php
167
     }
210
     }
168
-    if ($Override = check_paranoia_here('seeding')) {
169
-?>
170
-          <a href="torrents.php?type=seeding&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
171
-<?php if (check_perms('zip_downloader')) { ?>
172
-          <a href="torrents.php?action=redownload&amp;type=seeding&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets">Download</a>
173
-<?
211
+      if ($Override = check_paranoia_here('seeding')) {
212
+          ?>
213
+                                <a href="torrents.php?type=seeding&amp;userid=<?=$UserID?>"
214
+                                        class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
215
+                                <?php if (check_perms('zip_downloader')) { ?>
216
+                                <a href="torrents.php?action=redownload&amp;type=seeding&amp;userid=<?=$UserID?>"
217
+                                        onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');"
218
+                                        class="brackets">Download</a>
219
+                                <?php
174
       }
220
       }
175
-    }
176
-?>
177
-        </li>
178
-<?
221
+      } ?>
222
+                </li>
223
+                <?php
179
   }
224
   }
180
   if ($Override = check_paranoia_here('leeching+')) {
225
   if ($Override = check_paranoia_here('leeching+')) {
181
-?>
182
-        <li id="comm_leeching"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Leeching:
183
-          <span class="user_commstats" id="user_commstats_leeching"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
184
-<?php if ($Override = check_paranoia_here('leeching')) { ?>
185
-          <a href="torrents.php?type=leeching&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
186
-<?
226
+      ?>
227
+                <li id="comm_leeching" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Leeching:
228
+                        <span class="user_commstats" id="user_commstats_leeching"><a href="#" class="brackets"
229
+                                        onclick="commStats(<?=$UserID?>); return false;">Show
230
+                                        stats</a></span>
231
+                        <?php if ($Override = check_paranoia_here('leeching')) { ?>
232
+                        <a href="torrents.php?type=leeching&amp;userid=<?=$UserID?>"
233
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
234
+                        <?php
187
     }
235
     }
188
-    if ($DisableLeech == 0 && check_perms('users_view_ips')) {
189
-?>
190
-          <strong>(Disabled)</strong>
191
-<?php } ?>
192
-        </li>
193
-<?
236
+      if ($DisableLeech == 0 && check_perms('users_view_ips')) {
237
+          ?>
238
+                        <strong>(Disabled)</strong>
239
+                        <?php
240
+      } ?>
241
+                </li>
242
+                <?php
194
   }
243
   }
195
   if ($Override = check_paranoia_here('snatched+')) { ?>
244
   if ($Override = check_paranoia_here('snatched+')) { ?>
196
-        <li id="comm_snatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Snatched:
197
-          <span class="user_commstats" id="user_commstats_snatched"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
198
-<?php if ($Override = check_perms('site_view_torrent_snatchlist', $Class)) { ?>
199
-          <span id="user_commstats_usnatched"<?=($Override === 2 ? ' class="paranoia_override"' : '')?>></span>
200
-<?
245
+                <li id="comm_snatched" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Snatched:
246
+                        <span class="user_commstats" id="user_commstats_snatched"><a href="#" class="brackets"
247
+                                        onclick="commStats(<?=$UserID?>); return false;">Show
248
+                                        stats</a></span>
249
+                        <?php if ($Override = check_perms('site_view_torrent_snatchlist', $Class)) { ?>
250
+                        <span id="user_commstats_usnatched" <?=($Override === 2 ? ' class="paranoia_override"' : '')?>></span>
251
+                        <?php
201
     }
252
     }
202
   }
253
   }
203
   if ($Override = check_paranoia_here('snatched')) { ?>
254
   if ($Override = check_paranoia_here('snatched')) { ?>
204
-          <a href="torrents.php?type=snatched&amp;userid=<?=$UserID?>" class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
205
-<?php if (check_perms('zip_downloader')) { ?>
206
-          <a href="torrents.php?action=redownload&amp;type=snatches&amp;userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected, be sure to check the size of all torrents before redownloading.');" class="brackets">Download</a>
207
-<?php } ?>
208
-        </li>
209
-<?
255
+                        <a href="torrents.php?type=snatched&amp;userid=<?=$UserID?>"
256
+                                class="brackets<?=($Override === 2 ? ' paranoia_override' : '')?>">View</a>
257
+                        <?php if (check_perms('zip_downloader')) { ?>
258
+                        <a href="torrents.php?action=redownload&amp;type=snatches&amp;userid=<?=$UserID?>"
259
+                                onclick="return confirm('If you no longer have the content, your ratio WILL be affected, be sure to check the size of all torrents before redownloading.');"
260
+                                class="brackets">Download</a>
261
+                        <?php } ?>
262
+                </li>
263
+                <?php
210
   }
264
   }
211
   if (check_perms('site_view_torrent_snatchlist', $Class)) {
265
   if (check_perms('site_view_torrent_snatchlist', $Class)) {
212
-?>
213
-        <li id="comm_downloaded">Downloaded:
214
-          <span class="user_commstats" id="user_commstats_downloaded"><a href="#" class="brackets" onclick="commStats(<?=$UserID?>); return false;">Show stats</a></span>
215
-          <span id="user_commstats_udownloaded"></span>
216
-          <a href="torrents.php?type=downloaded&amp;userid=<?=$UserID?>" class="brackets">View</a>
217
-        </li>
218
-<?
266
+      ?>
267
+                <li id="comm_downloaded">Downloaded:
268
+                        <span class="user_commstats" id="user_commstats_downloaded"><a href="#" class="brackets"
269
+                                        onclick="commStats(<?=$UserID?>); return false;">Show
270
+                                        stats</a></span>
271
+                        <span id="user_commstats_udownloaded"></span>
272
+                        <a href="torrents.php?type=downloaded&amp;userid=<?=$UserID?>"
273
+                                class="brackets">View</a>
274
+                </li>
275
+                <?php
219
   }
276
   }
220
   if ($Override = check_paranoia_here('invitedcount')) {
277
   if ($Override = check_paranoia_here('invitedcount')) {
221
-  $DB->query("
278
+      $DB->query("
222
     SELECT COUNT(UserID)
279
     SELECT COUNT(UserID)
223
     FROM users_info
280
     FROM users_info
224
     WHERE Inviter = '$UserID'");
281
     WHERE Inviter = '$UserID'");
225
-  list($Invited) = $DB->next_record();
226
-?>
227
-        <li id="comm_invited">Invited: <?=number_format($Invited)?></li>
228
-<?
282
+      list($Invited) = $DB->next_record(); ?>
283
+                <li id="comm_invited">Invited: <?=number_format($Invited)?>
284
+                </li>
285
+                <?php
229
   }
286
   }
230
 ?>
287
 ?>
231
-      </ul>
232
-<?php if ($LoggedUser['AutoloadCommStats']) { ?>
233
-      <script type="text/javascript">
234
-        commStats(<?=$UserID?>);
235
-      </script>
236
-<?php } ?>
237
-    </div>
288
+        </ul>
289
+        <?php if ($LoggedUser['AutoloadCommStats']) { ?>
290
+        <script type="text/javascript">
291
+                commStats( <?=$UserID?> );
292
+        </script>
293
+        <?php } ?>
294
+</div>

+ 13
- 12
sections/user/delete_invite.php View File

1
-<?
1
+<?php
2
+declare(strict_types=1);
3
+
2
 authorize();
4
 authorize();
3
 
5
 
4
 $InviteKey = db_string($_GET['invite']);
6
 $InviteKey = db_string($_GET['invite']);
8
   WHERE InviteKey = ?", $InviteKey);
10
   WHERE InviteKey = ?", $InviteKey);
9
 list($UserID) = $DB->next_record();
11
 list($UserID) = $DB->next_record();
10
 if (!$DB->has_results()) {
12
 if (!$DB->has_results()) {
11
-  error(404);
13
+    error(404);
12
 }
14
 }
13
 if ($UserID != $LoggedUser['ID'] && $LoggedUser['PermissionID'] != SYSOP) {
15
 if ($UserID != $LoggedUser['ID'] && $LoggedUser['PermissionID'] != SYSOP) {
14
-  error(403);
16
+    error(403);
15
 }
17
 }
16
 
18
 
17
 $DB->query("
19
 $DB->query("
19
   WHERE InviteKey = ?", $InviteKey);
21
   WHERE InviteKey = ?", $InviteKey);
20
 
22
 
21
 if (!check_perms('site_send_unlimited_invites')) {
23
 if (!check_perms('site_send_unlimited_invites')) {
22
-  $DB->query("
24
+    $DB->query("
23
     SELECT Invites
25
     SELECT Invites
24
     FROM users_main
26
     FROM users_main
25
     WHERE ID = ?
27
     WHERE ID = ?
26
     LIMIT 1", $UserID);
28
     LIMIT 1", $UserID);
27
-  list($Invites) = $DB->next_record();
28
-  if ($Invites < 10) {
29
-    $DB->query("
29
+    list($Invites) = $DB->next_record();
30
+    if ($Invites < 10) {
31
+        $DB->query("
30
       UPDATE users_main
32
       UPDATE users_main
31
       SET Invites = Invites + 1
33
       SET Invites = Invites + 1
32
       WHERE ID = ?", $UserID);
34
       WHERE ID = ?", $UserID);
33
-    $Cache->begin_transaction("user_info_heavy_$UserID");
34
-    $Cache->update_row(false, ['Invites' => '+1']);
35
-    $Cache->commit_transaction(0);
36
-  }
35
+        $Cache->begin_transaction("user_info_heavy_$UserID");
36
+        $Cache->update_row(false, ['Invites' => '+1']);
37
+        $Cache->commit_transaction(0);
38
+    }
37
 }
39
 }
38
 header('Location: user.php?action=invite');
40
 header('Location: user.php?action=invite');
39
-?>

+ 18
- 16
sections/user/donor_stats.php View File

1
-<?
1
+<?php
2
+declare(strict_types=1);
3
+
2
 if (check_perms('users_mod') || $OwnProfile || Donations::is_visible($UserID)) { ?>
4
 if (check_perms('users_mod') || $OwnProfile || Donations::is_visible($UserID)) { ?>
3
-  <div class="box box_info box_userinfo_donor_stats">
4
-    <div class="head colhead_dark">Donor Statistics</div>
5
-    <ul class="stats nobullet">
6
-      <li>
7
-        Total donor points: <?=Donations::get_total_rank($UserID)?>
8
-      </li>
9
-      <li>
10
-        Current donor rank: <?=Donations::render_rank(Donations::get_rank($UserID), true)?>
11
-      </li>
12
-      <li>
13
-        Last donated: <?=time_diff(Donations::get_donation_time($UserID))?>
14
-      </li>
15
-    </ul>
16
-  </div>
17
-<?
5
+<div class="box box_info box_userinfo_donor_stats">
6
+  <div class="head colhead_dark">Donor Statistics</div>
7
+  <ul class="stats nobullet">
8
+    <li>
9
+      Total donor points: <?=Donations::get_total_rank($UserID)?>
10
+    </li>
11
+    <li>
12
+      Current donor rank: <?=Donations::render_rank(Donations::get_rank($UserID), true)?>
13
+    </li>
14
+    <li>
15
+      Last donated: <?=time_diff(Donations::get_donation_time($UserID))?>
16
+    </li>
17
+  </ul>
18
+</div>
19
+<?php
18
 }
20
 }

+ 0
- 3
sections/user/lastfm.php View File

1
-<?php
2
-#declare(strict_types=1);
3
-

+ 12
- 11
sections/user/manage_linked.php View File

1
-<?
1
+<?php
2
+declare(strict_types=1);
3
+
2
 authorize();
4
 authorize();
3
 include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
5
 include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
4
 
6
 
5
 if (!check_perms('users_mod')) {
7
 if (!check_perms('users_mod')) {
6
-  error(403);
8
+    error(403);
7
 }
9
 }
8
 
10
 
9
 $UserID = (int) $_REQUEST['userid'];
11
 $UserID = (int) $_REQUEST['userid'];
15
 
17
 
16
   case 'update':
18
   case 'update':
17
     if ($_REQUEST['target']) {
19
     if ($_REQUEST['target']) {
18
-      $Target = $_REQUEST['target'];
19
-      $DB->query("
20
+        $Target = $_REQUEST['target'];
21
+        $DB->query("
20
         SELECT ID
22
         SELECT ID
21
         FROM users_main
23
         FROM users_main
22
         WHERE Username LIKE '".db_string($Target)."'");
24
         WHERE Username LIKE '".db_string($Target)."'");
23
-      if (list($TargetID) = $DB->next_record()) {
24
-        link_users($UserID, $TargetID);
25
-      } else {
26
-        error("User '$Target' not found.");
27
-      }
25
+        if (list($TargetID) = $DB->next_record()) {
26
+            link_users($UserID, $TargetID);
27
+        } else {
28
+            error("User '$Target' not found.");
29
+        }
28
     }
30
     }
29
 
31
 
30
     $DB->query("
32
     $DB->query("
34
     list($GroupID) = $DB->next_record();
36
     list($GroupID) = $DB->next_record();
35
 
37
 
36
     if ($_REQUEST['dupecomments'] && $GroupID) {
38
     if ($_REQUEST['dupecomments'] && $GroupID) {
37
-      dupe_comments($GroupID, $_REQUEST['dupecomments']);
39
+        dupe_comments($GroupID, $_REQUEST['dupecomments']);
38
     }
40
     }
39
     break;
41
     break;
40
 
42
 
43
 }
45
 }
44
 echo '\o/';
46
 echo '\o/';
45
 header("Location: user.php?id=$UserID");
47
 header("Location: user.php?id=$UserID");
46
-?>

+ 61
- 46
sections/user/permissions.php View File

1
-<?
1
+<?php
2
+declare(strict_types=1);
3
+
2
 // todo: Redo HTML
4
 // todo: Redo HTML
3
 if (!check_perms('admin_manage_permissions')) {
5
 if (!check_perms('admin_manage_permissions')) {
4
-  error(403);
6
+    error(403);
5
 }
7
 }
6
 if (!isset($_REQUEST['userid']) || !is_number($_REQUEST['userid'])) {
8
 if (!isset($_REQUEST['userid']) || !is_number($_REQUEST['userid'])) {
7
-  error(404);
9
+    error(404);
8
 }
10
 }
9
 
11
 
10
 include(SERVER_ROOT."/classes/permissions_form.php");
12
 include(SERVER_ROOT."/classes/permissions_form.php");
23
 
25
 
24
 $Delta = [];
26
 $Delta = [];
25
 if (isset($_POST['action'])) {
27
 if (isset($_POST['action'])) {
26
-  authorize();
28
+    authorize();
27
 
29
 
28
-  foreach ($PermissionsArray as $Perm => $Explaination) {
29
-    $Setting = isset($_POST["perm_$Perm"]) ? 1 : 0;
30
-    $Default = isset($Defaults[$Perm]) ? 1 : 0;
31
-    if ($Setting != $Default) {
32
-      $Delta[$Perm] = $Setting;
30
+    foreach ($PermissionsArray as $Perm => $Explaination) {
31
+        $Setting = isset($_POST["perm_$Perm"]) ? 1 : 0;
32
+        $Default = isset($Defaults[$Perm]) ? 1 : 0;
33
+        if ($Setting != $Default) {
34
+            $Delta[$Perm] = $Setting;
35
+        }
33
     }
36
     }
34
-  }
35
-  if (!is_number($_POST['maxcollages']) && !empty($_POST['maxcollages'])) {
36
-    error("Please enter a valid number of extra personal collages");
37
-  }
38
-  $Delta['MaxCollages'] = $_POST['maxcollages'];
37
+    if (!is_number($_POST['maxcollages']) && !empty($_POST['maxcollages'])) {
38
+        error("Please enter a valid number of extra personal collages");
39
+    }
40
+    $Delta['MaxCollages'] = $_POST['maxcollages'];
39
 
41
 
40
-  $Cache->begin_transaction("user_info_heavy_$UserID");
41
-  $Cache->update_row(false, array('CustomPermissions' => $Delta));
42
-  $Cache->commit_transaction(0);
43
-  $DB->query("
42
+    $Cache->begin_transaction("user_info_heavy_$UserID");
43
+    $Cache->update_row(false, array('CustomPermissions' => $Delta));
44
+    $Cache->commit_transaction(0);
45
+    $DB->query("
44
     UPDATE users_main
46
     UPDATE users_main
45
     SET CustomPermissions = '".db_string(serialize($Delta))."'
47
     SET CustomPermissions = '".db_string(serialize($Delta))."'
46
     WHERE ID = '$UserID'");
48
     WHERE ID = '$UserID'");
47
 } elseif (!empty($Customs)) {
49
 } elseif (!empty($Customs)) {
48
-  $Delta = unserialize($Customs);
50
+    $Delta = unserialize($Customs);
49
 }
51
 }
50
 
52
 
51
 $Permissions = array_merge($Defaults, $Delta);
53
 $Permissions = array_merge($Defaults, $Delta);
52
 $MaxCollages = $Customs['MaxCollages'] + $Delta['MaxCollages'];
54
 $MaxCollages = $Customs['MaxCollages'] + $Delta['MaxCollages'];
53
 
55
 
54
-function display_perm($Key, $Title) {
55
-  global $Defaults, $Permissions;
56
-  $Perm = "<input id=\"default_$Key\" type=\"checkbox\" disabled=\"disabled\"";
57
-  if (isset($Defaults[$Key]) && $Defaults[$Key]) {
58
-    $Perm .= ' checked="checked"';
59
-  }
60
-  $Perm .= " /><input type=\"checkbox\" name=\"perm_$Key\" id=\"$Key\" value=\"1\"";
61
-  if (isset($Permissions[$Key]) && $Permissions[$Key]) {
62
-    $Perm .= ' checked="checked"';
63
-  }
64
-  $Perm .= " /> <label for=\"$Key\">$Title</label><br />";
65
-  echo "$Perm\n";
56
+function display_perm($Key, $Title)
57
+{
58
+    global $Defaults, $Permissions;
59
+    $Perm = "<input id=\"default_$Key\" type=\"checkbox\" disabled=\"disabled\"";
60
+    if (isset($Defaults[$Key]) && $Defaults[$Key]) {
61
+        $Perm .= ' checked="checked"';
62
+    }
63
+    $Perm .= " /><input type=\"checkbox\" name=\"perm_$Key\" id=\"$Key\" value=\"1\"";
64
+    if (isset($Permissions[$Key]) && $Permissions[$Key]) {
65
+        $Perm .= ' checked="checked"';
66
+    }
67
+    $Perm .= " /> <label for=\"$Key\">$Title</label><br />";
68
+    echo "$Perm\n";
66
 }
69
 }
67
 
70
 
68
 View::show_header("$Username &gt; Permissions");
71
 View::show_header("$Username &gt; Permissions");
69
 ?>
72
 ?>
70
-<script type="text/javascript">//<![CDATA[
71
-function reset() {
72
-  for (i = 0; i < $('#permissionsform').raw().elements.length; i++) {
73
-    element = $('#permissionsform').raw().elements[i];
74
-    if (element.id.substr(0, 8) == 'default_') {
75
-      $('#' + element.id.substr(8)).raw().checked = element.checked;
73
+<script type="text/javascript">
74
+  //<![CDATA[
75
+  function reset() {
76
+    for (i = 0; i < $('#permissionsform').raw().elements.length; i++) {
77
+      element = $('#permissionsform').raw().elements[i];
78
+      if (element.id.substr(0, 8) == 'default_') {
79
+        $('#' + element.id.substr(8)).raw().checked = element.checked;
80
+      }
76
     }
81
     }
77
   }
82
   }
78
-}
79
-//]]>
83
+  //]]>
80
 </script>
84
 </script>
81
 <div class="header">
85
 <div class="header">
82
-  <h2><?=Users::format_username($UserID, false, false, false)?> &gt; Permissions</h2>
86
+  <h2><?=Users::format_username($UserID, false, false, false)?> &gt;
87
+    Permissions</h2>
83
   <div class="linkbox">
88
   <div class="linkbox">
84
     <a href="#" onclick="reset(); return false;" class="brackets">Defaults</a>
89
     <a href="#" onclick="reset(); return false;" class="brackets">Defaults</a>
85
   </div>
90
   </div>
86
 </div>
91
 </div>
87
 <div class="box pad">
92
 <div class="box pad">
88
-  <p>Before using permissions, please understand that it allows you to both add and remove access to specific features. If you think that to add access to a feature, you need to uncheck everything else, <strong>YOU ARE WRONG</strong>. The check boxes on the left, which are grayed out, are the standard permissions granted by their class (and donor/artist status). Any changes you make to the right side will overwrite this. It's not complicated, and if you screw up, click the "Defaults" link at the top. It will reset the user to their respective features granted by class, then you can select or deselect the one or two things you want to change. <strong>DO NOT DESELECT EVERYTHING.</strong> If you need further clarification, ask a developer before using this tool.</p>
93
+  <p>Before using permissions, please understand that it allows you to both add and remove access to specific features.
94
+    If you think that to add access to a feature, you need to uncheck everything else, <strong>YOU ARE WRONG</strong>.
95
+    The check boxes on the left, which are grayed out, are the standard permissions granted by their class (and
96
+    donor/artist status). Any changes you make to the right side will overwrite this. It's not complicated, and if you
97
+    screw up, click the "Defaults" link at the top. It will reset the user to their respective features granted by
98
+    class, then you can select or deselect the one or two things you want to change. <strong>DO NOT DESELECT
99
+      EVERYTHING.</strong> If you need further clarification, ask a developer before using this tool.</p>
89
 </div>
100
 </div>
90
 <br />
101
 <br />
91
 <form class="manage_form" name="permissions" id="permissionsform" method="post" action="">
102
 <form class="manage_form" name="permissions" id="permissionsform" method="post" action="">
92
   <table class="layout permission_head">
103
   <table class="layout permission_head">
93
     <tr>
104
     <tr>
94
       <td class="label">Extra personal collages</td>
105
       <td class="label">Extra personal collages</td>
95
-      <td><input type="text" name="maxcollages" size="5" value="<?=($MaxCollages ? $MaxCollages : '0') ?>" /></td>
106
+      <td><input type="text" name="maxcollages" size="5"
107
+          value="<?=($MaxCollages ? $MaxCollages : '0') ?>" />
108
+      </td>
96
     </tr>
109
     </tr>
97
   </table>
110
   </table>
98
   <input type="hidden" name="action" value="permissions" />
111
   <input type="hidden" name="action" value="permissions" />
99
-  <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
100
-  <input type="hidden" name="id" value="<?=$_REQUEST['userid']?>" />
101
-<?
112
+  <input type="hidden" name="auth"
113
+    value="<?=$LoggedUser['AuthKey']?>" />
114
+  <input type="hidden" name="id"
115
+    value="<?=$_REQUEST['userid']?>" />
116
+  <?php
102
 permissions_form();
117
 permissions_form();
103
 ?>
118
 ?>
104
 </form>
119
 </form>
105
-<? View::show_footer(); ?>
120
+<?php View::show_footer();

+ 54
- 51
sections/user/points.php View File

1
-<?
2
-$Amount = (int) db_string($_POST['amount']);
1
+<?php
2
+declare(strict_types=1);$Amount = (int) db_string($_POST['amount']);
3
 $To = (int) db_string($_POST['to']);
3
 $To = (int) db_string($_POST['to']);
4
 $UserID = (int) $LoggedUser['ID'];
4
 $UserID = (int) $LoggedUser['ID'];
5
 $Adjust = isset($_POST['adjust'])?true:false;
5
 $Adjust = isset($_POST['adjust'])?true:false;
9
 $Tax = 0.1;
9
 $Tax = 0.1;
10
 
10
 
11
 if ($LoggedUser['DisablePoints']) {
11
 if ($LoggedUser['DisablePoints']) {
12
-  $Err = 'You are not allowed to send '.BONUS_POINTS.'.';
12
+    $Err = 'You are not allowed to send '.BONUS_POINTS.'.';
13
 } else {
13
 } else {
14
-  if ($Adjust)
15
-    $Amount = $Amount/(1-$Tax);
14
+    if ($Adjust) {
15
+        $Amount = $Amount/(1-$Tax);
16
+    }
16
 
17
 
17
-  $SentAmount = (int) ($Amount*(1-$Tax));
18
+    $SentAmount = (int) ($Amount*(1-$Tax));
18
 
19
 
19
-  $Amount = (int) $Amount;
20
+    $Amount = (int) $Amount;
20
 
21
 
21
-  if ($UserID == $To) {
22
-    $Err = 'If you sent '.BONUS_POINTS.' to yourself it wouldn\'t even do anything. Stop that.';
23
-  } elseif ($Amount < 0) {
24
-    $Err = 'You can\'t send a negative amount of '.BONUS_POINTS.'.';
25
-  } elseif ($Amount < 100) {
26
-    $Err = 'You must send at least 100 '.BONUS_POINTS.'.';
27
-  } else {
28
-    $DB->query("
22
+    if ($UserID == $To) {
23
+        $Err = 'If you sent '.BONUS_POINTS.' to yourself it wouldn\'t even do anything. Stop that.';
24
+    } elseif ($Amount < 0) {
25
+        $Err = 'You can\'t send a negative amount of '.BONUS_POINTS.'.';
26
+    } elseif ($Amount < 100) {
27
+        $Err = 'You must send at least 100 '.BONUS_POINTS.'.';
28
+    } else {
29
+        $DB->query("
29
       SELECT ui.DisablePoints
30
       SELECT ui.DisablePoints
30
       FROM users_main AS um
31
       FROM users_main AS um
31
         JOIN users_info AS ui ON um.ID = ui.UserID
32
         JOIN users_info AS ui ON um.ID = ui.UserID
32
       WHERE ID = $To");
33
       WHERE ID = $To");
33
-    if (!$DB->has_results()) {
34
-      $Err = 'That user doesn\'t exist.';
35
-    } else {
36
-      list($Disabled) = $DB->next_record();
37
-      if ($Disabled) {
38
-        $Err = "This user is not allowed to receive ".BONUS_POINTS.".";
39
-      } else {
40
-        $DB->query("
34
+        if (!$DB->has_results()) {
35
+            $Err = 'That user doesn\'t exist.';
36
+        } else {
37
+            list($Disabled) = $DB->next_record();
38
+            if ($Disabled) {
39
+                $Err = "This user is not allowed to receive ".BONUS_POINTS.".";
40
+            } else {
41
+                $DB->query("
41
           SELECT BonusPoints
42
           SELECT BonusPoints
42
           FROM users_main
43
           FROM users_main
43
           WHERE ID = $UserID");
44
           WHERE ID = $UserID");
44
-        if ($DB->has_results()) {
45
-          list($BP) = $DB->next_record();
45
+                if ($DB->has_results()) {
46
+                    list($BP) = $DB->next_record();
46
 
47
 
47
-          if ($BP < $Amount) {
48
-            $Err = 'You don\'t have enough '.BONUS_POINTS.'.';
49
-          } else {
50
-            $DB->query("
48
+                    if ($BP < $Amount) {
49
+                        $Err = 'You don\'t have enough '.BONUS_POINTS.'.';
50
+                    } else {
51
+                        $DB->query("
51
               UPDATE users_main
52
               UPDATE users_main
52
               SET BonusPoints = BonusPoints - $Amount
53
               SET BonusPoints = BonusPoints - $Amount
53
               WHERE ID = $UserID");
54
               WHERE ID = $UserID");
54
-            $DB->query("
55
+                        $DB->query("
55
               UPDATE users_main
56
               UPDATE users_main
56
               SET BonusPoints = BonusPoints + ".$SentAmount."
57
               SET BonusPoints = BonusPoints + ".$SentAmount."
57
               WHERE ID = $To");
58
               WHERE ID = $To");
58
 
59
 
59
-            $UserInfo = Users::user_info($UserID);
60
-            $ToInfo = Users::user_info($To);
60
+                        $UserInfo = Users::user_info($UserID);
61
+                        $ToInfo = Users::user_info($To);
61
 
62
 
62
-            $DB->query("
63
+                        $DB->query("
63
               UPDATE users_info
64
               UPDATE users_info
64
               SET AdminComment = CONCAT('".sqltime()." - Sent $Amount ".BONUS_POINTS." (".$SentAmount." after tax) to [user]".$ToInfo['Username']."[/user]\n\n', AdminComment)
65
               SET AdminComment = CONCAT('".sqltime()." - Sent $Amount ".BONUS_POINTS." (".$SentAmount." after tax) to [user]".$ToInfo['Username']."[/user]\n\n', AdminComment)
65
               WHERE UserID = $UserID");
66
               WHERE UserID = $UserID");
66
-            $DB->query("
67
+                        $DB->query("
67
               UPDATE users_info
68
               UPDATE users_info
68
               SET AdminComment = CONCAT('".sqltime()." - Received ".$SentAmount." ".BONUS_POINTS." from [user]".$UserInfo['Username']."[/user]\n\n', AdminComment)
69
               SET AdminComment = CONCAT('".sqltime()." - Received ".$SentAmount." ".BONUS_POINTS." from [user]".$UserInfo['Username']."[/user]\n\n', AdminComment)
69
               WHERE UserID = $To");
70
               WHERE UserID = $To");
70
 
71
 
71
-            $PM = '[user]'.$UserInfo['Username'].'[/user] has sent you a gift of '.$SentAmount.' '.BONUS_POINTS.'!';
72
+                        $PM = '[user]'.$UserInfo['Username'].'[/user] has sent you a gift of '.$SentAmount.' '.BONUS_POINTS.'!';
72
 
73
 
73
-            if (!empty($Message)) {
74
-              $PM .= "\n\n".'[quote='.$UserInfo['Username'].']'.$Message.'[/quote]';
75
-            }
74
+                        if (!empty($Message)) {
75
+                            $PM .= "\n\n".'[quote='.$UserInfo['Username'].']'.$Message.'[/quote]';
76
+                        }
76
 
77
 
77
-            Misc::send_pm($To, 0, 'You\'ve received a gift!', $PM);
78
+                        Misc::send_pm($To, 0, 'You\'ve received a gift!', $PM);
78
 
79
 
79
-            $Cache->delete_value('user_info_heavy_'.$UserID);
80
-            $Cache->delete_value('user_stats_'.$UserID);
81
-            $Cache->delete_value('user_info_heavy_'.$To);
82
-            $Cache->delete_value('user_stats_'.$To);
83
-          }
84
-        } else {
85
-          $Err = 'An unknown error occurred.';
80
+                        $Cache->delete_value('user_info_heavy_'.$UserID);
81
+                        $Cache->delete_value('user_stats_'.$UserID);
82
+                        $Cache->delete_value('user_info_heavy_'.$To);
83
+                        $Cache->delete_value('user_stats_'.$To);
84
+                    }
85
+                } else {
86
+                    $Err = 'An unknown error occurred.';
87
+                }
88
+            }
86
         }
89
         }
87
-      }
88
     }
90
     }
89
-  }
90
 }
91
 }
91
 
92
 
92
 View::show_header('Send '.BONUS_POINTS); ?>
93
 View::show_header('Send '.BONUS_POINTS); ?>
93
 <div>
94
 <div>
94
-  <h2 id='general'>Send <?=BONUS_POINTS?></h2>
95
+  <h2 id='general'>Send <?=BONUS_POINTS?>
96
+  </h2>
95
   <div class='box pad' style='padding: 10px 10px 10px 20p;'>
97
   <div class='box pad' style='padding: 10px 10px 10px 20p;'>
96
-    <p><?=$Err?'Error: '.$Err:'Sent '.$Amount.' '.BONUS_POINTS.' ('.$SentAmount.' after tax) to '.$ToInfo['Username'].'.'?></p>
98
+    <p><?=$Err?'Error: '.$Err:'Sent '.$Amount.' '.BONUS_POINTS.' ('.$SentAmount.' after tax) to '.$ToInfo['Username'].'.'?>
99
+    </p>
97
     <p><a href='/user.php?id=<?=$To?>'>Return</a></p>
100
     <p><a href='/user.php?id=<?=$To?>'>Return</a></p>
98
   </div>
101
   </div>
99
 </div>
102
 </div>
100
-<? View::show_footer(); ?>
103
+<?php View::show_footer();

Loading…
Cancel
Save