ElectraHeart 1 year ago
parent
commit
8c9534db2a

+ 9
- 2
classes/cache.class.php View File

@@ -394,12 +394,19 @@ class Cache extends MemcacheCompat {
394 394
   /**
395 395
    * Get cache server status
396 396
    *
397
-   * @return array (host => bool status, ...)
397
+   * @return array (host => int status, ...)
398 398
    */
399 399
   public function server_status() {
400 400
     $Status = [];
401
+    if (is_subclass_of($this, 'Memcached')) {
402
+      $MemcachedStats = $this->getStats();
403
+    }
401 404
     foreach ($this->Servers as $Server) {
402
-      $Status["$Server[host]:$Server[port]"] = $this->getServerStatus($Server['host'], $Server['port']);
405
+      if (is_subclass_of($this, 'Memcached')) {
406
+        $Status["$Server[host]:$Server[port]"] = gettype($MemcachedStats["$Server[host]:$Server[port]"]) == 'array' ? 1 : 0;
407
+      } else {
408
+        $Status["$Server[host]:$Server[port]"] = $this->getServerStatus($Server['host'], $Server['port']);
409
+      }
403 410
     }
404 411
     return $Status;
405 412
   }

+ 1
- 1
classes/torrent_form.class.php View File

@@ -524,7 +524,7 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
524 524
             <option value="<?=$Genre?>"><?=$Genre?></option>
525 525
 <? } ?>
526 526
           </select>
527
-          <input type="text" id="tags" name="tags" size="60" value="<?=display_str($Torrent['TagList']) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
527
+          <input type="text" id="tags" name="tags" size="60" value="<?=display_str(implode(', ', explode(',', $Torrent['TagList']))) ?>"<? Users::has_autocomplete_enabled('other'); ?> />
528 528
           <p class="min_padding notes"></p>
529 529
         </td>
530 530
       </tr>

+ 19
- 90
sections/bookmarks/torrents.php View File

@@ -60,29 +60,18 @@ foreach ($GroupIDs as $GroupID) {
60 60
 
61 61
   $TorrentTags = new Tags($TagList);
62 62
 
63
-  /*if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
64
-      unset($ExtendedArtists[2]);
65
-      unset($ExtendedArtists[3]);
66
-      $DisplayName = Artists::display_artists($ExtendedArtists);
67
-  } elseif (count($Artists) > 0) {
68
-      $DisplayName = Artists::display_artists(array('1' => $Artists));
69
-  } else {
70
-    $DisplayName = '';
71
-  }*/
72
-
73 63
   $DisplayName = Artists::display_artists($Artists);
74 64
 
75 65
   $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
76 66
 
77
-  $DisplayName .= '<a href="torrents.php?id='.$GroupID.'" class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
67
+  $DisplayName .= '<a href="torrents.php?id='.$GroupID.'" ';
68
+  if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
69
+    $DisplayName .= 'onmouseover="getCover(event)" data-cover="'.ImageTools::process($WikiImage, 'thumb').'" onmouseleave="ungetCover(event)" ';
70
+  }
71
+  $DisplayName .= ' class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
78 72
   if ($GroupYear > 0) {
79 73
     $DisplayName = "$DisplayName [$GroupYear]";
80 74
   }
81
-  /*
82
-  if ($GroupVanityHouse) {
83
-    $DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
84
-  }
85
-  */
86 75
   $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
87 76
 
88 77
   // Start an output buffer, so we can store this output in $TorrentTable
@@ -91,17 +80,17 @@ foreach ($GroupIDs as $GroupID) {
91 80
       // Grouped torrents
92 81
       $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1);
93 82
 ?>
94
-      <tr class="group discog<?=$SnatchedGroupClass?>" id="group_<?=$GroupID?>">
83
+      <tr class="group" id="group_<?=$GroupID?>">
95 84
         <td class="center">
96 85
           <div id="showimg_<?=$GroupID?>" class="<?=($ShowGroups ? 'hide' : 'show')?>_torrents">
