ElectraHeart 7 years ago
parent
commit
8c9534db2a

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

394
   /**
394
   /**
395
    * Get cache server status
395
    * Get cache server status
396
    *
396
    *
397
-   * @return array (host => bool status, ...)
397
+   * @return array (host => int status, ...)
398
    */
398
    */
399
   public function server_status() {
399
   public function server_status() {
400
     $Status = [];
400
     $Status = [];
401
+    if (is_subclass_of($this, 'Memcached')) {
402
+      $MemcachedStats = $this->getStats();
403
+    }
401
     foreach ($this->Servers as $Server) {
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
     return $Status;
411
     return $Status;
405
   }
412
   }

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

524
             <option value="<?=$Genre?>"><?=$Genre?></option>
524
             <option value="<?=$Genre?>"><?=$Genre?></option>
525
 <? } ?>
525
 <? } ?>
526
           </select>
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
           <p class="min_padding notes"></p>
528
           <p class="min_padding notes"></p>
529
         </td>
529
         </td>
530
       </tr>
530
       </tr>

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

60
 
60
 
61
   $TorrentTags = new Tags($TagList);
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
   $DisplayName = Artists::display_artists($Artists);
63
   $DisplayName = Artists::display_artists($Artists);
74
 
64
 
75
   $GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
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
   if ($GroupYear > 0) {
72
   if ($GroupYear > 0) {
79
     $DisplayName = "$DisplayName [$GroupYear]";
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
   $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
75
   $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
87
 
76
 
88
   // Start an output buffer, so we can store this output in $TorrentTable
77
   // Start an output buffer, so we can store this output in $TorrentTable
91
       // Grouped torrents
80
       // Grouped torrents
92
       $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1);
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
         <td class="center">
84
         <td class="center">
96
           <div id="showimg_<?=$GroupID?>" class="<?=($ShowGroups ? 'hide' : 'show')?>_torrents">
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
           </div>
87
           </div>
99
         </td>
88
         </td>
100
         <td class="center">
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
         </td>
91
         </td>
103
         <td colspan="5">
92
         <td colspan="5">
104
-          <strong><?=$DisplayName?></strong>
93
+          <?=$DisplayName?>
105
           <span style="text-align: right;" class="float_right">
94
           <span style="text-align: right;" class="float_right">
106
             <?=time_diff($AddedTime);?>
95
             <?=time_diff($AddedTime);?>
107
 <?    if (!$Sneaky) { ?>
96
 <?    if (!$Sneaky) { ?>
113
         </td>
102
         </td>
114
       </tr>
103
       </tr>
115
 <?
104
 <?
116
-    $LastRemasterYear = '-';
117
-    $LastRemasterTitle = '';
118
-    $LastRemasterRecordLabel = '';
119
-    $LastRemasterCatalogueNumber = '';
120
-    $LastMedia = '';
121
-
122
-    $EditionID = 0;
123
-    unset($FirstUnknown);
124
-
125
     foreach ($Torrents as $TorrentID => $Torrent) {
105
     foreach ($Torrents as $TorrentID => $Torrent) {
126
-/*
127
-      if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
128
-        $FirstUnknown = !isset($FirstUnknown);
129
-      }
130
-*/
131
       $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
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
     <td colspan="3">
109
     <td colspan="3">
157
       <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>
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
 <?      if (Torrents::can_use_token($Torrent)) { ?>
111
 <?      if (Torrents::can_use_token($Torrent)) { ?>
177
 
130
 
178
     $DisplayName = Artists::display_artists(Artists::get_artist($GroupID));
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
     if ($Torrent['IsSnatched']) {
139
     if ($Torrent['IsSnatched']) {
183
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
140
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
194
   <tr class="torrent torrent_row<?=$SnatchedTorrentClass . $SnatchedGroupClass?>" id="group_<?=$GroupID?>">
151
   <tr class="torrent torrent_row<?=$SnatchedTorrentClass . $SnatchedGroupClass?>" id="group_<?=$GroupID?>">
195
     <td></td>
152
     <td></td>
196
     <td class="center">
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
       </div>
155
       </div>
199
     </td>
156
     </td>
200
     <td>
157
     <td>
209
 <?    if (!$Sneaky) { ?>
166
 <?    if (!$Sneaky) { ?>
210
       <span class="float_right float_clear"><a href="#group_<?=$GroupID?>" class="brackets remove_bookmark" onclick="Unbookmark('torrent', <?=$GroupID?>, ''); return false;">Remove bookmark</a></span>
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
       <div class="tags"><?=$TorrentTags->format()?></div>
170
       <div class="tags"><?=$TorrentTags->format()?></div>
214
 
171
 
215
     </td>
172
     </td>
227
   ob_start();
184
   ob_start();
228
 
185
 
229
   $DisplayName = '';
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
   $DisplayName .= Artists::display_artists($Artists, false);
188
   $DisplayName .= Artists::display_artists($Artists, false);
239
 
189
 
244
   $Tags = display_str($TorrentTags->format());
194
   $Tags = display_str($TorrentTags->format());
245
   $PlainTags = implode(', ', $TorrentTags->get_tags());
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
 <div class='collage_image image_group_<?=$GroupID?>'>
197
 <div class='collage_image image_group_<?=$GroupID?>'>
259
       <a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
198
       <a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
260
 <?  if (!$WikiImage) {
199
 <?  if (!$WikiImage) {
355
 if ($CollageCovers !== 0) { ?>
294
 if ($CollageCovers !== 0) { ?>
356
     <div id="coverart" class="box">
295
     <div id="coverart" class="box">
357
       <div class="head" id="coverhead"><strong>Cover art</strong></div>
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
   $Page1 = array_slice($Collage, 0, $CollageCovers);
299
   $Page1 = array_slice($Collage, 0, $CollageCovers);
361
   foreach ($Page1 as $Group) {
300
   foreach ($Page1 as $Group) {
363
   }
302
   }
364
 ?>
303
 ?>
365
       </div>
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
     </div>
305
     </div>
377
 <?  if ($NumGroups > $CollageCovers) { ?>
306
 <?  if ($NumGroups > $CollageCovers) { ?>
378
     <div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
307
     <div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
386
       <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>
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
     </div>
316
     </div>
388
     <script type="text/javascript">
317
     <script type="text/javascript">
389
-      collageShow.init(<?=json_encode($CollagePages)?>);
318
+      $(()=>collageShow.init(<?=json_encode($CollagePages)?>));
390
     </script>
319
     </script>
391
 <?
320
 <?
392
   }
321
   }

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

105
           <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div>
105
           <div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div>
106
         </td>
106
         </td>
107
         <td colspan="5">
107
         <td colspan="5">
108
-          <strong><?=$DisplayName?></strong>
108
+          <?=$DisplayName?>
109
 <?    if (Bookmarks::has_bookmarked('torrent', $GroupID)) { ?>
109
 <?    if (Bookmarks::has_bookmarked('torrent', $GroupID)) { ?>
110
           <span class="remove_bookmark float_right">
110
           <span class="remove_bookmark float_right">
111
             <a class="float_right" href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
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
 <?    } ?>
178
 <?    } ?>
179
             | <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a>
179
             | <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a>
180
           </span>
180
           </span>
181
-          <strong><?=$DisplayName?></strong>
181
+          <?=$DisplayName?>
182
           <div class="tags"><?=$TorrentTags->format()?></div>
182
           <div class="tags"><?=$TorrentTags->format()?></div>
183
         </td>
183
         </td>
184
         <td class="number_column nobr"><?=Format::get_size($Torrent['Size'])?></td>
184
         <td class="number_column nobr"><?=Format::get_size($Torrent['Size'])?></td>
543
       <span id="nextpage"><a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;"><strong>Next &gt;</strong></a></span>
543
       <span id="nextpage"><a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;"><strong>Next &gt;</strong></a></span>
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>
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
     </div>
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
 <?
1
 <?
2
+authorize();
2
 
3
 
3
-/* replace
4
 $UserID = $LoggedUser['ID'];
4
 $UserID = $LoggedUser['ID'];
5
-authorize();
6
-replace */
7
 
5
 
8
 if (!isset($_POST['messages']) || !is_array($_POST['messages'])) {
6
 if (!isset($_POST['messages']) || !is_array($_POST['messages'])) {
9
   error('You forgot to select messages to delete.');
7
   error('You forgot to select messages to delete.');
33
   $DB->query("
31
   $DB->query("
34
     UPDATE pm_conversations_users
32
     UPDATE pm_conversations_users
35
     SET
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
     WHERE ConvID IN($ConvIDs)
38
     WHERE ConvID IN($ConvIDs)
41
-      AND UserID=$UserID");
39
+      AND UserID = $UserID");
42
 } elseif (isset($_POST['unread'])) {
40
 } elseif (isset($_POST['unread'])) {
43
   $DB->query("
41
   $DB->query("
44
     UPDATE pm_conversations_users
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
 } elseif (isset($_POST['read'])) {
47
 } elseif (isset($_POST['read'])) {
48
   $DB->query("
48
   $DB->query("
49
     UPDATE pm_conversations_users
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
 $Cache->delete_value('inbox_new_'.$UserID);
53
 $Cache->delete_value('inbox_new_'.$UserID);
54
 
54
 

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

3
 
3
 
4
 $UserID = $LoggedUser['ID'];
4
 $UserID = $LoggedUser['ID'];
5
 $ConvID = $_POST['convid'];
5
 $ConvID = $_POST['convid'];
6
-if (!is_number($ConvID)) {
7
-  error(404);
8
-}
6
+
9
 $DB->query("
7
 $DB->query("
10
   SELECT UserID
8
   SELECT UserID
11
   FROM pm_conversations_users
9
   FROM pm_conversations_users
12
-  WHERE UserID='$UserID' AND ConvID='$ConvID'");
10
+  WHERE UserID = ? AND ConvID = ?", $UserID, $ConvID);
13
 if (!$DB->has_results()) {
11
 if (!$DB->has_results()) {
14
   error(403);
12
   error(403);
15
 }
13
 }
18
   $DB->query("
16
   $DB->query("
19
     UPDATE pm_conversations_users
17
     UPDATE pm_conversations_users
20
     SET
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
 } else {
23
 } else {
26
   if (isset($_POST['sticky'])) {
24
   if (isset($_POST['sticky'])) {
27
     $DB->query("
25
     $DB->query("
28
       UPDATE pm_conversations_users
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
   } else {
29
   } else {
32
     $DB->query("
30
     $DB->query("
33
       UPDATE pm_conversations_users
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
   if (isset($_POST['mark_unread'])) {
35
   if (isset($_POST['mark_unread'])) {
38
     $DB->query("
36
     $DB->query("
39
       UPDATE pm_conversations_users
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
     $Cache->increment('inbox_new_'.$UserID);
42
     $Cache->increment('inbox_new_'.$UserID);
43
   }
43
   }
44
 }
44
 }

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

32
         'upload' => '0',
32
         'upload' => '0',
33
         'warn' => '0',
33
         'warn' => '0',
34
         'delete' => '1',
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
     'banned' => array(
38
     'banned' => array(
40
       'reason' => '14',
40
       'reason' => '14',
41
       'title' => 'Specifically Banned',
41
       'title' => 'Specifically Banned',
42
       'report_messages' => array(
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
         'Please specify exactly which entry on the Do Not Upload list this is violating.'
44
         'Please specify exactly which entry on the Do Not Upload list this is violating.'
44
       ),
45
       ),
45
       'report_fields' => array(
46
       'report_fields' => array(

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

168
             <li id="r1.2.6"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.6">1.2.6.</a>
168
             <li id="r1.2.6"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.6">1.2.6.</a>
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.
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
             </li>
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
             <li id="r1.2.8"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.8">1.2.8.</a>
172
             <li id="r1.2.8"><a href="#h2.1"><strong>&uarr;</strong></a> <a href="#r1.2.8">1.2.8.</a>
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.
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
             </li>
174
             </li>

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

270
   $Names = implode(' <br />', $TooLongPaths);
270
   $Names = implode(' <br />', $TooLongPaths);
271
   $Err = "The torrent contained one or more files with too long a name:<br /> $Names";
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
 $Debug->set_flag('upload: torrent decoded');
275
 $Debug->set_flag('upload: torrent decoded');
276
 
276
 
277
 if (!empty($Err)) { // Show the upload form, with the data the user entered
277
 if (!empty($Err)) { // Show the upload form, with the data the user entered
476
   $FreeLeechTags = $DB->to_array('Name');
476
   $FreeLeechTags = $DB->to_array('Name');
477
   foreach ($FreeLeechTags as $Tag => $Exp) {
477
   foreach ($FreeLeechTags as $Tag => $Exp) {
478
     if ($Tag == 'global' || in_array($Tag, $Tags)) {
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
       break;
481
       break;
482
     }
482
     }
483
   }
483
   }
484
 } else {
484
 } else {
485
-  $T['FreeTorrent'] = 0;
486
-  $T['FreeLeechType'] = 0;
485
+  $T['FreeTorrent'] = '0';
486
+  $T['FreeLeechType'] = '0';
487
 }
487
 }
488
 
488
 
489
 // movie and anime ISOs are neutral leech, and receive a BP bounty
489
 // movie and anime ISOs are neutral leech, and receive a BP bounty
490
 if (($Type == 'Movies' || $Type == 'Anime') && ($T['Container'] == 'ISO' || $T['Container'] == 'M2TS' || $T['Container'] == 'VOB IFO')) {
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
 // Torrent
495
 // Torrent
675
 if (!empty($ArtistsUnescaped)) {
675
 if (!empty($ArtistsUnescaped)) {
676
   $ArtistNameList = [];
676
   $ArtistNameList = [];
677
   $GuestArtistNameList = [];
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
   // Don't add notification if >2 main artists or if tracked artist isn't a main artist
681
   // Don't add notification if >2 main artists or if tracked artist isn't a main artist
688
   if (count($ArtistNameList) > 2 || $Artist['name'] == 'Various Artists') {
682
   if (count($ArtistNameList) > 2 || $Artist['name'] == 'Various Artists') {

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

376
         </td>
376
         </td>
377
       </tr>
377
       </tr>
378
       <tr id="comm_avatars_tr">
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
         <td>
380
         <td>
381
-          <select name="disableavatars" id="disableavatars" onclick="ToggleIdenticons();">
381
+          <select name="disableavatars" id="disableavatars">
382
             <option value="1"<?=$SiteOptions['DisableAvatars'] == 1 ? ' selected="selected"' : ''?>>Disable avatars</option>
382
             <option value="1"<?=$SiteOptions['DisableAvatars'] == 1 ? ' selected="selected"' : ''?>>Disable avatars</option>
383
             <option value="0"<?=$SiteOptions['DisableAvatars'] == 0 ? ' selected="selected"' : ''?>>Show avatars</option>
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
           </select>
384
           </select>
396
         </td>
385
         </td>
397
       </tr>
386
       </tr>

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

18
     if ($('#album_desc').raw().value.length < 10) {
18
     if ($('#album_desc').raw().value.length < 10) {
19
       hard_error('The group description is too short')
19
       hard_error('The group description is too short')
20
     }
20
     }
21
+
21
     if ($('#file').raw().value.slice(-8).toLowerCase() != '.torrent') {
22
     if ($('#file').raw().value.slice(-8).toLowerCase() != '.torrent') {
22
       soft_error('The file selected does not appear to be a .torrent file')
23
       soft_error('The file selected does not appear to be a .torrent file')
23
     }
24
     }
28
     if (!$('#image').raw().value) {
29
     if (!$('#image').raw().value) {
29
       soft_error('You did not include a cover image, which is mandatory if one exists')
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
   $('#tags').on('blur', e => $('#tags').raw().value = $('#tags').raw().value.split(',').map(t=>t.trim()).filter(t=>t).join(', '))
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
 
102
 
103
 div.collage_image {
103
 div.collage_image {
104
   width: 20%;
104
   width: 20%;
105
+  display: inline-block;
105
 }
106
 }
106
 
107
 
107
 [data-toggle-target], [data-quote-jump], .clickable {
108
 [data-toggle-target], [data-quote-jump], .clickable {

Loading…
Cancel
Save