Browse Source

Continue BibTeX support

pjc 5 years ago
parent
commit
58bfab69ec
3 changed files with 484 additions and 312 deletions
  1. 56
    41
      classes/torrent_form.class.php
  2. 31
    0
      download.php
  3. 397
    271
      sections/torrents/details.php

+ 56
- 41
classes/torrent_form.class.php View File

@@ -74,24 +74,37 @@ class TorrentForm
74 74
     If you would like to use your own torrent file, add the following to it.
75 75
     Otherwise, add none of it and redownload the torrent file after uploading it.
76 76
     All of the above data will be added to it by the site.
77
-    <strong>If you never have before, be sure to read this list of <a href="wiki.php?action=article&name=uploadingpitfalls">uploading pitfalls</a></strong>.
77
+    <strong>If you never have before, be sure to read this list of
78
+      <a href="wiki.php?action=article&name=uploadingpitfalls">uploading pitfalls</a></strong>.
78 79
   </p>
79 80
 
80 81
   <p style="text-align: center;">
81 82
     <?php
82 83
       $Announces = call_user_func_array('array_merge', ANNOUNCE_URLS);
83 84
         foreach ($Announces as $Announce) {
84
-            # Loop through tracker URLs
85
-    ?>
85
+            # Loop through tracker URLs?>
86 86
     <strong>Announce</strong>
87
-    <input type="text" value="<?= $Announce . '/' . G::$LoggedUser['torrent_pass'] . '/announce' ?>"
87
+
88
+    <?php
89
+    # Buying into the shit coding style
90
+    # Just trying to mirror content on a Tier 2 public tracker
91
+    if (!strstr($Announce, 'openbittorrent')) {
92
+        ?>
93
+    <input type="text"
94
+      value="<?= $Announce . '/' . G::$LoggedUser['torrent_pass'] . '/announce' ?>"
88 95
       size="74" onclick="this.select();" readonly="readonly" /> <br />
89 96
     <?php
97
+    } else { ?>
98
+    <input type="text" value="<?= $Announce ?>" size="74"
99
+      onclick="this.select();" readonly="readonly" /> <br />
100
+    <?php
101
+
102
+    }
90 103
         } ?>
91 104
 
92 105
     <strong>Source</strong>
93
-    <input type="text" value="<?= Users::get_upload_sources()[0] ?>" size="20"
94
-      onclick="this.select();" readonly="readonly" />
106
+    <input type="text" value="<?= Users::get_upload_sources()[0] ?>"
107
+      size="20" onclick="this.select();" readonly="readonly" />
95 108
   </p>
96 109
 
97 110
   <!-- Error display -->
@@ -102,7 +115,7 @@ class TorrentForm
102 115
             echo "\t".'<p style="color: red; text-align: center;">' . $this->Error . "</p>\n";
103 116
         } ?>
104 117
   </p>
105
-  
118
+
106 119
   <!-- Torrent form hidden values -->
107 120
   <form class="create_form box pad" name="torrent" action="" enctype="multipart/form-data" method="post"
108 121
     onsubmit="$('#post').raw().disabled = 'disabled';">
@@ -149,9 +162,8 @@ class TorrentForm
149 162
       <tr>
150 163
         <td class="label">Type</td>
151 164
         <td>
