BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

disable_leech.php 1.2KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. // If a user has downloaded more than 10 GiBs while on ratio watch, disable leeching privileges, and send the user a message
  3. $DB->query("
  4. SELECT ID, torrent_pass
  5. FROM users_info AS i
  6. JOIN users_main AS m ON m.ID = i.UserID
  7. WHERE i.RatioWatchEnds IS NOT NULL
  8. AND i.RatioWatchDownload + 10 * 1024 * 1024 * 1024 < m.Downloaded
  9. AND m.Enabled = '1'
  10. AND m.can_leech = '1'");
  11. $Users = $DB->to_pair('torrent_pass', 'ID');
  12. if (count($Users) > 0) {
  13. $Subject = 'Leeching Disabled';
  14. $Message = 'You have downloaded more than 10 GB while on Ratio Watch. Your leeching privileges have been disabled. Please reread the rules.';
  15. foreach ($Users as $TorrentPass => $UserID) {
  16. Misc::send_pm($UserID, 0, $Subject, $Message);
  17. Tracker::update_tracker('update_user', array('passkey' => $TorrentPass, 'can_leech' => '0'));
  18. }
  19. $DB->query("
  20. UPDATE users_info AS i
  21. JOIN users_main AS m ON m.ID = i.UserID
  22. SET m.can_leech = '0',
  23. i.AdminComment = CONCAT('$sqltime - Leeching privileges disabled by ratio watch system for downloading more than 10 GBs on ratio watch. - required ratio: ', m.RequiredRatio, '\n\n', i.AdminComment)
  24. WHERE m.ID IN(" . implode(',', $Users) . ')');
  25. }