97
-            <a href="#" class="tooltip show_torrents_link" onclick="toggle_group(<?=$GroupID?>, this, event);" title="Collapse this group. Hold &quot;Ctrl&quot; while clicking to collape all groups on this page."></a>
86
+            <a class="tooltip show_torrents_link" onclick="toggle_group(<?=$GroupID?>, this, event);" title="Collapse this group. Hold &quot;Ctrl&quot; while clicking to collape all groups on this page."></a>
98 87
           </div>
99 88
         </td>
100 89
         <td class="center">
101
-          <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div>
90
+          <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?>"></div>
102 91
         </td>
103 92
         <td colspan="5">
104
-          <strong><?=$DisplayName?></strong>
93
+          <?=$DisplayName?>
105 94
           <span style="text-align: right;" class="float_right">
106 95
             <?=time_diff($AddedTime);?>
107 96
 <?    if (!$Sneaky) { ?>
@@ -113,46 +102,10 @@ foreach ($GroupIDs as $GroupID) {
113 102
         </td>
114 103
       </tr>
115 104
 <?
116
-    $LastRemasterYear = '-';
117
-    $LastRemasterTitle = '';
118
-    $LastRemasterRecordLabel = '';
119
-    $LastRemasterCatalogueNumber = '';
120
-    $LastMedia = '';
121
-
122
-    $EditionID = 0;
123
-    unset($FirstUnknown);
124
-
125 105
     foreach ($Torrents as $TorrentID => $Torrent) {
126
-/*
127
-      if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
128
-        $FirstUnknown = !isset($FirstUnknown);
129
-      }
130
-*/
131 106
       $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
132
-/*
133
-      if (
134
-        $Torrent['RemasterTitle'] != $LastRemasterTitle
135
-        || $Torrent['RemasterYear'] != $LastRemasterYear
136
-        || $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel
137
-        || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber
138
-        || $FirstUnknown
139
-        || $Torrent['Media'] != $LastMedia
140
-      ) {
141
-        $EditionID++;
142 107
 ?>
143
-  <tr class="group_torrent groupid_<?=$GroupID?> edition<?=$SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1 ? ' hidden' : '')?>">
144
-    <td colspan="7" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event)" class="tooltip" title="Collapse this edition. Hold &quot;Ctrl&quot; while clicking to collapse all editions in this torrent group.">&minus;</a> <?=Torrents::edition_string($Torrent, $Group)?></strong></td>
145
-  </tr>
146
-<?
147
-      }
148
-      $LastRemasterTitle = $Torrent['RemasterTitle'];
149
-      $LastRemasterYear = $Torrent['RemasterYear'];
150
-      $LastRemasterRecordLabel = $Torrent['RemasterRecordLabel'];
151
-      $LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
152
-      $LastMedia = $Torrent['Media'];
153
-*/
154
-?>
155
-  <tr class="group_torrent torrent_row groupid_<?=$GroupID?> edition_<?=$EditionID?><?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1 ? ' hidden' : '')?>">
108
+  <tr class="group_torrent torrent_row groupid_<?=$GroupID?> <?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1 ? ' hidden' : '')?>">
156 109
     <td colspan="3">
157 110
       <span>[ <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="tooltip" title="Download">DL</a>
158 111
 <?      if (Torrents::can_use_token($Torrent)) { ?>
@@ -177,7 +130,11 @@ foreach ($GroupIDs as $GroupID) {
177 130
 
178 131
     $DisplayName = Artists::display_artists(Artists::get_artist($GroupID));
179 132
 
180
-    $DisplayName .= '<a href="torrents.php?id='.$GroupID.'" class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
133
+    $DisplayName .= '<a href="torrents.php?id='.$GroupID.'" ';
134
+    if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
135
+      $DisplayName .= 'onmouseover="getCover(event)" data-cover="'.ImageTools::process($WikiImage, 'thumb').'" onmouseleave="ungetCover(event)" ';
136
+    }
137
+    $DisplayName .=' class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
181 138
 
182 139
     if ($Torrent['IsSnatched']) {
183 140
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
@@ -194,7 +151,7 @@ foreach ($GroupIDs as $GroupID) {
194 151
   <tr class="torrent torrent_row<?=$SnatchedTorrentClass . $SnatchedGroupClass?>" id="group_<?=$GroupID?>">
195 152
     <td></td>
196 153
     <td class="center">
197
-      <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>">
154
+      <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?>">
198 155
       </div>
199 156
     </td>
200 157
     <td>
@@ -209,7 +166,7 @@ foreach ($GroupIDs as $GroupID) {
209 166
 <?    if (!$Sneaky) { ?>
210 167
       <span class="float_right float_clear"><a href="#group_<?=$GroupID?>" class="brackets remove_bookmark" onclick="Unbookmark('torrent', <?=$GroupID?>, ''); return false;">Remove bookmark</a></span>
211 168
 <?    } ?>
212
-      <strong><?=$DisplayName?></strong>
169
+      <?=$DisplayName?>
213 170
       <div class="tags"><?=$TorrentTags->format()?></div>
214 171
 
215 172
     </td>
@@ -227,13 +184,6 @@ foreach ($GroupIDs as $GroupID) {
227 184
   ob_start();
228 185
 
229 186
   $DisplayName = '';
230
-  /*if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5])|| !empty($ExtendedArtists[6])) {
231
-    unset($ExtendedArtists[2]);
232
-    unset($ExtendedArtists[3]);
233
-    $DisplayName .= Artists::display_artists($ExtendedArtists, false);
234
-  } elseif (count($Artists) > 0) {
235
-    $DisplayName .= Artists::display_artists(array('1' => $Artists), false);
236
-  }*/
237 187
 
238 188
   $DisplayName .= Artists::display_artists($Artists, false);
239 189
 
@@ -244,17 +194,6 @@ foreach ($GroupIDs as $GroupID) {
244 194
   $Tags = display_str($TorrentTags->format());
245 195
   $PlainTags = implode(', ', $TorrentTags->get_tags());
246 196
 ?>
247
-<? /* ?>
248
-    <li class="image_group_<?=$GroupID?>">
249
-      <a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
250
-<?  if ($WikiImage) { ?>
251
-        <img class="tooltip_interactive" src="<?=ImageTools::process($WikiImage, 'thumb')?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?> <br /> <?=$Tags?>" data-title-plain="<?="$DisplayName ($PlainTags)"?>" width="118" />
252
-<?  } else { ?>
253
-        <div style="width: 107px; padding: 5px;"><?=$DisplayName?></div>
254
-<?  } ?>
255
-      </a>
256
-    </li>
257
-<? */ ?>
258 197
 <div class='collage_image image_group_<?=$GroupID?>'>
259 198
       <a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
260 199
 <?  if (!$WikiImage) {
@@ -355,7 +294,7 @@ View::show_header($Title, 'browse,collage,wall');
355 294
 if ($CollageCovers !== 0) { ?>
356 295
     <div id="coverart" class="box">
357 296
       <div class="head" id="coverhead"><strong>Cover art</strong></div>
358
-      <div class="collage_images" id="collage_page0">
297
+      <div class="collage_images" id="collage_page0" data-wall-child=".collage_image" data-wall-size="4", data-wall-min="2">
359 298
 <?
360 299
   $Page1 = array_slice($Collage, 0, $CollageCovers);
361 300
   foreach ($Page1 as $Group) {
@@ -363,16 +302,6 @@ if ($CollageCovers !== 0) { ?>
363 302
   }
364 303
 ?>
365 304
       </div>
366
-      <script>
367
-        $('.collage_image img').on('load', function() {
368
-          var test = true
369
-          $('.collage_image img').toArray().forEach(function(el) {
370
-            if (!el.complete) test = false
371
-          })
372
-          if (test) wall('.collage_images', '.collage_image', 4)
373
-        })
374
-        wall('.collage_images', '.collage_image', 4)
375
-      </script>
376 305
     </div>
377 306
 <?  if ($NumGroups > $CollageCovers) { ?>
378 307
     <div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
@@ -386,7 +315,7 @@ if ($CollageCovers !== 0) { ?>
386 315
       <span id="lastpage" class="<?=(ceil($NumGroups / $CollageCovers) === 2 ? 'invisible' : '')?>"> | <a href="#" id="lastpage" class="pageslink" onclick="collageShow.page(<?=(ceil($NumGroups / $CollageCovers) - 1)?>, this); return false;">Last &gt;&gt;</a></span>
387 316
     </div>
388 317
     <script type="text/javascript">
389
-      collageShow.init(<?=json_encode($CollagePages)?>);
318
+      $(()=>collageShow.init(<?=json_encode($CollagePages)?>));
390 319
     </script>
391 320
 <?
392 321
   }

+ 5
- 5
sections/collages/torrent_collage.php View File

@@ -105,7 +105,7 @@ foreach ($GroupIDs as $GroupID) {
105 105
           <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div>
106 106
         </td>
107 107
         <td colspan="5">
108
-          <strong><?=$DisplayName?></strong>
108
+          <?=$DisplayName?>
109 109
 <?    if (Bookmarks::has_bookmarked('torrent', $GroupID)) { ?>
110 110
           <span class="remove_bookmark float_right">
111 111
             <a class="float_right" href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
@@ -178,7 +178,7 @@ foreach ($GroupIDs as $GroupID) {
178 178
 <?    } ?>
179 179
             | <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a>
180 180
           </span>
181
-          <strong><?=$DisplayName?></strong>
181
+          <?=$DisplayName?>
182 182
           <div class="tags"><?=$TorrentTags->format()?></div>
183 183
         </td>
184 184
         <td class="number_column nobr"><?=Format::get_size($Torrent['Size'])?></td>
@@ -543,9 +543,9 @@ if ($CollageCovers != 0) { ?>
543 543
       <span id="nextpage"><a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;"><strong>Next &gt;</strong></a></span>
544 544
       <span id="lastpage" class="<?=(ceil($NumGroups / $CollageCovers) == 2 ? 'invisible' : '')?>"> | <a href="#" class="pageslink" onclick="collageShow.page(<?=ceil($NumGroups / $CollageCovers) - 1?>, this); return false;"><strong>Last &gt;&gt;</strong></a></span>
545 545
     </div>
546
-    <script type="text/javascript">//<![CDATA[
547
-      $(document).ready(function(){collageShow.init(<?=json_encode($CollagePages)?>)});
548
-    //]]></script>
546
+    <script type="text/javascript">
547
+      $(()=>collageShow.init(<?=json_encode($CollagePages)?>));
548
+    </script>
549 549
 <?
550 550
   }
551 551
 }

+ 12
- 12
sections/inbox/massdelete_handle.php View File

@@ -1,9 +1,7 @@
1 1
 <?
2
+authorize();
2 3
 
3
-/* replace
4 4
 $UserID = $LoggedUser['ID'];
5
-authorize();
6
-replace */
7 5
 
8 6
 if (!isset($_POST['messages']) || !is_array($_POST['messages'])) {
9 7
   error('You forgot to select messages to delete.');
@@ -33,22 +31,24 @@ if (isset($_POST['delete'])) {
33 31
   $DB->query("
34 32
     UPDATE pm_conversations_users
35 33
     SET
36
-      InInbox='0',
37
-      InSentbox='0',
38
-      Sticky='0',
39
-      UnRead='0'
34
+      InInbox = '0',
35
+      InSentbox = '0',
36
+      Sticky = '0',
37
+      UnRead = '0'
40 38
     WHERE ConvID IN($ConvIDs)
41
-      AND UserID=$UserID");
39
+      AND UserID = $UserID");
42 40
 } elseif (isset($_POST['unread'])) {
43 41
   $DB->query("
44 42
     UPDATE pm_conversations_users
45
-    SET Unread='1'
46
-    WHERE ConvID IN($ConvIDs) AND UserID=$UserID");
43
+    SET Unread = '1'
44
+    WHERE ConvID IN($ConvIDs)
45
+    AND InInbox = '1'
46
+    AND UserID = $UserID");
47 47
 } elseif (isset($_POST['read'])) {
48 48
   $DB->query("
49 49
     UPDATE pm_conversations_users
50
-    SET Unread='0'
51
-    WHERE ConvID IN($ConvIDs) AND UserID=$UserID");
50
+    SET Unread = '0'
51
+    WHERE ConvID IN($ConvIDs) AND UserID = $UserID");
52 52
 }
53 53
 $Cache->delete_value('inbox_new_'.$UserID);
54 54
 

+ 14
- 14
sections/inbox/takeedit.php View File

@@ -3,13 +3,11 @@ authorize();
3 3
 
4 4
 $UserID = $LoggedUser['ID'];
5 5
 $ConvID = $_POST['convid'];
6
-if (!is_number($ConvID)) {
7
-  error(404);
8
-}
6
+
9 7
 $DB->query("
10 8
   SELECT UserID
11 9
   FROM pm_conversations_users
12
-  WHERE UserID='$UserID' AND ConvID='$ConvID'");
10
+  WHERE UserID = ? AND ConvID = ?", $UserID, $ConvID);
13 11
 if (!$DB->has_results()) {
14 12
   error(403);
15 13
 }
@@ -18,27 +16,29 @@ if (isset($_POST['delete'])) {
18 16
   $DB->query("
19 17
     UPDATE pm_conversations_users
20 18
     SET
21
-      InInbox='0',
22
-      InSentbox='0',
23
-      Sticky='0'
24
-    WHERE ConvID='$ConvID' AND UserID='$UserID'");
19
+      InInbox = '0',
20
+      InSentbox = '0',
21
+      Sticky = '0'
22
+    WHERE ConvID = ? AND UserID = ?", $ConvID, $UserID);
25 23
 } else {
26 24
   if (isset($_POST['sticky'])) {
27 25
     $DB->query("
28 26
       UPDATE pm_conversations_users
29
-      SET Sticky='1'
30
-      WHERE ConvID='$ConvID' AND UserID='$UserID'");
27
+      SET Sticky = '1'
28
+      WHERE ConvID = ? AND UserID = ?", $ConvID, $UserID);
31 29
   } else {
32 30
     $DB->query("
33 31
       UPDATE pm_conversations_users
34
-      SET Sticky='0'
35
-      WHERE ConvID='$ConvID' AND UserID='$UserID'");
32
+      SET Sticky = '0'
33
+      WHERE ConvID = ? AND UserID = ?", $ConvID, $UserID);
36 34
   }
37 35
   if (isset($_POST['mark_unread'])) {
38 36
     $DB->query("
39 37
       UPDATE pm_conversations_users
40
-      SET Unread='1'
41
-      WHERE ConvID='$ConvID' AND UserID='$UserID'");
38
+      SET Unread = '1'
39
+      WHERE ConvID = ?
40
+      AND InInbox = '1'
41
+      AND UserID = ?", $ConvID, $UserID);
42 42
     $Cache->increment('inbox_new_'.$UserID);
43 43
   }
44 44
 }

+ 2
- 1
sections/reportsv2/array.php View File

@@ -32,7 +32,7 @@ $Types = array(
32 32
         'upload' => '0',
33 33
         'warn' => '0',
34 34
         'delete' => '1',
35
-        'pm' => '[rule]r1.1.3[/rule]. Your torrent was reported becasue it was a duplicate of another torrent.'
35
+        'pm' => '[rule]r1.1.4[/rule]. Your torrent was reported because it was a duplicate of another torrent.'
36 36
       )
37 37
     ),
38 38
     'banned' => array(
@@ -40,6 +40,7 @@ $Types = array(
40 40
       'reason' => '14',
41 41
       'title' => 'Specifically Banned',
42 42
       'report_messages' => array(
43
+        'Note that this report form is for content that is banned by name, not content that breaks a general uploading rule.',
43 44
         'Please specify exactly which entry on the Do Not Upload list this is violating.'
44 45
       ),
45 46
       'report_fields' => array(

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

@@ -168,7 +168,7 @@ View::show_header('Uploading Rules', 'rules');
168 168
             <li id="r1.2.6"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.6">1.2.6.</a>
169 169
               <strong>Torrents should never have [REQ] or [REQUEST] in the title or artist name.</strong> If you fill a request using the <a href="requests.php">Requests system</a>, everyone who voted for it will be automatically notified.
170 170
             </li>
171
-            <li id="r1.2.7"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.7">1.2.7.</a> <strong>Torrent titles must accurately reflect the actual titles.</strong> Use proper capitalization when giving titles. Typing titless in all lowercase letters or all capital letters is unacceptable and makes the torrent trumpable. Exceptions: If the album uses special capitalization, then you may follow that convention.</li>
171
+            <li id="r1.2.7"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.7">1.2.7.</a> <strong>Torrent titles must accurately reflect the actual titles.</strong> Use proper capitalization when giving titles. Typing titles in all lowercase letters or all capital letters is unacceptable and makes the torrent trumpable. Exceptions: If the album uses special capitalization, then you may follow that convention.</li>
172 172
             <li id="r1.2.8"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.8">1.2.8.</a>
173 173
               <strong>The Artist field in the torrent name should contain only the artist name.</strong> Do not add additional information about the artist in the artist field unless the work credits the artist in that manner. It is recommended that you search existing torrents for the artist name so that you can be sure that you name the artist the exact same way. A torrent with a proper artist name will be grouped with the existing torrents for that artist on a common artist page, and thus will be easy to find. Capitalization problems will also make a torrent trumpable. Labeling the artist incorrectly prevents your torrent from being grouped with the other torrents for the same artist.
174 174
             </li>

+ 10
- 16
sections/upload/upload_handle.php View File

@@ -270,8 +270,8 @@ if (count($TooLongPaths) > 0) {
270 270
   $Names = implode(' <br />', $TooLongPaths);
271 271
   $Err = "The torrent contained one or more files with too long a name:<br /> $Names";
272 272
 }
273
-$FilePath = db_string($DirName);
274
-$FileString = db_string(implode("\n", $TmpFileList));
273
+$FilePath = $DirName;
274
+$FileString = implode("\n", $TmpFileList);
275 275
 $Debug->set_flag('upload: torrent decoded');
276 276
 
277 277
 if (!empty($Err)) { // Show the upload form, with the data the user entered
@@ -476,20 +476,20 @@ if ($DB->has_results()) {
476 476
   $FreeLeechTags = $DB->to_array('Name');
477 477
   foreach ($FreeLeechTags as $Tag => $Exp) {
478 478
     if ($Tag == 'global' || in_array($Tag, $Tags)) {
479
-      $T['FreeTorrent'] = 1;
480
-      $T['FreeLeechType'] = 3;
479
+      $T['FreeTorrent'] = '1';
480
+      $T['FreeLeechType'] = '3';
481 481
       break;
482 482
     }
483 483
   }
484 484
 } else {
485
-  $T['FreeTorrent'] = 0;
486
-  $T['FreeLeechType'] = 0;
485
+  $T['FreeTorrent'] = '0';
486
+  $T['FreeLeechType'] = '0';
487 487
 }
488 488
 
489 489
 // movie and anime ISOs are neutral leech, and receive a BP bounty
490 490
 if (($Type == 'Movies' || $Type == 'Anime') && ($T['Container'] == 'ISO' || $T['Container'] == 'M2TS' || $T['Container'] == 'VOB IFO')) {
491
-  $T['FreeTorrent'] = 2;
492
-  $T['FreeLeechType'] = 2;
491
+  $T['FreeTorrent'] = '2';
492
+  $T['FreeLeechType'] = '2';
493 493
 }
494 494
 
495 495
 // Torrent
@@ -675,14 +675,8 @@ if (empty($ArtistsUnescaped)) {
675 675
 if (!empty($ArtistsUnescaped)) {
676 676
   $ArtistNameList = [];
677 677
   $GuestArtistNameList = [];
678
-  foreach ($ArtistsUnescaped as $Importance => $Artists) {
679
-    foreach ($Artists as $Artist) {
680
-      if ($Importance == 1 || $Importance == 4 || $Importance == 5 || $Importance == 6) {
681
-        $ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\', '\\\\', $Artist['name']), true)."|%'";
682
-      } else {
683
-        $GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\', '\\\\', $Artist['name']), true)."|%'";
684
-      }
685
-    }
678
+  foreach ($ArtistsUnescaped as $Importance => $Artist) {
679
+    $ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\', '\\\\', $Artist['name']), true)."|%'";
686 680
   }
687 681
   // Don't add notification if >2 main artists or if tracked artist isn't a main artist
688 682
   if (count($ArtistNameList) > 2 || $Artist['name'] == 'Various Artists') {

+ 2
- 13
sections/user/edit.php View File

@@ -376,22 +376,11 @@ echo $Val->GenerateJS('userform');
376 376
         </td>
377 377
       </tr>
378 378
       <tr id="comm_avatars_tr">
379
-        <td class="label tooltip" title="This option allows you to disable all avatars, show all avatars (with a placeholder for users without avatars), show all avatars &lt;em&gt;or&lt;/em&gt; an identicon set (for users without avatars), or replace all avatars with an identicon set of your choosing." data-title-plain="This option allows you to disable all avatars, show all avatars (with a placeholder for users without avatars), show all avatars or an identicon set (for users without avatars), or replace all avatars with an identicon set of your choosing."><strong>Avatar display (posts)</strong></td>
379
+        <td class="label tooltip" title="This option allows you to disable all avatars or show all avatars with a placeholder for users without avatars." data-title-plain="This option allows you to disable all avatars or show all avatars with a placeholder for users without avatars."><strong>Avatar display (posts)</strong></td>
380 380
         <td>
381
-          <select name="disableavatars" id="disableavatars" onclick="ToggleIdenticons();">
381
+          <select name="disableavatars" id="disableavatars">
382 382
             <option value="1"<?=$SiteOptions['DisableAvatars'] == 1 ? ' selected="selected"' : ''?>>Disable avatars</option>
383 383
             <option value="0"<?=$SiteOptions['DisableAvatars'] == 0 ? ' selected="selected"' : ''?>>Show avatars</option>
384
-            <option value="2"<?=$SiteOptions['DisableAvatars'] == 2 ? ' selected="selected"' : ''?>>Show avatars or:</option>
385
-            <option value="3"<?=$SiteOptions['DisableAvatars'] == 3 ? ' selected="selected"' : ''?>>Replace all avatars with:</option>
386
-          </select>
387
-          <select name="identicons" id="identicons">
388
-            <option value="0"<?=$SiteOptions['Identicons'] == 0 ? ' selected="selected"' : ''?>>Identicon</option>
389
-            <option value="1"<?=$SiteOptions['Identicons'] == 1 ? ' selected="selected"' : ''?>>MonsterID</option>
390
-            <option value="2"<?=$SiteOptions['Identicons'] == 2 ? ' selected="selected"' : ''?>>Wavatar</option>
391
-            <option value="3"<?=$SiteOptions['Identicons'] == 3 ? ' selected="selected"' : ''?>>Retro</option>
392
-            <option value="4"<?=$SiteOptions['Identicons'] == 4 ? ' selected="selected"' : ''?>>Robots 1</option>
393
-            <option value="5"<?=$SiteOptions['Identicons'] == 5 ? ' selected="selected"' : ''?>>Robots 2</option>
394
-            <option value="6"<?=$SiteOptions['Identicons'] == 6 ? ' selected="selected"' : ''?>>Robots 3</option>
395 384
           </select>
396 385
         </td>
397 386
       </tr>

+ 4
- 0
static/functions/validate_upload.js View File

@@ -18,6 +18,7 @@ $(() => {
18 18
     if ($('#album_desc').raw().value.length < 10) {
19 19
       hard_error('The group description is too short')
20 20
     }
21
+
21 22
     if ($('#file').raw().value.slice(-8).toLowerCase() != '.torrent') {
22 23
       soft_error('The file selected does not appear to be a .torrent file')
23 24
     }
@@ -28,6 +29,9 @@ $(() => {
28 29
     if (!$('#image').raw().value) {
29 30
       soft_error('You did not include a cover image, which is mandatory if one exists')
30 31
     }
32
+    if ($('#media_tr select').raw().value == 'DVD' && (['720p','1080i','1080p','4K'].includes($('#ressel').raw().value) || +$('#resolution').raw().value.split('x')[1] > 576)) {
33
+      soft_error('Your selected resolution is too high to be a DVD. Are you sure the media type should be DVD and not WEB?')
34
+    }
31 35
   })
32 36
   $('#tags').on('blur', e => $('#tags').raw().value = $('#tags').raw().value.split(',').map(t=>t.trim()).filter(t=>t).join(', '))
33 37
 })

+ 1
- 0
static/styles/global.css View File

@@ -102,6 +102,7 @@ ul.collage_images img {
102 102
 
103 103
 div.collage_image {
104 104
   width: 20%;
105
+  display: inline-block;
105 106
 }
106 107
 
107 108
 [data-toggle-target], [data-quote-jump], .clickable {

Loading…
Cancel
Save