152
-          <select id="categories" name="type" onchange="Categories()"
153
-            <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
154
-          <?php
165
+          <select id="categories" name="type" onchange="Categories()" <?= ($this->DisabledFlag) ? ' disabled="disabled"' : '' ?>>
166
+            <?php
155 167
             foreach (Misc::display_array($this->Categories) as $Index => $Cat) {
156 168
                 echo "\t\t\t\t\t\t<option value=\"$Index\"";
157 169
                 if ($Cat == $this->Torrent['CategoryName']) {
@@ -220,16 +232,17 @@ class TorrentForm
220 232
         <td colspan="2" style="text-align: center;">
221 233
           <p>
222 234
             Be sure that your torrent is approved by the <a href="rules.php?p=upload" target="_blank">rules</a>.
223
-            Not doing this will result in a <strong class="important_text">warning</strong> or <strong class="important_text">worse</strong>.
235
+            Not doing this will result in a <strong class="important_text">warning</strong> or <strong
236
+              class="important_text">worse</strong>.
224 237
           </p>
225 238
           <?php if ($this->NewTorrent) { ?>
226 239
           <p>
227
-            After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent.
240
+            After uploading the torrent, you will have a one hour grace period during which no one other than you can
241
+            fill requests with this torrent.
228 242
             Make use of this time wisely, and <a href="requests.php">search the list of requests</a>.
229 243
           </p>
230 244
           <?php } ?>
231
-          <input id="post" type="submit"
232
-          <?php
245
+          <input id="post" type="submit" <?php
233 246
             if ($this->NewTorrent) {
234 247
                 echo ' value="Upload"';
235 248
             } else {
@@ -262,12 +275,12 @@ class TorrentForm
262 275
         value="<?= display_str($Torrent['CatalogueNumber']) ?>"
263 276
         <?= $this->Disabled ?>/>
264 277
       <?php if (!$this->DisabledFlag) { ?>
265
-        <input type="button" autofill="jav" value="Autofill">
266
-        </input>
267
-        Coming Soon!<br />
268
-        <!-- Autofill only supports RefSeq and UniProt; -->
269
-        Enter any ID number that corresponds to the data,
270
-        preferring RefSeq and UniProt
278
+      <input type="button" autofill="jav" value="Autofill">
279
+      </input>
280
+      Coming Soon!<br />
281
+      <!-- Autofill only supports RefSeq and UniProt; -->
282
+      Enter any ID number that corresponds to the data,
283
+      preferring RefSeq and UniProt
271 284
       <?php } ?>
272 285
     </td>
273 286
   </tr>
@@ -333,7 +346,8 @@ class TorrentForm
333 346
             foreach ($Torrent['Artists'] as $Num => $Artist) {
334 347
                 ?>
335 348
       <input type="text" id="idols_<?= $Num ?>" name="idols[]"
336
-        size="45" value="<?= display_str($Artist['name']) ?>"
349
+        size="45"
350
+        value="<?= display_str($Artist['name']) ?>"
337 351
         <?= $this->Disabled ?>/>
338 352
       <?php if ($Num === 0) { ?>
339 353
       <a class="add_artist_button brackets">+</a>
@@ -407,10 +421,10 @@ class TorrentForm
407 421
   <!-- Alternate media -->
408 422
   <tr id="media_manga_tr">
409 423
     <td class="label">Platform</td>
410
-      <td>
411
-        <select name="media">
412
-          <option>---</option>
413
-          <?php
424
+    <td>
425
+      <select name="media">
426
+        <option>---</option>
427
+        <?php
414 428
             foreach ($this->MediaManga as $Media) {
415 429
                 echo "\t\t\t\t\t\t<option value=\"$Media\"";
416 430
                 if ($Media === ($Torrent['Media'] ?? false)) {
@@ -418,10 +432,10 @@ class TorrentForm
418 432
                 }
419 433
                 echo ">$Media</option>\n";
420 434
             } ?>
421
-          </select><br />
422
-          Class of technology used
423
-        </td>
424
-      </tr>
435
+      </select><br />
436
+      Class of technology used
437
+    </td>
438
+  </tr>
425 439
 
426 440
   <!-- Container -->
427 441
   <tr id="container_tr">
@@ -456,10 +470,10 @@ class TorrentForm
456 470
               }
457 471
               echo ">$Container</option>\n";
458 472
           } ?>
459
-          </select><br />
460
-          Data file format
461
-        </td>
462
-      </tr>
473
+      </select><br />
474
+      Data file format
475
+    </td>
476
+  </tr>
463 477
 
464 478
   <!-- Resolution -->
465 479
   <tr id="resolution_tr">
@@ -528,7 +542,8 @@ class TorrentForm
528 542
               echo ">$Codec</option>\n";
529 543
           } ?>
530 544
       </select><br />
531
-      Please see <a href="http://www.dcc.ac.uk/resources/how-guides/license-research-data" target="_blank">How to License Research Data</a>
545
+      Please see <a href="http://www.dcc.ac.uk/resources/how-guides/license-research-data" target="_blank">How to
546
+        License Research Data</a>
532 547
     </td>
533 548
   </tr>
534 549
 
@@ -558,8 +573,10 @@ class TorrentForm
558 573
       </select>
559 574
       <input type="text" id="tags" name="tags" size="60"
560 575
         value="<?= display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"
561
-        <?php Users::has_autocomplete_enabled('other'); ?> /><br />
562
-      Comma-seperated list of tags, n.b., use <strong class="important_text_alt">vanity.house</strong> for data you produced
576
+        <?php Users::has_autocomplete_enabled('other'); ?>
577
+      /><br />
578
+      Comma-seperated list of tags, n.b., use <strong class="important_text_alt">vanity.house</strong> for data you
579
+      produced
563 580
     </td>
564 581
   </tr>
565 582
 
@@ -582,7 +599,7 @@ class TorrentForm
582 599
       <textarea rows="8" cols="60" name="screenshots"
583 600
         id="screenshots"><?= display_str($Torrent['Screenshots'])?></textarea>
584 601
       Up to ten DOI numbers, one per line
585
-    </tr>
602
+  </tr>
586 603
   <?php } ?>
587 604
 
588 605
   <!-- Album description -->
@@ -626,8 +643,7 @@ class TorrentForm
626 643
   <tr id="censored_tr">
627 644
     <td class="label">Aligned Sequence</td>
628 645
     <td>
629
-      <input type="checkbox" name="censored" value="1"
630
-        <?= (($Torrent['Censored'] ?? 0) ? 'checked ' : '') ?>/>
646
+      <input type="checkbox" name="censored" value="1" <?= (($Torrent['Censored'] ?? 0) ? 'checked ' : '') ?>/>
631 647
       Whether the torrent contains raw reads or alignment data
632 648
     </td>
633 649
   </tr>
@@ -635,8 +651,7 @@ class TorrentForm
635 651
   <tr id="anon_tr">
636 652
     <td class="label">Upload Anonymously</td>
637 653
     <td>
638
-      <input type="checkbox" name="anonymous" value="1"
639
-        <?= (($Torrent['Anonymous'] ?? false) ? 'checked ' : '') ?>/>
654
+      <input type="checkbox" name="anonymous" value="1" <?= (($Torrent['Anonymous'] ?? false) ? 'checked ' : '') ?>/>
640 655
       Hide your username from other users on the torrent details page
641 656
     </td>
642 657
   </tr>

+ 31
- 0
download.php View File

@@ -0,0 +1,31 @@
1
+<?php
2
+
3
+/*
4
+ * Force file downloads
5
+ * Currently used to download BibTeX citations
6
+ * @todo Make this work with POST and display Show/Hide and Download buttons on the same line
7
+ *
8
+
9
+if (isset($_POST['file']) && isset($_POST['content'])) {
10
+    // Get parameters
11
+    $file = urldecode($_POST['file']); // Decode URL-encoded string
12
+    $content = urldecode($_POST['file']);
13
+
14
+    $filepath = "/tmp/$file.bib";
15
+    file_put_contents($filepath, $content);
16
+
17
+    // Process download
18
+    if (file_exists($filepath)) {
19
+        header('Content-Description: File Transfer');
20
+        header('Content-Type: text/plain');
21
+        header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
22
+        header('Expires: 0');
23
+        header('Cache-Control: must-revalidate');
24
+        header('Pragma: public');
25
+        header('Content-Length: ' . filesize($filepath));
26
+        flush(); // Flush system output buffer
27
+        readfile($filepath);
28
+        exit;
29
+    }
30
+}
31
+*/

+ 397
- 271
sections/torrents/details.php View File

@@ -120,204 +120,253 @@ View::show_header($Title, 'browse,comments,torrent,bbcode,recommend,cover_art,su
120 120
 ?>
121 121
 <div class="thin">
122 122
   <div class="header">
123
-    <h2><?=$DisplayName?></h2>
123
+    <h2><?=$DisplayName?>
124
+    </h2>
124 125
     <div class="linkbox">
125
-<?php  if (check_perms('site_edit_wiki')) { ?>
126
-      <a href="torrents.php?action=editgroup&amp;groupid=<?=$GroupID?>" class="brackets">Edit group</a>
127
-<?php  } ?>
128
-      <a href="torrents.php?action=history&amp;groupid=<?=$GroupID?>" class="brackets">View history</a>
129
-<?php  if ($RevisionID && check_perms('site_edit_wiki')) { ?>
130
-      <a href="torrents.php?action=revert&amp;groupid=<?=$GroupID ?>&amp;revisionid=<?=$RevisionID ?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
131
-<?php
126
+      <?php  if (check_perms('site_edit_wiki')) { ?>
127
+      <a href="torrents.php?action=editgroup&amp;groupid=<?=$GroupID?>"
128
+        class="brackets">Edit group</a>
129
+      <?php  } ?>
130
+      <a href="torrents.php?action=history&amp;groupid=<?=$GroupID?>"
131
+        class="brackets">View history</a>
132
+      <?php  if ($RevisionID && check_perms('site_edit_wiki')) { ?>
133
+      <a href="torrents.php?action=revert&amp;groupid=<?=$GroupID ?>&amp;revisionid=<?=$RevisionID ?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
134
+        class="brackets">Revert to this revision</a>
135
+      <?php
132 136
   }
133 137
   if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
134 138
       ?>
135
-      <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
136
-<?php
139
+      <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
140
+        class="remove_bookmark brackets"
141
+        onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove
142
+        bookmark</a>
143
+      <?php
137 144
   } else { ?>
138
-      <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark brackets" onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
139
-<?php  } ?>
140
-      <a href="#" id="subscribelink_torrents<?=$GroupID?>" class="brackets" onclick="SubscribeComments('torrents', <?=$GroupID?>); return false;"><?=Subscriptions::has_subscribed_comments('torrents', $GroupID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
141
-<?php
145
+      <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
146
+        class="add_bookmark brackets"
147
+        onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
148
+      <?php  } ?>
149
+      <a href="#" id="subscribelink_torrents<?=$GroupID?>"
150
+        class="brackets"
151
+        onclick="SubscribeComments('torrents', <?=$GroupID?>); return false;"><?=Subscriptions::has_subscribed_comments('torrents', $GroupID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
152
+      <?php
142 153
   if ($Categories[$GroupCategoryID-1] == 'Movies' || $Categories[$GroupCategoryID-1] == 'Anime' || $Categories[$GroupCategoryID-1] == 'Manga' || $Categories[$GroupCategoryID-1] == 'Games') { ?>
143
-      <a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add format</a>
144
-<?php
154
+      <a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add
155
+        format</a>
156
+      <?php
145 157
   }
146 158
   if (check_perms('site_submit_requests')) { ?>
147
-      <a href="requests.php?action=new&amp;groupid=<?=$GroupID?>" class="brackets">Request format</a>
148
-<?php  } ?>
149
-      <a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>" class="brackets">View log</a>
159
+      <a href="requests.php?action=new&amp;groupid=<?=$GroupID?>"
160
+        class="brackets">Request format</a>
161
+      <?php  } ?>
162
+      <a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>"
163
+        class="brackets">View log</a>
150 164
     </div>
151 165
   </div>
152
-<?php /* Misc::display_recommend($GroupID, "torrent"); */ ?>
166
+  <?php /* Misc::display_recommend($GroupID, "torrent"); */ ?>
153 167
   <div class="sidebar">
154
-    <div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
168
+    <div class="box box_image box_image_albumart box_albumart">
169
+      <!-- .box_albumart deprecated -->
155 170
       <div class="head">
156 171
         <strong><?=(count($CoverArt) > 0 ? 'Pictures (' . (count($CoverArt) + 1) . ')' : 'Picture')?></strong>
157
-<?php
172
+        <?php
158 173
       if (count($CoverArt) > 0) {
159 174
           if (empty($LoggedUser['ShowExtraCovers'])) {
160 175
               for ($Index = 0; $Index <= count($CoverArt); $Index++) { ?>
161
-        <span id="cover_controls_<?=($Index)?>"<?=($Index > 0 ? ' style="display: none;"' : '')?>>
162
-<?php            if ($Index == count($CoverArt)) { ?>
163
-            <a class="brackets prev_cover" data-gazelle-prev-cover="<?=($Index - 1)?>" href="#">Prev</a>
164
-            <a class="brackets show_all_covers" href="#">Show all</a>
165
-            <span class="brackets next_cover">Next</span>
166
-<?php            } elseif ($Index > 0) { ?>
167
-            <a class="brackets prev_cover" data-gazelle-prev-cover="<?=($Index - 1)?>" href="#">Prev</a>
168
-            <a class="brackets show_all_covers" href="#">Show all</a>
169
-            <a class="brackets next_cover" data-gazelle-next-cover="<?=($Index + 1)?>" href="#">Next</a>
170
-<?php            } elseif ($Index == 0 && count($CoverArt) > 0) { ?>
171
-            <span class="brackets prev_cover">Prev</span>
172
-            <a class="brackets show_all_covers" href="#">Show all</a>
173
-            <a class="brackets next_cover" data-gazelle-next-cover="<?=($Index + 1)?>" href="#">Next</a>
174
-<?php            } ?>
176
+        <span id="cover_controls_<?=($Index)?>" <?=($Index > 0 ? ' style="display: none;"' : '')?>>
177
+          <?php            if ($Index == count($CoverArt)) { ?>
178
+          <a class="brackets prev_cover"
179
+            data-gazelle-prev-cover="<?=($Index - 1)?>"
180
+            href="#">Prev</a>
181
+          <a class="brackets show_all_covers" href="#">Show all</a>
182
+          <span class="brackets next_cover">Next</span>
183
+          <?php            } elseif ($Index > 0) { ?>
184
+          <a class="brackets prev_cover"
185
+            data-gazelle-prev-cover="<?=($Index - 1)?>"
186
+            href="#">Prev</a>
187
+          <a class="brackets show_all_covers" href="#">Show all</a>
188
+          <a class="brackets next_cover"
189
+            data-gazelle-next-cover="<?=($Index + 1)?>"
190
+            href="#">Next</a>
191
+          <?php            } elseif ($Index == 0 && count($CoverArt) > 0) { ?>
192
+          <span class="brackets prev_cover">Prev</span>
193
+          <a class="brackets show_all_covers" href="#">Show all</a>
194
+          <a class="brackets next_cover"
195
+            data-gazelle-next-cover="<?=($Index + 1)?>"
196
+            href="#">Next</a>
197
+          <?php            } ?>
175 198
         </span>
176
-<?php
199
+        <?php
177 200
           }
178 201
           } else { ?>
179 202
         <span>
180 203
           <a class="brackets show_all_covers" href="#">Hide</a>
181 204
         </span>
182
-<?php
205
+        <?php
183 206
         }
184 207
       } ?>
185 208
       </div>
186
-<?php $Index = 0; ?>
187
-<div id="covers">
188
-<div id="cover_div_<?=$Index?>">
189
-<?php  if ($WikiImage != '') { ?>
190
-      <div><img width="100%" class="lightbox-init" src="<?=ImageTools::process($WikiImage, 'thumb')?>" lightbox-img="<?=ImageTools::process($WikiImage)?>" alt="<?=$AltName?>" /></div>
191
-<?php  } else { ?>
192
-      <div><img width="100%" src="<?=STATIC_SERVER?>common/noartwork/music.png" alt="<?=$Categories[$GroupCategoryID - 1]?>" class="brackets tooltip" title="<?=$Categories[$GroupCategoryID - 1]?>" /></div>
193
-<?php
209
+      <?php $Index = 0; ?>
210
+      <div id="covers">
211
+        <div id="cover_div_<?=$Index?>">
212
+          <?php  if ($WikiImage != '') { ?>
213
+          <div><img width="100%" class="lightbox-init"
214
+              src="<?=ImageTools::process($WikiImage, 'thumb')?>"
215
+              lightbox-img="<?=ImageTools::process($WikiImage)?>"
216
+              alt="<?=$AltName?>" /></div>
217
+          <?php  } else { ?>
218
+          <div><img width="100%"
219
+              src="<?=STATIC_SERVER?>common/noartwork/music.png"
220
+              alt="<?=$Categories[$GroupCategoryID - 1]?>"
221
+              class="brackets tooltip"
222
+              title="<?=$Categories[$GroupCategoryID - 1]?>" /></div>
223
+          <?php
194 224
   }
195 225
 $Index++;
196 226
 ?>
197
-</div>
198
-<?php      foreach ($CoverArt as $Cover) {
227
+        </div>
228
+        <?php      foreach ($CoverArt as $Cover) {
199 229
     list($ImageID, $Image, $Summary, $AddedBy) = $Cover; ?>
200
-          <div id="cover_div_<?=$Index?>"<?=(empty($LoggedUser['ShowExtraCovers']) ? ' style="display: none;"' : '')?>>
201
-        <div>
202
-<?php
230
+        <div id="cover_div_<?=$Index?>" <?=(empty($LoggedUser['ShowExtraCovers']) ? ' style="display: none;"' : '')?>>
231
+          <div>
232
+            <?php
203 233
           if (empty($LoggedUser['ShowExtraCovers'])) {
204 234
               $Src = 'src="" data-gazelle-temp-src="' . ImageTools::process($Image, 'thumb') . '" lightbox-img="'.ImageTools::process($Image).'"';
205 235
           } else {
206 236
               $Src = 'src="' . ImageTools::process($Image, 'thumb') . '" lightbox-img="'.ImageTools::process($Image).'"';
207 237
           } ?>
208
-          <img id="cover_<?=$Index?>" class="lightbox-init" width="100%" <?=$Src?> alt="<?=$Summary?>" />
238
+            <img id="cover_<?=$Index?>" class="lightbox-init"
239
+              width="100%" <?=$Src?> alt="<?=$Summary?>" />
240
+          </div>
241
+          <ul class="stats nobullet">
242
+            <li>
243
+              <?=$Summary?>
244
+              <?=(check_perms('users_mod') ? ' added by ' . Users::format_username($AddedBy, false, false, false, false, false) : '')?>
245
+              <span class="remove remove_cover_art"><a href="#"
246
+                  onclick="if (confirm('Do not delete valid alternative cover art. Are you sure you want to delete this cover art?') == true) { ajax.get('torrents.php?action=remove_cover_art&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;id=<?=$ImageID?>&amp;groupid=<?=$GroupID?>'); this.parentNode.parentNode.parentNode.style.display = 'none'; this.parentNode.parentNode.parentNode.previousElementSibling.style.display = 'none'; } else { return false; }"
247
+                  class="brackets tooltip" title="Remove image">X</a></span>
248
+            </li>
249
+          </ul>
209 250
         </div>
210
-        <ul class="stats nobullet">
211
-          <li>
212
-            <?=$Summary?>
213
-            <?=(check_perms('users_mod') ? ' added by ' . Users::format_username($AddedBy, false, false, false, false, false) : '')?>
214
-            <span class="remove remove_cover_art"><a href="#" onclick="if (confirm('Do not delete valid alternative cover art. Are you sure you want to delete this cover art?') == true) { ajax.get('torrents.php?action=remove_cover_art&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;id=<?=$ImageID?>&amp;groupid=<?=$GroupID?>'); this.parentNode.parentNode.parentNode.style.display = 'none'; this.parentNode.parentNode.parentNode.previousElementSibling.style.display = 'none'; } else { return false; }" class="brackets tooltip" title="Remove image">X</a></span>
215
-          </li>
216
-        </ul>
217
-      </div>
218
-<?php
251
+        <?php
219 252
         $Index++;
220 253
 } ?>
221
-    </div>
254
+      </div>
222 255
 
223
-<?php
256
+      <?php
224 257
     if (check_perms('site_edit_wiki') && $WikiImage != '') { ?>
225
-    <div id="add_cover_div">
226
-      <div style="padding: 10px;">
227
-        <span class="additional_add_artists float_right">
228
-          <a onclick="addCoverField(); return false;" href="#" class="brackets">Add alternate cover</a>
229
-        </span>
230
-      </div>
231
-      <div class="body">
232
-        <form class="add_form" name="covers" id="add_covers_form" action="torrents.php" method="post">
233
-          <div id="add_cover">
234
-            <input type="hidden" name="action" value="add_cover_art" />
235
-            <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
236
-            <input type="hidden" name="groupid" value="<?=$GroupID?>" />
237
-          </div>
238
-        </form>
258
+      <div id="add_cover_div">
259
+        <div style="padding: 10px;">
260
+          <span class="additional_add_artists float_right">
261
+            <a onclick="addCoverField(); return false;" href="#" class="brackets">Add alternate cover</a>
262
+          </span>
263
+        </div>
264
+        <div class="body">
265
+          <form class="add_form" name="covers" id="add_covers_form" action="torrents.php" method="post">
266
+            <div id="add_cover">
267
+              <input type="hidden" name="action" value="add_cover_art" />
268
+              <input type="hidden" name="auth"
269
+                value="<?=$LoggedUser['AuthKey']?>" />
270
+              <input type="hidden" name="groupid"
271
+                value="<?=$GroupID?>" />
272
+            </div>
273
+          </form>
274
+        </div>
239 275
       </div>
240
-    </div>
241
-<?php    } ?>
276
+      <?php    } ?>
242 277
 
243
-  </div>
278
+    </div>
244 279
     <div class="box box_artists">
245 280
       <div class="head"><strong>Author(s)</strong>
246
-      <?=check_perms('torrents_edit') ? '<span class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets float_right">Edit</a></span>' : ''?>
281
+        <?=check_perms('torrents_edit') ? '<span class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets float_right">Edit</a></span>' : ''?>
247 282
       </div>
248 283
       <ul class="stats nobullet" id="artist_list">
249
-<?php      foreach ($Artists as $Num => $Artist) { ?>
284
+        <?php      foreach ($Artists as $Num => $Artist) { ?>
250 285
         <li class="artist"><?=Artists::display_artist($Artist)?>
251
-        <?php if (check_perms('torrents_edit')) { ?>
252
-          <span class="remove remove_artist float_right"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&amp;auth=' + authkey + '&amp;groupid=<?=$GroupID?>&amp;artistid=<?=$Artist['id']?>&amp;importance=4'); this.parentNode.parentNode.style.display = 'none';" class="brackets tooltip" title="Remove artist">X</a></span>
253
-        <?php } ?>
286
+          <?php if (check_perms('torrents_edit')) { ?>
287
+          <span class="remove remove_artist float_right"><a href="javascript:void(0);"
288
+              onclick="ajax.get('torrents.php?action=delete_alias&amp;auth=' + authkey + '&amp;groupid=<?=$GroupID?>&amp;artistid=<?=$Artist['id']?>&amp;importance=4'); this.parentNode.parentNode.style.display = 'none';"
289
+              class="brackets tooltip" title="Remove artist">X</a></span>
290
+          <?php } ?>
254 291
         </li>
255
-<?php        } ?>
292
+        <?php        } ?>
256 293
       </ul>
257 294
     </div>
258
-<?php    if (check_perms('torrents_add_artist')) { ?>
295
+    <?php    if (check_perms('torrents_add_artist')) { ?>
259 296
     <div class="box box_addartists">
260 297
       <div class="head"><strong>Add Author</strong></div>
261 298
       <div class="body">
262 299
         <form class="flex_input_container" name="artists" action="torrents.php" method="post">
263 300
           <input type="hidden" name="action" value="add_alias" />
264
-          <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
265
-          <input type="hidden" name="groupid" value="<?=$GroupID?>" />
266
-          <input type="text" id="artist" name="artistname[]" <?php Users::has_autocomplete_enabled('other'); ?> />
301
+          <input type="hidden" name="auth"
302
+            value="<?=$LoggedUser['AuthKey']?>" />
303
+          <input type="hidden" name="groupid"
304
+            value="<?=$GroupID?>" />
305
+          <input type="text" id="artist" name="artistname[]" <?php Users::has_autocomplete_enabled('other'); ?>
306
+          />
267 307
           <input type="submit" value="Add" />
268 308
         </form>
269 309
       </div>
270 310
     </div>
271
-<?php
311
+    <?php
272 312
     }
273 313
 ?>
274 314
     <div class="box box_tags">
275 315
       <div class="head">
276 316
         <strong>Tags</strong>
277
-<?php
317
+        <?php
278 318
         $DeletedTag = $Cache->get_value("deleted_tags_$GroupID".'_'.$LoggedUser['ID']);
279 319
         if (!empty($DeletedTag)) { ?>
280
-          <form style="display: none;" id="undo_tag_delete_form" name="tags" action="torrents.php" method="post">
281
-            <input type="hidden" name="action" value="add_tag" />
282
-            <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
283
-            <input type="hidden" name="groupid" value="<?=$GroupID?>" />
284
-            <input type="hidden" name="tagname" value="<?=$DeletedTag?>" />
285
-            <input type="hidden" name="undo" value="true" />
286
-          </form>
287
-          <a class="brackets" href="#" onclick="$('#undo_tag_delete_form').raw().submit(); return false;">Undo delete</a>
320
+        <form style="display: none;" id="undo_tag_delete_form" name="tags" action="torrents.php" method="post">
321
+          <input type="hidden" name="action" value="add_tag" />
322
+          <input type="hidden" name="auth"
323
+            value="<?=$LoggedUser['AuthKey']?>" />
324
+          <input type="hidden" name="groupid"
325
+            value="<?=$GroupID?>" />
326
+          <input type="hidden" name="tagname"
327
+            value="<?=$DeletedTag?>" />
328
+          <input type="hidden" name="undo" value="true" />
329
+        </form>
330
+        <a class="brackets" href="#" onclick="$('#undo_tag_delete_form').raw().submit(); return false;">Undo delete</a>
288 331
 
289
-<?php        } ?>
332
+        <?php        } ?>
290 333
       </div>
291
-<?php
334
+      <?php
292 335
 if (count($Tags) > 0) {
293 336
             ?>
294 337
       <ul class="stats nobullet">
295
-<?php
338
+        <?php
296 339
   foreach ($Tags as $TagKey=>$Tag) {
297 340
       ?>
298 341
         <li>
299
-          <a href="torrents.php?taglist=<?=$Tag['name']?>" class="<?=display_str($Tag['class'])?>" ><?=display_str($Tag['display'])?></a>
342
+          <a href="torrents.php?taglist=<?=$Tag['name']?>"
343
+            class="<?=display_str($Tag['class'])?>"><?=display_str($Tag['display'])?></a>
300 344
           <div class="edit_tags_votes float_right">
301
-<?php    if (check_perms('users_warn')) { ?>
302
-          <a href="user.php?id=<?=$Tag['userid']?>" title="View the profile of the user that added this tag" class="brackets tooltip view_tag_user">U</a>
303
-<?php    } ?>
304
-<?php    if (empty($LoggedUser['DisableTagging']) && check_perms('site_delete_tag')) { ?>
305
-          <span class="remove remove_tag"><a href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets tooltip" title="Remove tag">X</a></span>
306
-<?php    } ?>
345
+            <?php    if (check_perms('users_warn')) { ?>
346
+            <a href="user.php?id=<?=$Tag['userid']?>"
347
+              title="View the profile of the user that added this tag" class="brackets tooltip view_tag_user">U</a>
348
+            <?php    } ?>
349
+            <?php    if (empty($LoggedUser['DisableTagging']) && check_perms('site_delete_tag')) { ?>
350
+            <span class="remove remove_tag"><a
351
+                href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
352
+                class="brackets tooltip" title="Remove tag">X</a></span>
353
+            <?php    } ?>
307 354
           </div>
308 355
         </li>
309
-<?php
356
+        <?php
310 357
   } ?>
311 358
       </ul>
312
-<?php
359
+      <?php
313 360
         } else { // The "no tags to display" message was wrapped in <ul> tags to pad the text.
314 361
 ?>
315
-      <ul><li>There are no tags to display.</li></ul>
316
-<?php
362
+      <ul>
363
+        <li>There are no tags to display.</li>
364
+      </ul>
365
+      <?php
317 366
 }
318 367
 ?>
319 368
     </div>
320
-<?php
369
+    <?php
321 370
 if (empty($LoggedUser['DisableTagging'])) {
322 371
     ?>
323 372
     <div class="box box_addtag">
@@ -325,35 +374,47 @@ if (empty($LoggedUser['DisableTagging'])) {
325 374
       <div class="body">
326 375
         <form class="flex_input_container" name="tags" action="torrents.php" method="post">
327 376
           <input type="hidden" name="action" value="add_tag" />
328
-          <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
329
-          <input type="hidden" name="groupid" value="<?=$GroupID?>" />
330
-          <input type="text" name="tagname" id="tagname" <?php Users::has_autocomplete_enabled('other'); ?> />
377
+          <input type="hidden" name="auth"
378
+            value="<?=$LoggedUser['AuthKey']?>" />
379
+          <input type="hidden" name="groupid"
380
+            value="<?=$GroupID?>" />
381
+          <input type="text" name="tagname" id="tagname" <?php Users::has_autocomplete_enabled('other'); ?>
382
+          />
331 383
           <input type="submit" value="Add" />
332 384
         </form>
333 385
         <br />
334 386
         <strong><a href="rules.php?p=tag" class="brackets">View tagging rules</a></strong>
335 387
       </div>
336 388
     </div>
337
-<?php
389
+    <?php
338 390
 }
339 391
 ?>
340 392
   </div>
341 393
   <div class="main_column">
342 394
     <div class="box">
343
-    <table class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : ''?>" id="torrent_details">
344
-      <tr class="colhead_dark">
345
-        <td width="80%"><strong>Torrents</strong></td>
346
-        <td><strong>Size</strong></td>
347
-        <td class="sign snatches">
348
-          <a><svg width="15" height="15" fill="white" 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></a>
349
-        <td class="sign seeders">
350
-          <a><svg width="11" height="15" fill="white" 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></a>
351
-        </td>
352
-        <td class="sign leechers">
353
-          <a><svg width="11" height="15" fill="white" 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></a>
354
-        </td>
355
-      </tr>
356
-<?php
395
+      <table
396
+        class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : ''?>"
397
+        id="torrent_details">
398
+        <tr class="colhead_dark">
399
+          <td width="80%"><strong>Torrents</strong></td>
400
+          <td><strong>Size</strong></td>
401
+          <td class="sign snatches">
402
+            <a><svg width="15" height="15" fill="white" class="tooltip" alt="Snatches" title="Snatches"
403
+                viewBox="3 0 88 98">
404
+                <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>
405
+              </svg></a>
406
+          <td class="sign seeders">
407
+            <a><svg width="11" height="15" fill="white" class="tooltip" alt="Seeders" title="Seeders">
408
+                <polygon points="0,7 5.5,0 11,7 8,7 8,15 3,15 3,7"></polygon>
409
+              </svg></a>
410
+          </td>
411
+          <td class="sign leechers">
412
+            <a><svg width="11" height="15" fill="white" class="tooltip" alt="Leechers" title="Leechers">
413
+                <polygon points="0,8 5.5,15 11,8 8,8 8,0 3,0 3,8"></polygon>
414
+              </svg></a>
415
+          </td>
416
+        </tr>
417
+        <?php
357 418
 function filelist($Str)
358 419
 {
359 420
     return "</td><td>".Format::get_size($Str[1])."</td></tr>";
@@ -560,81 +621,118 @@ foreach ($TorrentList as $Torrent) {
560 621
         $TorrentMG = "magnet:?dn=".rawurlencode($TorrentFileName)."&xt=urn:btih:".$InfoHash."&as=https://".SITE_DOMAIN."/".str_replace('&amp;', '%26', $TorrentDL)."&tr=".implode("/".$LoggedUser['torrent_pass']."/announce&tr=", ANNOUNCE_URLS[0])."/".$LoggedUser['torrent_pass']."/announce&xl=".$Size;
561 622
     } ?>
562 623
 
563
-      <tr class="torrent_row groupid_<?=$GroupID?> group_torrent<?=($IsSnatched ? ' snatched_torrent' : '')?>" style="font-weight: normal;" id="torrent<?=$TorrentID?>">
564
-        <td>
565
-          <span>[ <a href="<?=$TorrentDL?>" class="tooltip" title="Download"><?=($HasFile ? 'DL' : 'Missing')?></a>
566
-<?php  if (isset($TorrentMG)) { ?>
567
-            | <a href="<?=$TorrentMG?>" class="tooltip" title="Magnet Link">MG</a>
568
-<?php  }
624
+        <tr
625
+          class="torrent_row groupid_<?=$GroupID?> group_torrent<?=($IsSnatched ? ' snatched_torrent' : '')?>"
626
+          style="font-weight: normal;" id="torrent<?=$TorrentID?>">
627
+          <td>
628
+            <span>[ <a href="<?=$TorrentDL?>" class="tooltip"
629
+                title="Download"><?=($HasFile ? 'DL' : 'Missing')?></a>
630
+              <?php  if (isset($TorrentMG)) { ?>
631
+              | <a href="<?=$TorrentMG?>" class="tooltip"
632
+                title="Magnet Link">MG</a>
633
+              <?php  }
569 634
     if (Torrents::can_use_token($Torrent)) { ?>
570
-            | <a href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
571
-<?php  } ?>
572
-            | <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a>
573
-<?php  if ($CanEdit) { ?>
574
-            | <a href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>" class="tooltip" title="Edit release">ED</a>
575
-<?php  }
635
+              | <a
636
+                href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1"
637
+                class="tooltip" title="Use a FL Token"
638
+                onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
639
+              <?php  } ?>
640
+              | <a
641
+                href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>"
642
+                class="tooltip" title="Report">RP</a>
643
+              <?php  if ($CanEdit) { ?>
644
+              | <a
645
+                href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>"
646
+                class="tooltip" title="Edit release">ED</a>
647
+              <?php  }
576 648
     if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
577
-            | <a href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>" class="tooltip" title="Remove">RM</a>
578
-<?php  } ?>
579
-            | <a href="torrents.php?torrentid=<?=$TorrentID ?>" class="tooltip" title="Permalink">PL</a>
580
-          ]</span>
581
-          &raquo; <a data-toggle-target="#torrent_<?=$TorrentID?>"><?=$ExtraInfo; ?></a>
582
-        </td>
583
-        <td class="number_column nobr"><?=Format::get_size($Size)?></td>
584
-        <td class="number_column"><?=number_format($Snatched)?></td>
585
-        <td class="number_column"><?=number_format($Seeders)?></td>
586
-        <td class="number_column"><?=number_format($Leechers)?></td>
587
-      </tr>
588
-      <tr class=" groupid_<?=$GroupID?> torrentdetails pad <?php if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<?php } ?>" id="torrent_<?=$TorrentID; ?>">
589
-        <td colspan="5">
590
-          <div id="release_<?=$TorrentID?>" class="no_overflow">
591
-            <blockquote>
592
-              Uploaded by <?php
649
+              | <a
650
+                href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>"
651
+                class="tooltip" title="Remove">RM</a>
652
+              <?php  } ?>
653
+              | <a href="torrents.php?torrentid=<?=$TorrentID ?>"
654
+                class="tooltip" title="Permalink">PL</a>
655
+              ]</span>
656
+            &raquo; <a
657
+              data-toggle-target="#torrent_<?=$TorrentID?>"><?=$ExtraInfo; ?></a>
658
+          </td>
659
+          <td class="number_column nobr"><?=Format::get_size($Size)?>
660
+          </td>
661
+          <td class="number_column"><?=number_format($Snatched)?>
662
+          </td>
663
+          <td class="number_column"><?=number_format($Seeders)?>
664
+          </td>
665
+          <td class="number_column"><?=number_format($Leechers)?>
666
+          </td>
667
+        </tr>
668
+        <tr
669
+          class=" groupid_<?=$GroupID?> torrentdetails pad <?php if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<?php } ?>"
670
+          id="torrent_<?=$TorrentID; ?>">
671
+          <td colspan="5">
672
+            <div id="release_<?=$TorrentID?>" class="no_overflow">
673
+              <blockquote>
674
+                Uploaded by <?php
593 675
   if ($Anonymous) {
594 676
       if (check_perms('users_mod')) { ?>
595
-      <em class="tooltip" title="<?=Users::user_info($UserID)['Username']?>">Anonymous</em>
596
-<?php  } else {
677
+                <em class="tooltip"
678
+                  title="<?=Users::user_info($UserID)['Username']?>">Anonymous</em>
679
+                <?php  } else {
597 680
           ?><em>Anonymous</em><?php
598 681
       }
599 682
   } else {
600 683
       print Users::format_username($UserID, false, false, false);
601 684
   } ?> <?=time_diff($TorrentTime); ?>
602
-<?php  if ($Seeders == 0) {
685
+                <?php  if ($Seeders == 0) {
603 686
       if ($LastActive && time() - strtotime($LastActive) >= 1209600) { ?>
604
-            <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
605
-<?php    } else { ?>
606
-            <br />Last active: <?=time_diff($LastActive); ?>
607
-<?php    }
687
+                <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
688
+                <?php    } else { ?>
689
+                <br />Last active: <?=time_diff($LastActive); ?>
690
+                <?php    }
608 691
   }
609 692
 
610 693
     if (($Seeders == 0 && $LastActive && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
611
-            <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>" class="brackets">Request re-seed</a>
612
-<?php  } ?>
613
-            </blockquote>
614
-          </div>
615
-<?php  if (check_perms('site_moderate_requests')) { ?>
616
-          <div class="linkbox">
617
-            <a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>" class="brackets">Mass PM snatchers</a>
618
-          </div>
619
-<?php  } ?>
620
-          <div class="linkbox">
621
-            <a href="#" class="brackets" onclick="show_peers('<?=$TorrentID?>', 0); return false;">View peer list</a>
622
-<?php  if (check_perms('site_view_torrent_snatchlist')) { ?>
623
-            <a href="#" class="brackets tooltip" onclick="show_downloads('<?=$TorrentID?>', 0); return false;" title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
624
-            <a href="#" class="brackets tooltip" onclick="show_snatches('<?=$TorrentID?>', 0); return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
625
-<?php  } ?>
626
-            <a href="#" class="brackets" onclick="show_files('<?=$TorrentID?>'); return false;">View file list</a>
627
-<?php  if ($Reported) { ?>
628
-            <a href="#" class="brackets" onclick="show_reported('<?=$TorrentID?>'); return false;">View report information</a>
629
-<?php  } ?>
630
-          </div>
631
-          <div id="peers_<?=$TorrentID?>" class="hidden"></div>
632
-          <div id="downloads_<?=$TorrentID?>" class="hidden"></div>
633
-          <div id="snatches_<?=$TorrentID?>" class="hidden"></div>
634
-          <div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?></div>
635
-<?php  if ($Reported) { ?>
636
-          <div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?></div>
637
-<?php
694
+                <br /><a
695
+                  href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>"
696
+                  class="brackets">Request re-seed</a>
697
+                <?php  } ?>
698
+              </blockquote>
699
+            </div>
700
+            <?php  if (check_perms('site_moderate_requests')) { ?>
701
+            <div class="linkbox">
702
+              <a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"
703
+                class="brackets">Mass PM snatchers</a>
704
+            </div>
705
+            <?php  } ?>
706
+            <div class="linkbox">
707
+              <a href="#" class="brackets"
708
+                onclick="show_peers('<?=$TorrentID?>', 0); return false;">View
709
+                peer list</a>
710
+              <?php  if (check_perms('site_view_torrent_snatchlist')) { ?>
711
+              <a href="#" class="brackets tooltip"
712
+                onclick="show_downloads('<?=$TorrentID?>', 0); return false;"
713
+                title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
714
+              <a href="#" class="brackets tooltip"
715
+                onclick="show_snatches('<?=$TorrentID?>', 0); return false;"
716
+                title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
717
+              <?php  } ?>
718
+              <a href="#" class="brackets"
719
+                onclick="show_files('<?=$TorrentID?>'); return false;">View
720
+                file list</a>
721
+              <?php  if ($Reported) { ?>
722
+              <a href="#" class="brackets"
723
+                onclick="show_reported('<?=$TorrentID?>'); return false;">View
724
+                report information</a>
725
+              <?php  } ?>
726
+            </div>
727
+            <div id="peers_<?=$TorrentID?>" class="hidden"></div>
728
+            <div id="downloads_<?=$TorrentID?>" class="hidden"></div>
729
+            <div id="snatches_<?=$TorrentID?>" class="hidden"></div>
730
+            <div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?>
731
+            </div>
732
+            <?php  if ($Reported) { ?>
733
+            <div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?>
734
+            </div>
735
+            <?php
638 736
   }
639 737
     if (!empty($Description)) {
640 738
         echo "\n<blockquote>".Text::full_format($Description).'</blockquote>';
@@ -646,48 +744,56 @@ foreach ($TorrentList as $Torrent) {
646 744
             echo $parsed;
647 745
         } else {
648 746
             ?>
649
-  <div class="spoilerContainer hideContainer">
650
-    <input type="button" class="spoilerButton" value="Show BibTeX" /><blockquote class="spoiler hidden">
651
-<?php
747
+            <div class="spoilerContainer hideContainer">
748
+              <?php
749
+# Make a filename
750
+$filename = "BioTorrents.de-$TorrentID";
652 751
 
653
-# Make a BibTeX citation
654
-$bibtex = "
655
-<pre>
656
-@misc{ BioTorrents.de-$TorrentID,";
752
+            # Make a BibTeX citation
753
+            $bibtex = "
754
+@misc{ $filename,";
657 755
 
658
-foreach ($Artists as $Num => $Artist) {
659
-  $bibtex .= "\n  author = {".Artists::display_artist($Artist)."},";
660
-}
756
+            foreach ($Artists as $Num => $Artist) {
757
+                $bibtex .= "\n  author  = {".Artists::display_artist($Artist)."},";
758
+            }
661 759
 
662
-if(!empty($GroupNameRJ)) {
663
-  $bibtex .= "\n  title  = {".$GroupName." -- $GroupNameRJ $GroupNameJP},";
664
-} else {
665
-  $bibtex .= "\n  title  = {".$GroupName."},";
666
-}
760
+            if (!empty($GroupNameRJ)) {
761
+                $bibtex .= "\n  subtitle= {".$GroupNameRJ." ".$GroupNameJP."},";
762
+            }
667 763
   
668
-$bibtex .= "
669
-  year   = {".$GroupYear."},
670
-  url    = \href{https://biotorrents.de/torrents.php?torrentid=$TorrentID},
671
-  note   = {Online; accessed ".strftime('%Y-%m-%d')."},
672
-},
673
-</pre>";
674
-
675
-echo $bibtex;
676
-?>
764
+            $bibtex .= "
765
+  title   = {".$GroupName."},
766
+  year    = {".$GroupYear."},
767
+  url     = \href{https://biotorrents.de/torrents.php?torrentid=$TorrentID},
768
+  note    = {Online; accessed ".strftime('%Y-%m-%d')."},
769
+},"; ?>
677 770
 
678
-    </blockquote>
679
-  </div>
680
-<?php
771
+              <!-- @todo Download BibTeX citation feature
772
+<form method="post" action="download.php">
773
+<input type="hidden" name="file" id="file" value="<?=urlencode($filename)?>"
774
+              />
775
+              <input type="hidden" name="content" id="content"
776
+                value="<?=urlencode($bibtex)?>" />
777
+              <button type="submit">Download BibTeX</button>
778
+              </form>
779
+              -->
780
+
781
+              <!-- Both tags must be on the same line -->
782
+              <input type="button" class="spoilerButton" value="Show BibTeX" /><blockquote class="spoiler hidden">
783
+                <?="<pre>$bibtex</pre>"?>
784
+              </blockquote>
785
+            </div>
786
+            <?php
681 787
         }
682 788
         echo '</blockquote>';
683 789
     } ?>
684
-        </td>
685
-      </tr>
686
-<?php
790
+          </td>
791
+        </tr>
792
+        <?php
687 793
 } ?>
688
-    </table>
794
+      </table>
689 795
     </div>
690
-<?php
796
+    <?php
691 797
 $Requests = get_group_requests($GroupID);
692 798
 if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) {
693 799
     ?>
@@ -702,7 +808,7 @@ if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) {
702 808
           <td>Votes</td>
703 809
           <td>Bounty</td>
704 810
         </tr>
705
-<?php  foreach ($Requests as $Request) {
811
+        <?php  foreach ($Requests as $Request) {
706 812
         $RequestVotes = Requests::get_votes_array($Request['ID']);
707 813
 
708 814
         $RequestDesc = substr(explode('\n', Text::strip_bbcode($Request['Description']), 2)[0], 0, 70);
@@ -710,20 +816,25 @@ if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) {
710 816
             $RequestDesc = substr($RequestDesc, 0, 67) . '...';
711 817
         } ?>
712 818
         <tr class="requestrows row">
713
-          <td><a href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$RequestDesc?></a></td>
819
+          <td><a
820
+              href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$RequestDesc?></a></td>
714 821
           <td>
715
-            <span id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
716
-<?php      if (check_perms('site_vote')) { ?>
717
-            &nbsp;&nbsp; <a href="javascript:Vote(0, <?=$Request['ID']?>)" class="brackets">+</a>
718
-<?php      } ?>
822
+            <span
823
+              id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
824
+            <?php      if (check_perms('site_vote')) { ?>
825
+            &nbsp;&nbsp; <a
826
+              href="javascript:Vote(0, <?=$Request['ID']?>)"
827
+              class="brackets">+</a>
828
+            <?php      } ?>
829
+          </td>
830
+          <td><?=Format::get_size($RequestVotes['TotalBounty'])?>
719 831
           </td>
720
-          <td><?=Format::get_size($RequestVotes['TotalBounty'])?></td>
721 832
         </tr>
722
-<?php
833
+        <?php
723 834
     } ?>
724 835
       </table>
725 836
     </div>
726
-<?php
837
+    <?php
727 838
 }
728 839
 $Collages = $Cache->get_value("torrent_collages_$GroupID");
729 840
 if (!is_array($Collages)) {
@@ -750,28 +861,31 @@ if (count($Collages) > 0) {
750 861
     } ?>
751 862
     <table class="box collage_table" id="collages">
752 863
       <tr class="colhead">
753
-        <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($Collages))?> collection<?=((count($Collages) > 1) ? 's' : '')?><?=$SeeAll?></td>
864
+        <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($Collages))?> collection<?=((count($Collages) > 1) ? 's' : '')?><?=$SeeAll?>
865
+        </td>
754 866
         <td># torrents</td>
755 867
       </tr>
756
-<?php  foreach ($Indices as $i) {
868
+      <?php  foreach ($Indices as $i) {
757 869
         list($CollageName, $CollageTorrents, $CollageID) = $Collages[$i];
758 870
         unset($Collages[$i]); ?>
759 871
       <tr>
760 872
         <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
761
-        <td class="number_column"><?=number_format($CollageTorrents)?></td>
873
+        <td class="number_column"><?=number_format($CollageTorrents)?>
874
+        </td>
762 875
       </tr>
763
-<?php
876
+      <?php
764 877
     }
765 878
     foreach ($Collages as $Collage) {
766 879
         list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
767 880
       <tr class="collage_rows hidden">
768 881
         <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
769
-        <td class="number_column"><?=number_format($CollageTorrents)?></td>
882
+        <td class="number_column"><?=number_format($CollageTorrents)?>
883
+        </td>
770 884
       </tr>
771
-<?php
885
+      <?php
772 886
     } ?>
773 887
     </table>
774
-<?php
888
+    <?php
775 889
 }
776 890
 
777 891
 $PersonalCollages = $Cache->get_value("torrent_collages_personal_$GroupID");
@@ -800,48 +914,54 @@ if (count($PersonalCollages) > 0) {
800 914
     } ?>
801 915
     <table class="box collage_table" id="personal_collages">
802 916
       <tr class="colhead">
803
-        <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($PersonalCollages))?> personal collection<?=((count($PersonalCollages) > 1) ? 's' : '')?><?=$SeeAll?></td>
917
+        <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($PersonalCollages))?> personal
918
+          collection<?=((count($PersonalCollages) > 1) ? 's' : '')?><?=$SeeAll?>
919
+        </td>
804 920
         <td># torrents</td>
