|
@@ -1,4 +1,5 @@
|
1
|
1
|
<?php
|
|
2
|
+
|
2
|
3
|
$Where = [];
|
3
|
4
|
|
4
|
5
|
if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
|
@@ -10,12 +11,12 @@ if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
10
|
11
|
$Tags = explode(',', str_replace('.', '_', trim($_GET['tags'])));
|
11
|
12
|
foreach ($Tags as $Tag) {
|
12
|
13
|
$Tag = preg_replace('/[^a-z0-9_]/', '', $Tag);
|
13
|
|
- if ($Tag != '') {
|
|
14
|
+ if ($Tag !== '') {
|
14
|
15
|
$TagWhere[] = "g.TagList REGEXP '[[:<:]]".db_string($Tag)."[[:>:]]'";
|
15
|
16
|
}
|
16
|
17
|
}
|
17
|
18
|
if (!empty($TagWhere)) {
|
18
|
|
- if ($_GET['anyall'] == 'any') {
|
|
19
|
+ if ($_GET['anyall'] === 'any') {
|
19
|
20
|
$Where[] = '('.implode(' OR ', $TagWhere).')';
|
20
|
21
|
} else {
|
21
|
22
|
$Where[] = '('.implode(' AND ', $TagWhere).')';
|
|
@@ -49,59 +50,65 @@ View::show_header("Top $Limit Torrents", 'browse');
|
49
|
50
|
?>
|
50
|
51
|
|
51
|
52
|
<div class="thin">
|
52
|
|
- <div class="header">
|
53
|
|
- <h2>Top <?=$Limit?> Torrents</h2>
|
54
|
|
- <?php Top10View::render_linkbox("torrents"); ?>
|
55
|
|
- </div>
|
56
|
|
-<?php
|
|
53
|
+ <div class="header">
|
|
54
|
+ <h2>Top <?=$Limit?> Torrents</h2>
|
|
55
|
+ <?php Top10View::render_linkbox("torrents"); ?>
|
|
56
|
+ </div>
|
|
57
|
+ <?php
|
57
|
58
|
|
58
|
59
|
if (check_perms('site_advanced_top10')) {
|
59
|
60
|
?>
|
60
|
|
- <div class="box pad">
|
61
|
|
- <form class="search_form" name="torrents" action="" method="get">
|
62
|
|
- <input type="hidden" name="advanced" value="1" />
|
63
|
|
- <table cellpadding="6" cellspacing="1" border="0" class="layout" width="100%">
|
64
|
|
- <tr id="tagfilter">
|
65
|
|
- <td class="label">Tags (comma-separated)</td>
|
66
|
|
- <td class="ft_taglist">
|
67
|
|
- <input type="text" name="tags" id="tags" size="75" value="<?php if (!empty($_GET['tags'])) {
|
|
61
|
+ <div class="box pad">
|
|
62
|
+ <form class="search_form" name="torrents" action="" method="get">
|
|
63
|
+ <input type="hidden" name="advanced" value="1" />
|
|
64
|
+ <table cellpadding="6" cellspacing="1" border="0" class="layout" width="100%">
|
|
65
|
+ <tr id="tagfilter">
|
|
66
|
+ <td class="label">Tags (comma-separated)</td>
|
|
67
|
+ <td class="ft_taglist">
|
|
68
|
+ <input type="text" name="tags" id="tags" size="75" value="<?php if (!empty($_GET['tags'])) {
|
68
|
69
|
echo display_str($_GET['tags']);
|
69
|
|
- } ?>"<?php Users::has_autocomplete_enabled('other'); ?> />
|
70
|
|
- <input type="radio" id="rdoAll" name="anyall" value="all"<?=((!isset($_GET['anyall'])||$_GET['anyall']!='any')?' checked="checked"':'')?> /><label for="rdoAll"> All</label>
|
71
|
|
- <input type="radio" id="rdoAny" name="anyall" value="any"<?=((!isset($_GET['anyall'])||$_GET['anyall']=='any')?' checked="checked"':'')?> /><label for="rdoAny"> Any</label>
|
72
|
|
- </td>
|
73
|
|
- </tr>
|
74
|
|
- <tr>
|
75
|
|
- <td class="label">Category</td>
|
76
|
|
- <td>
|
77
|
|
- <select name="category" style="width: auto;" class="ft_format">
|
78
|
|
- <option value="">Any</option>
|
79
|
|
-<?php foreach ($Categories as $CategoryName) { ?>
|
80
|
|
- <option value="<?=display_str($CategoryName)?>"<?=(($CategoryName==($_GET['category']??false))?'selected="selected"':'')?>><?=display_str($CategoryName)?></option>
|
81
|
|
-<?php } ?>
|
82
|
|
- </select>
|
83
|
|
- </td>
|
84
|
|
- </tr>
|
85
|
|
- <tr>
|
86
|
|
- <td colspan="2" class="center">
|
87
|
|
- <input type="submit" value="Search" />
|
88
|
|
- </td>
|
89
|
|
- </tr>
|
90
|
|
- </table>
|
91
|
|
- </form>
|
92
|
|
- </div>
|
93
|
|
-<?php
|
|
70
|
+ } ?>" <?php Users::has_autocomplete_enabled('other'); ?>
|
|
71
|
+ />
|
|
72
|
+ <input type="radio" id="rdoAll" name="anyall" value="all" <?=((!isset($_GET['anyall'])||$_GET['anyall']!=='any')?' checked="checked"':'')?>
|
|
73
|
+ /><label for="rdoAll"> All</label>
|
|
74
|
+ <input type="radio" id="rdoAny" name="anyall" value="any" <?=((!isset($_GET['anyall'])||$_GET['anyall']==='any')?' checked="checked"':'')?>
|
|
75
|
+ /><label for="rdoAny"> Any</label>
|
|
76
|
+ </td>
|
|
77
|
+ </tr>
|
|
78
|
+ <tr>
|
|
79
|
+ <td class="label">Category</td>
|
|
80
|
+ <td>
|
|
81
|
+ <select name="category" style="width: auto;" class="ft_format">
|
|
82
|
+ <option value="">Any</option>
|
|
83
|
+ <?php foreach ($Categories as $CategoryName) { ?>
|
|
84
|
+ <option
|
|
85
|
+ value="<?=display_str($CategoryName)?>"
|
|
86
|
+ <?=(($CategoryName===($_GET['category']??false))?'selected="selected"':'')?>><?=display_str($CategoryName)?>
|
|
87
|
+ </option>
|
|
88
|
+ <?php } ?>
|
|
89
|
+ </select>
|
|
90
|
+ </td>
|
|
91
|
+ </tr>
|
|
92
|
+ <tr>
|
|
93
|
+ <td colspan="2" class="center">
|
|
94
|
+ <input type="submit" value="Search" />
|
|
95
|
+ </td>
|
|
96
|
+ </tr>
|
|
97
|
+ </table>
|
|
98
|
+ </form>
|
|
99
|
+ </div>
|
|
100
|
+ <?php
|
94
|
101
|
}
|
95
|
102
|
|
96
|
103
|
// Default setting to have them shown
|
97
|
104
|
$DisableFreeTorrentTop10 = (isset($LoggedUser['DisableFreeTorrentTop10']) ? $LoggedUser['DisableFreeTorrentTop10'] : 0);
|
98
|
105
|
// Did they just toggle it?
|
99
|
106
|
if (isset($_GET['freeleech'])) {
|
100
|
|
- // what did they choose?
|
101
|
|
- $NewPref = (($_GET['freeleech'] == 'hide') ? 1 : 0);
|
|
107
|
+ // What did they choose?
|
|
108
|
+ $NewPref = (($_GET['freeleech'] === 'hide') ? 1 : 0);
|
102
|
109
|
|
103
|
110
|
// Pref id different
|
104
|
|
- if ($NewPref != $DisableFreeTorrentTop10) {
|
|
111
|
+ if ($NewPref !== $DisableFreeTorrentTop10) {
|
105
|
112
|
$DisableFreeTorrentTop10 = $NewPref;
|
106
|
113
|
Users::update_site_options($LoggedUser['ID'], array('DisableFreeTorrentTop10' => $DisableFreeTorrentTop10));
|
107
|
114
|
}
|
|
@@ -122,7 +129,7 @@ if (!empty($FreeleechToggleQuery)) {
|
122
|
129
|
|
123
|
130
|
$FreeleechToggleQuery .= 'freeleech=' . $FreeleechToggleName;
|
124
|
131
|
|
125
|
|
-$GroupByToggleName = ((isset($_GET['groups']) && $_GET['groups'] == 'show') ? 'hide' : 'show');
|
|
132
|
+$GroupByToggleName = ((isset($_GET['groups']) && $_GET['groups'] === 'show') ? 'hide' : 'show');
|
126
|
133
|
$GroupByToggleQuery = Format::get_url(array('freeleech', 'groups'));
|
127
|
134
|
|
128
|
135
|
if (!empty($GroupByToggleQuery)) {
|
|
@@ -133,19 +140,23 @@ $GroupByToggleQuery .= 'groups=' . $GroupByToggleName;
|
133
|
140
|
|
134
|
141
|
$GroupBySum = '';
|
135
|
142
|
$GroupBy = '';
|
136
|
|
-if (isset($_GET['groups']) && $_GET['groups'] == 'show') {
|
|
143
|
+if (isset($_GET['groups']) && $_GET['groups'] === 'show') {
|
137
|
144
|
$GroupBy = ' GROUP BY g.ID ';
|
138
|
145
|
$GroupBySum = md5($GroupBy);
|
139
|
146
|
}
|
140
|
147
|
|
141
|
148
|
?>
|
142
|
|
- <div style="text-align: right;" class="linkbox">
|
143
|
|
- <a href="top10.php?<?=$FreeleechToggleQuery?>" class="brackets"><?=ucfirst($FreeleechToggleName)?> freeleech in Top 10</a>
|
144
|
|
-<?php if (check_perms('users_mod')) { ?>
|
145
|
|
- <a href="top10.php?<?=$GroupByToggleQuery?>" class="brackets"><?=ucfirst($GroupByToggleName)?> top groups</a>
|
146
|
|
-<?php } ?>
|
147
|
|
- </div>
|
148
|
|
-<?php
|
|
149
|
+ <div style="text-align: right;" class="linkbox">
|
|
150
|
+ <a href="top10.php?<?=$FreeleechToggleQuery?>"
|
|
151
|
+ class="brackets"><?=ucfirst($FreeleechToggleName)?>
|
|
152
|
+ freeleech in Top 10</a>
|
|
153
|
+ <?php if (check_perms('users_mod')) { ?>
|
|
154
|
+ <a href="top10.php?<?=$GroupByToggleQuery?>"
|
|
155
|
+ class="brackets"><?=ucfirst($GroupByToggleName)?> top
|
|
156
|
+ groups</a>
|
|
157
|
+ <?php } ?>
|
|
158
|
+ </div>
|
|
159
|
+ <?php
|
149
|
160
|
|
150
|
161
|
if (!empty($Where)) {
|
151
|
162
|
$Where = '('.implode(' AND ', $Where).')';
|
|
@@ -173,7 +184,7 @@ $BaseQuery = '
|
173
|
184
|
FROM torrents AS t
|
174
|
185
|
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID';
|
175
|
186
|
|
176
|
|
-if ($Details == 'all' || $Details == 'day') {
|
|
187
|
+if ($Details === 'all' || $Details === 'day') {
|
177
|
188
|
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum);
|
178
|
189
|
if ($TopTorrentsActiveLastDay === false) {
|
179
|
190
|
if ($Cache->get_query_lock('top10')) {
|
|
@@ -197,7 +208,7 @@ if ($Details == 'all' || $Details == 'day') {
|
197
|
208
|
}
|
198
|
209
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
199
|
210
|
}
|
200
|
|
-if ($Details == 'all' || $Details == 'week') {
|
|
211
|
+if ($Details === 'all' || $Details === 'week') {
|
201
|
212
|
$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum.$GroupBySum);
|
202
|
213
|
if ($TopTorrentsActiveLastWeek === false) {
|
203
|
214
|
if ($Cache->get_query_lock('top10')) {
|
|
@@ -222,7 +233,7 @@ if ($Details == 'all' || $Details == 'week') {
|
222
|
233
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
|
223
|
234
|
}
|
224
|
235
|
|
225
|
|
-if ($Details == 'all' || $Details == 'month') {
|
|
236
|
+if ($Details === 'all' || $Details === 'month') {
|
226
|
237
|
$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum.$GroupBySum);
|
227
|
238
|
if ($TopTorrentsActiveLastMonth === false) {
|
228
|
239
|
if ($Cache->get_query_lock('top10')) {
|
|
@@ -246,13 +257,13 @@ if ($Details == 'all' || $Details == 'month') {
|
246
|
257
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Month', 'month', $TopTorrentsActiveLastMonth, $Limit);
|
247
|
258
|
}
|
248
|
259
|
|
249
|
|
-if ($Details == 'all' || $Details == 'year') {
|
|
260
|
+if ($Details === 'all' || $Details === 'year') {
|
250
|
261
|
$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum.$GroupBySum);
|
251
|
262
|
if ($TopTorrentsActiveLastYear === false) {
|
252
|
263
|
if ($Cache->get_query_lock('top10')) {
|
253
|
264
|
// IMPORTANT NOTE - we use WHERE t.Seeders>200 in order to speed up this query. You should remove it!
|
254
|
265
|
$Query = $BaseQuery.' WHERE ';
|
255
|
|
- if ($Details == 'all' && !$Filtered) {
|
|
266
|
+ if ($Details === 'all' && !$Filtered) {
|
256
|
267
|
// $Query .= 't.Seeders>=200 AND ';
|
257
|
268
|
if (!empty($Where)) {
|
258
|
269
|
$Query .= $Where.' AND ';
|
|
@@ -276,13 +287,13 @@ if ($Details == 'all' || $Details == 'year') {
|
276
|
287
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Year', 'year', $TopTorrentsActiveLastYear, $Limit);
|
277
|
288
|
}
|
278
|
289
|
|
279
|
|
-if ($Details == 'all' || $Details == 'overall') {
|
|
290
|
+if ($Details === 'all' || $Details === 'overall') {
|
280
|
291
|
$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum.$GroupBySum);
|
281
|
292
|
if ($TopTorrentsActiveAllTime === false) {
|
282
|
293
|
if ($Cache->get_query_lock('top10')) {
|
283
|
294
|
// IMPORTANT NOTE - we use WHERE t.Seeders>500 in order to speed up this query. You should remove it!
|
284
|
295
|
$Query = $BaseQuery;
|
285
|
|
- if ($Details=='all' && !$Filtered) {
|
|
296
|
+ if ($Details === 'all' && !$Filtered) {
|
286
|
297
|
//$Query .= "t.Seeders>=500 ";
|
287
|
298
|
if (!empty($Where)) {
|
288
|
299
|
$Query .= ' WHERE '.$Where;
|
|
@@ -305,7 +316,7 @@ if ($Details == 'all' || $Details == 'overall') {
|
305
|
316
|
generate_torrent_table('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
|
306
|
317
|
}
|
307
|
318
|
|
308
|
|
-if (($Details == 'all' || $Details == 'snatched') && !$Filtered) {
|
|
319
|
+if (($Details === 'all' || $Details === 'snatched') && !$Filtered) {
|
309
|
320
|
$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum.$GroupBySum);
|
310
|
321
|
if ($TopTorrentsSnatched === false) {
|
311
|
322
|
if ($Cache->get_query_lock('top10')) {
|
|
@@ -328,13 +339,13 @@ if (($Details == 'all' || $Details == 'snatched') && !$Filtered) {
|
328
|
339
|
generate_torrent_table('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
|
329
|
340
|
}
|
330
|
341
|
|
331
|
|
-if (($Details == 'all' || $Details == 'data') && !$Filtered) {
|
|
342
|
+if (($Details === 'all' || $Details === 'data') && !$Filtered) {
|
332
|
343
|
$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum.$GroupBySum);
|
333
|
344
|
if ($TopTorrentsTransferred === false) {
|
334
|
345
|
if ($Cache->get_query_lock('top10')) {
|
335
|
346
|
// IMPORTANT NOTE - we use WHERE t.Snatched>100 in order to speed up this query. You should remove it!
|
336
|
347
|
$Query = $BaseQuery;
|
337
|
|
- if ($Details=='all') {
|
|
348
|
+ if ($Details === 'all') {
|
338
|
349
|
//$Query .= " WHERE t.Snatched>=100 ";
|
339
|
350
|
if (!empty($Where)) {
|
340
|
351
|
$Query .= ' WHERE '.$Where;
|
|
@@ -355,7 +366,7 @@ if (($Details == 'all' || $Details == 'data') && !$Filtered) {
|
355
|
366
|
generate_torrent_table('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
|
356
|
367
|
}
|
357
|
368
|
|
358
|
|
-if (($Details == 'all' || $Details == 'seeded') && !$Filtered) {
|
|
369
|
+if (($Details === 'all' || $Details === 'seeded') && !$Filtered) {
|
359
|
370
|
$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum.$GroupBySum);
|
360
|
371
|
if ($TopTorrentsSeeded === false) {
|
361
|
372
|
if ($Cache->get_query_lock('top10')) {
|
|
@@ -380,6 +391,7 @@ if (($Details == 'all' || $Details == 'seeded') && !$Filtered) {
|
380
|
391
|
|
381
|
392
|
?>
|
382
|
393
|
</div>
|
|
394
|
+
|
383
|
395
|
<?php
|
384
|
396
|
View::show_footer();
|
385
|
397
|
|
|
@@ -387,63 +399,78 @@ View::show_footer();
|
387
|
399
|
function generate_torrent_table($Caption, $Tag, $Details, $Limit)
|
388
|
400
|
{
|
389
|
401
|
global $LoggedUser, $Categories, $ReleaseTypes, $GroupBy; ?>
|
390
|
|
- <h3>Top <?="$Limit $Caption"?>
|
391
|
|
-<?php if (empty($_GET['advanced'])) { ?>
|
|
402
|
+<h3>Top <?="$Limit $Caption"?>
|
|
403
|
+ <?php if (empty($_GET['advanced'])) { ?>
|
392
|
404
|
<small class="top10_quantity_links">
|
393
|
|
-<?php
|
|
405
|
+ <?php
|
394
|
406
|
switch ($Limit) {
|
395
|
407
|
case 100: ?>
|
396
|
|
- - <a href="top10.php?details=<?=$Tag?>" class="brackets">Top 10</a>
|
|
408
|
+ - <a href="top10.php?details=<?=$Tag?>" class="brackets">Top
|
|
409
|
+ 10</a>
|
397
|
410
|
- <span class="brackets">Top 100</span>
|
398
|
|
- - <a href="top10.php?type=torrents&limit=250&details=<?=$Tag?>" class="brackets">Top 250</a>
|
399
|
|
-<?php break;
|
|
411
|
+ - <a href="top10.php?type=torrents&limit=250&details=<?=$Tag?>"
|
|
412
|
+ class="brackets">Top 250</a>
|
|
413
|
+ <?php break;
|
400
|
414
|
case 250: ?>
|
401
|
|
- - <a href="top10.php?details=<?=$Tag?>" class="brackets">Top 10</a>
|
402
|
|
- - <a href="top10.php?type=torrents&limit=100&details=<?=$Tag?>" class="brackets">Top 100</a>
|
|
415
|
+ - <a href="top10.php?details=<?=$Tag?>" class="brackets">Top
|
|
416
|
+ 10</a>
|
|
417
|
+ - <a href="top10.php?type=torrents&limit=100&details=<?=$Tag?>"
|
|
418
|
+ class="brackets">Top 100</a>
|
403
|
419
|
- <span class="brackets">Top 250</span>
|
404
|
|
-<?php break;
|
|
420
|
+ <?php break;
|
405
|
421
|
default: ?>
|
406
|
422
|
- <span class="brackets">Top 10</span>
|
407
|
|
- - <a href="top10.php?type=torrents&limit=100&details=<?=$Tag?>" class="brackets">Top 100</a>
|
408
|
|
- - <a href="top10.php?type=torrents&limit=250&details=<?=$Tag?>" class="brackets">Top 250</a>
|
409
|
|
-<?php } ?>
|
|
423
|
+ - <a href="top10.php?type=torrents&limit=100&details=<?=$Tag?>"
|
|
424
|
+ class="brackets">Top 100</a>
|
|
425
|
+ - <a href="top10.php?type=torrents&limit=250&details=<?=$Tag?>"
|
|
426
|
+ class="brackets">Top 250</a>
|
|
427
|
+ <?php } ?>
|
410
|
428
|
</small>
|
411
|
|
-<?php } ?>
|
412
|
|
- </h3>
|
413
|
|
- <table class="torrent_table cats numbering border">
|
414
|
|
- <tr class="colhead">
|
415
|
|
- <td class="center" style="width: 15px;"></td>
|
416
|
|
- <td class="cats_col"></td>
|
417
|
|
- <td>Name</td>
|
418
|
|
- <td style="text-align: right;">Size</td>
|
419
|
|
- <td style="text-align: right;">Data</td>
|
420
|
|
- <td style="text-align: right;" class="sign snatches"><svg width="15" height="15" fill="black" class="tooltip" alt="Snatches" title="Snatches" viewBox="3 0 88 98"><path d="M20 20 A43 43,0,1,0,77 23 L90 10 L55 10 L55 45 L68 32 A30.27 30.27,0,1,1,28 29"></path></svg></td>
|
421
|
|
- <td style="text-align: right;" class="sign seeders"><svg width="11" height="15" fill="black" class="tooltip" alt="Seeders" title="Seeders"><polygon points="0,7 5.5,0 11,7 8,7 8,15 3,15 3,7"></polygon></svg></td>
|
422
|
|
- <td style="text-align: right;" class="sign leechers"><svg width="11" height="15" fill="black" class="tooltip" alt="Leechers" title="Leechers"><polygon points="0,8 5.5,15 11,8 8,8 8,0 3,0 3,8"></polygon></svg></td>
|
423
|
|
- <td style="text-align: right;">Peers</td>
|
424
|
|
- </tr>
|
425
|
|
-<?php
|
|
429
|
+ <?php } ?>
|
|
430
|
+</h3>
|
|
431
|
+<table class="torrent_table cats numbering border">
|
|
432
|
+ <tr class="colhead">
|
|
433
|
+ <td class="center" style="width: 15px;"></td>
|
|
434
|
+ <td class="cats_col"></td>
|
|
435
|
+ <td>Name</td>
|
|
436
|
+ <td style="text-align: right;">Size</td>
|
|
437
|
+ <td style="text-align: right;">Data</td>
|
|
438
|
+ <td style="text-align: right;" class="sign snatches"><svg width="15" height="15" fill="black" class="tooltip"
|
|
439
|
+ alt="Snatches" title="Snatches" viewBox="3 0 88 98">
|
|
440
|
+ <path d="M20 20 A43 43,0,1,0,77 23 L90 10 L55 10 L55 45 L68 32 A30.27 30.27,0,1,1,28 29"></path>
|
|
441
|
+ </svg></td>
|
|
442
|
+ <td style="text-align: right;" class="sign seeders"><svg width="11" height="15" fill="black" class="tooltip"
|
|
443
|
+ alt="Seeders" title="Seeders">
|
|
444
|
+ <polygon points="0,7 5.5,0 11,7 8,7 8,15 3,15 3,7"></polygon>
|
|
445
|
+ </svg></td>
|
|
446
|
+ <td style="text-align: right;" class="sign leechers"><svg width="11" height="15" fill="black" class="tooltip"
|
|
447
|
+ alt="Leechers" title="Leechers">
|
|
448
|
+ <polygon points="0,8 5.5,15 11,8 8,8 8,0 3,0 3,8"></polygon>
|
|
449
|
+ </svg></td>
|
|
450
|
+ <td style="text-align: right;">Peers</td>
|
|
451
|
+ </tr>
|
|
452
|
+ <?php
|
426
|
453
|
// Server is already processing a top10 query. Starting another one will make things slow
|
427
|
454
|
if ($Details === false) {
|
428
|
455
|
?>
|
429
|
456
|
<tr class="row">
|
430
|
|
- <td colspan="9" class="center">
|
431
|
|
- Server is busy processing another top list request. Please try again in a minute.
|
432
|
|
- </td>
|
|
457
|
+ <td colspan="9" class="center">
|
|
458
|
+ Server is busy processing another top list request. Please try again in a minute
|
|
459
|
+ </td>
|
433
|
460
|
</tr>
|
434
|
|
- </table><br />
|
|
461
|
+</table><br />
|
435
|
462
|
<?php
|
436
|
463
|
return;
|
437
|
464
|
}
|
438
|
|
- // iIn the unlikely event that query finds 0 rows...
|
|
465
|
+ // In the unlikely event that query finds 0 rows...
|
439
|
466
|
if (empty($Details)) {
|
440
|
467
|
?>
|
441
|
|
- <tr class="row">
|
442
|
|
- <td colspan="9" class="center">
|
443
|
|
- Found no torrents matching the criteria.
|
444
|
|
- </td>
|
445
|
|
- </tr>
|
446
|
|
- </table><br />
|
|
468
|
+<tr class="row">
|
|
469
|
+ <td colspan="9" class="center">
|
|
470
|
+ Found no torrents matching the criteria
|
|
471
|
+ </td>
|
|
472
|
+</tr>
|
|
473
|
+</table><br />
|
447
|
474
|
<?php
|
448
|
475
|
return;
|
449
|
476
|
}
|
|
@@ -481,23 +508,23 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit)
|
481
|
508
|
// Append extra info to torrent title
|
482
|
509
|
$ExtraInfo = '';
|
483
|
510
|
$AddExtra = '';
|
|
511
|
+
|
484
|
512
|
if (empty($GroupBy)) {
|
485
|
|
- if ($Media) {
|
486
|
|
- $ExtraInfo .= $AddExtra.$Media;
|
487
|
|
- $AddExtra = ' / ';
|
488
|
|
- }
|
489
|
513
|
if ($Year > 0) {
|
490
|
|
- $ExtraInfo .= $AddExtra.$Year;
|
491
|
|
- $AddExtra = ' ';
|
|
514
|
+ $ExtraInfo .= $Year;
|
492
|
515
|
}
|
|
516
|
+
|
|
517
|
+ if ($Media) {
|
|
518
|
+ $ExtraInfo .= " / $Media";
|
|
519
|
+ }
|
|
520
|
+
|
493
|
521
|
if ($IsSnatched) {
|
494
|
|
- if ($GroupCategoryID != 5) {
|
495
|
|
- $ExtraInfo .= ' / ';
|
496
|
|
- }
|
497
|
|
- $ExtraInfo .= Format::torrent_label('Snatched!');
|
|
522
|
+ $ExtraInfo .= ' / ';
|
|
523
|
+ $ExtraInfo .= Format::torrent_label('Snatched!', 'bold');
|
498
|
524
|
}
|
499
|
|
- if ($ExtraInfo != '') {
|
500
|
|
- $ExtraInfo = "- [$ExtraInfo]";
|
|
525
|
+
|
|
526
|
+ if ($ExtraInfo !== '') {
|
|
527
|
+ $ExtraInfo = "<br />$ExtraInfo";
|
501
|
528
|
}
|
502
|
529
|
}
|
503
|
530
|
|
|
@@ -511,41 +538,59 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit)
|
511
|
538
|
}
|
512
|
539
|
|
513
|
540
|
// Print row?>
|
514
|
|
- <tr class="torrent row<?=($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '')?>">
|
|
541
|
+<tr
|
|
542
|
+ class="torrent row<?=($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '')?>">
|
515
|
543
|
<td style="padding: 8px; text-align: center;"><strong><?=$Rank?></strong></td>
|
516
|
|
- <td class="center cats_col"><div title="<?=Format::pretty_category($GroupCategoryID)?>" class="tooltip <?=Format::css_category($GroupCategoryID)?>"></div></td>
|
|
544
|
+ <td class="center cats_col">
|
|
545
|
+ <div title="<?=Format::pretty_category($GroupCategoryID)?>"
|
|
546
|
+ class="tooltip <?=Format::css_category($GroupCategoryID)?>">
|
|
547
|
+ </div>
|
|
548
|
+ </td>
|
517
|
549
|
<td class="big_info">
|
518
|
|
- <div class="group_info clear">
|
|
550
|
+ <div class="group_info clear">
|
519
|
551
|
|
520
|
|
- <span><a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets tooltip">DL</a></span>
|
|
552
|
+ <span><a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>"
|
|
553
|
+ title="Download" class="brackets tooltip">DL</a></span>
|
521
|
554
|
|
522
|
|
- <?=$DisplayName?> <?=$ExtraInfo?><?php if ($Reported) { ?> - <strong class="torrent_label tl_reported">Reported</strong><?php } ?>
|
523
|
|
-<?php
|
|
555
|
+ <?=$DisplayName?> <?=$ExtraInfo?><?php if ($Reported) { ?> - <strong
|
|
556
|
+ class="torrent_label tl_reported">Reported</strong><?php } ?>
|
|
557
|
+ <?php
|
524
|
558
|
if ($IsBookmarked) {
|
525
|
559
|
?>
|
526
|
|
- <span class="remove_bookmark float_right">
|
527
|
|
- <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="bookmarklink_torrent_<?=$GroupID?> brackets" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
|
528
|
|
- </span>
|
529
|
|
-<?php
|
|
560
|
+ <span class="remove_bookmark float_right">
|
|
561
|
+ <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
|
|
562
|
+ class="bookmarklink_torrent_<?=$GroupID?> brackets"
|
|
563
|
+ onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove
|
|
564
|
+ bookmark</a>
|
|
565
|
+ </span>
|
|
566
|
+ <?php
|
530
|
567
|
} else { ?>
|
531
|
|
- <span class="add_bookmark float_right">
|
532
|
|
- <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="bookmarklink_torrent_<?=$GroupID?> brackets" onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
|
533
|
|
- </span>
|
534
|
|
-<?php } ?>
|
535
|
|
- <div class="tags"><?=$TorrentTags->format()?></div>
|
536
|
|
- </div>
|
|
568
|
+ <span class="add_bookmark float_right">
|
|
569
|
+ <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
|
|
570
|
+ class="bookmarklink_torrent_<?=$GroupID?> brackets"
|
|
571
|
+ onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
|
|
572
|
+ </span>
|
|
573
|
+ <?php } ?>
|
|
574
|
+ <div class="tags"><?=$TorrentTags->format()?>
|
|
575
|
+ </div>
|
|
576
|
+ </div>
|
|
577
|
+ </td>
|
|
578
|
+ <td class="number_column nobr"><?=Format::get_size($Size)?>
|
|
579
|
+ </td>
|
|
580
|
+ <td class="number_column nobr"><?=Format::get_size($Data)?>
|
|
581
|
+ </td>
|
|
582
|
+ <td class="number_column"><?=number_format((double)$Snatched)?>
|
537
|
583
|
</td>
|
538
|
|
- <td class="number_column nobr"><?=Format::get_size($Size)?></td>
|
539
|
|
- <td class="number_column nobr"><?=Format::get_size($Data)?></td>
|
540
|
|
- <td class="number_column"><?=number_format((double)$Snatched)?></td>
|
541
|
|
- <td class="number_column"><?=number_format((double)$Seeders)?></td>
|
542
|
|
- <td class="number_column"><?=number_format((double)$Leechers)?></td>
|
543
|
|
- <td class="number_column"><?=number_format($Seeders + $Leechers)?></td>
|
544
|
|
- </tr>
|
|
584
|
+ <td class="number_column"><?=number_format((double)$Seeders)?>
|
|
585
|
+ </td>
|
|
586
|
+ <td class="number_column"><?=number_format((double)$Leechers)?>
|
|
587
|
+ </td>
|
|
588
|
+ <td class="number_column"><?=number_format($Seeders + $Leechers)?>
|
|
589
|
+ </td>
|
|
590
|
+</tr>
|
545
|
591
|
<?php
|
546
|
592
|
} // foreach ($Details as $Detail)
|
547
|
593
|
?>
|
548
|
|
- </table><br />
|
|
594
|
+</table><br />
|
549
|
595
|
<?php
|
550
|
596
|
}
|
551
|
|
-?>
|