Browse Source

Fix minor trump resolve issues

spaghetti 7 years ago
parent
commit
17b1970ec6

+ 4
- 3
sections/reportsv2/takeresolve.php View File

@@ -230,15 +230,16 @@ if ($DB->affected_rows() > 0 || !$Report) {
230 230
           $AffectedUsers[] = $UserID;
231 231
         }
232 232
       }
233
+      $AffectedUsers = array_unique($AffectedUsers);
233 234
       foreach ($AffectedUsers as $UserID) {
234 235
         Tracker::update_tracker('add_token', ['info_hash' => substr('%'.chunk_split($InfoHash,2,'%'),0,-1), 'userid' => $UserID]);
235 236
         $DB->query("
236
-          INSERT INTO users_freeleeches (UserID, TorrentID, Time)
237
-          VALUES ($UserID, $ExtraID, NOW())
237
+          INSERT INTO users_freeleeches (UserID, TorrentID, Time, Uses)
238
+          VALUES ($UserID, $ExtraID, NOW(), 0)
238 239
           ON DUPLICATE KEY UPDATE
239 240
             Time = VALUES(Time),
240 241
             Expired = FALSE,
241
-            Uses = 0");
242
+            Uses = Uses");
242 243
         Misc::send_pm($UserID, 0, "Torrent Deleted: ".$RawName, "A torrent you have snatched (or uploaded) has been trumped by a more recent torrent. This new torrent will be freeleech for you for the next 4 days.\r\n\r\nYou can find the new torrent [url=".site_url()."torrents.php?torrentid=$ExtraID]here[/url]");
243 244
         $Cache->delete_value("users_tokens_$UserID");
244 245
       }

+ 1
- 1
sections/schedule/every/expire_tokens.php View File

@@ -8,7 +8,7 @@ $DB->query("
8 8
     AND Time < (NOW() - INTERVAL 4 DAY)");
9 9
 if ($DB->has_results()) {
10 10
   while (list($UserID) = $DB->next_record()) {
11
-    $Cache->delete_value('users_tokens_'.$UserID[0]);
11
+    $Cache->delete_value("users_tokens_$UserID");
12 12
   }
13 13
 
14 14
   $DB->query("

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

@@ -8,7 +8,7 @@
8 8
 
9 9
 // Maximum allowed size for uploaded files.
10 10
 // http://php.net/upload-max-filesize
11
-ini_set('upload_max_filesize', 2097152); // 2 Mibibytes
11
+ini_set('upload_max_filesize', 2097152); // 2 Mebibytes
12 12
 
13 13
 ini_set('max_file_uploads', 100);
14 14
 define('MAX_FILENAME_LENGTH', 180);

Loading…
Cancel
Save