805 921
       </tr>
806
-<?php  foreach ($Indices as $i) {
922
+      <?php  foreach ($Indices as $i) {
807 923
         list($CollageName, $CollageTorrents, $CollageID) = $PersonalCollages[$i];
808 924
         unset($PersonalCollages[$i]); ?>
809 925
       <tr>
810 926
         <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
811
-        <td class="number_column"><?=number_format($CollageTorrents)?></td>
927
+        <td class="number_column"><?=number_format($CollageTorrents)?>
928
+        </td>
812 929
       </tr>
813
-<?php
930
+      <?php
814 931
     }
815 932
     foreach ($PersonalCollages as $Collage) {
816 933
         list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
817 934
       <tr class="personal_rows hidden">
818 935
         <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
819
-        <td class="number_column"><?=number_format($CollageTorrents)?></td>
936
+        <td class="number_column"><?=number_format($CollageTorrents)?>
937
+        </td>
820 938
       </tr>
821
-<?php
939
+      <?php
822 940
     } ?>
823 941
     </table>
824
-<?php
942
+    <?php
825 943
 }
826 944
 ?>
827 945
     <div class="box torrent_description">
828
-      <div class="head"><a href="#">&uarr;</a>&nbsp;<strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info')?></strong></div>
946
+      <div class="head"><a href="#">&uarr;</a>&nbsp;<strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info')?></strong>
947
+      </div>
829 948
       <div class="body"><?php if ($WikiBody != '') {
830 949
     echo $WikiBody;
831 950
 } else {
832 951
     echo 'There is no information on this torrent.';
833
-} ?></div>
952
+} ?>
953
+      </div>
834 954
     </div>
