Browse Source

Fix freeleeching new uploads during global freeleech

spaghetti 8 years ago
parent
commit
aeecef3ef4
2 changed files with 5 additions and 15 deletions
  1. 2
    2
      sections/tools/managers/sitewide_freeleech.php
  2. 3
    13
      sections/upload/upload_handle.php

+ 2
- 2
sections/tools/managers/sitewide_freeleech.php View File

@@ -37,7 +37,7 @@ if (isset($_POST['type'])) {
37 37
           VALUES
38 38
             ('" . $Tag . "', '" . (time() + (60 * 60 * $Duration)) . "', 'freeleech')
39 39
           ON DUPLICATE KEY UPDATE
40
-            Value = CONVERT(Value, UNSIGNED INTEGER) + " . (60 * 60 * $Duration));
40
+            First = CONVERT(First, UNSIGNED INTEGER) + " . (60 * 60 * $Duration));
41 41
         Torrents::freeleech_torrents($IDs, 1, 3);
42 42
         echo("Success! Now run the indexer.");
43 43
       } else {
@@ -70,7 +70,7 @@ if (isset($_POST['type'])) {
70 70
         VALUES
71 71
           ('global', '" . (time() + (60 * 60 * $Duration)) . "', 'freeleech')
72 72
         ON DUPLICATE KEY UPDATE
73
-          Value = CONVERT(Value, UNSIGNED INTEGER) + " . (60 * 60 * $Duration));
73
+          First = CONVERT(First, UNSIGNED INTEGER) + " . (60 * 60 * $Duration));
74 74
       Torrents::freeleech_torrents($IDs, 1, 3, false);
75 75
       echo("Success! Now run the indexer.");
76 76
     } else {

+ 3
- 13
sections/upload/upload_handle.php View File

@@ -535,7 +535,7 @@ if (!$Properties['GroupID']) {
535 535
 
536 536
 // Use this section to control freeleeches
537 537
 $DB->query("
538
-  SELECT First, Second
538
+  SELECT Name, First, Second
539 539
   FROM misc
540 540
   WHERE Second = 'freeleech'");
541 541
 if ($DB->has_results()) {
@@ -602,8 +602,8 @@ if ($T['FreeLeechType'] == 3) {
602 602
   $Expiry = 0;
603 603
   foreach ($FreeLeechTags as $Tag => $Exp) {
604 604
     if ($Tag == 'global' || in_array($Tag, $Tags)) {
605
-      if (((int) $FreeLeechTags[$Tag]['Value']) > $Expiry)
606
-        $Expiry = (int) $FreeLeechTags[$Tag]['Value'];
605
+      if (((int) $FreeLeechTags[$Tag]['First']) > $Expiry)
606
+        $Expiry = (int) $FreeLeechTags[$Tag]['First'];
607 607
     }
608 608
   }
609 609
   if ($Expiry > 0) {
@@ -660,16 +660,6 @@ if (trim($Properties['Image']) != '') {
660 660
   }
661 661
 }
662 662
 
663
-//******************************************************************************//
664
-//---------------------------------- Contest -----------------------------------//
665
-if ($Properties['LibraryImage'] != '') {
666
-  $DB->query("
667
-    INSERT INTO reportsv2
668
-      (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, Track, Image, ExtraID, Link)
669
-    VALUES
670
-      (0, $TorrentID, 'library', '".db_string(($Properties['MultiDisc'] ? 'Multi-disc' : ''))."', 'New', '".sqltime()."', '', '".db_string($Properties['LibraryImage'])."', '', '')");
671
-}
672
-
673 663
 //******************************************************************************//
674 664
 //------------------------------- Post-processing ------------------------------//
675 665
 /* Because tracker updates and notifications can be slow, we're

Loading…
Cancel
Save