835 955
     <div class="box torrent_screenshots_box <?php if (!count($Screenshots)) {
836 956
     echo 'dead';
837 957
 } ?>">
838 958
       <div class="head"><a href="#">&uarr;</a>&nbsp;<strong>
839
-      Publications (<?= count($Screenshots) ?>)</strong>
840
-<?php
959
+          Publications (<?= count($Screenshots) ?>)</strong>
960
+        <?php
841 961
     if (count($Screenshots) > 0) {
842 962
         ?>
843
-    <a class="float_right brackets" data-toggle-target=".torrent_screenshots" data-toggle-replace="Show">Hide</a>
844
-<?php
963
+        <a class="float_right brackets" data-toggle-target=".torrent_screenshots" data-toggle-replace="Show">Hide</a>
964
+        <?php
845 965
     }
846 966
 
847 967
     $DB->query("
@@ -851,8 +971,9 @@ if (count($PersonalCollages) > 0) {
851 971
 
852 972
     if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit') || check_perms('screenshots_add') || check_perms('screenshots_delete')) {
853 973
         ?>
854
-    <a class="brackets" href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#screenshots_section">Add/Remove</a>
855
-<?php
974
+        <a class="brackets"
975
+          href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#screenshots_section">Add/Remove</a>
976
+        <?php
856 977
     }
857 978
 ?>
858 979
       </div>
@@ -861,7 +982,7 @@ if (count($PersonalCollages) > 0) {
861 982
     echo '<p>Sci-Hub links open in a new tab. Image proxy integration is coming soon.</p>';
862 983
 } ?>
863 984
         <ul>
864
-<?php
985
+          <?php
865 986
     foreach ($Screenshots as $Screenshot) {
866 987
         echo '<li><a href="https://sci-hub.'.SCI_HUB.'/'.$Screenshot['Image'].'" target="_blank">'.$Screenshot['Image'].'</a></li>';
867 988
 
@@ -881,23 +1002,28 @@ if (count($PersonalCollages) > 0) {
881 1002
 ?>
882 1003
         </ul>
883 1004
       </div>
884
-      <script>try{$('.torrent_screenshots>img').last().raw().style.width=($('.torrent_screenshots>img').length%2+1)*50+'%'}catch(e){}</script>
1005
+      <script>
1006
+        try {
1007
+          $('.torrent_screenshots>img').last().raw().style.width = ($('.torrent_screenshots>img').length % 2 + 1) * 50 +
1008
+            '%'
1009
+        } catch (e) {}
1010
+      </script>
885 1011
     </div>
886
-<?php
1012
+    <?php
887 1013
 // --- Comments ---
888 1014
 $Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
889 1015
 ?>
890
-  <div id="torrent_comments">
891
-    <div class="linkbox"><a name="comments"></a>
892
-      <?=$Pages?>
893
-    </div>
894
-<?php
1016
+    <div id="torrent_comments">
1017
+      <div class="linkbox"><a name="comments"></a>
1018
+        <?=$Pages?>
1019
+      </div>
1020
+      <?php
895 1021
 CommentsView::render_comments($Thread, $LastRead, "torrents.php?id=$GroupID");
896 1022
 ?>
897
-    <div class="linkbox">
898
-      <?=$Pages?>
899
-    </div>
900
-<?php
1023
+      <div class="linkbox">
1024
+        <?=$Pages?>
1025
+      </div>
1026
+      <?php
901 1027
   View::parse('generic/reply/quickreply.php', array(
902 1028
     'InputName' => 'pageid',
903 1029
     'InputID' => $GroupID,
@@ -910,4 +1036,4 @@ CommentsView::render_comments($Thread, $LastRead, "torrents.php?id=$GroupID");
910 1036
     </div>
911 1037
   </div>
912 1038
 </div>
913
-<?php View::show_footer(); ?>
1039
+<?php View::show_footer();

Loading…
Cancel
Save