Browse Source

Add announce flag to Torrents::freeleech_torrents, stop sitewide freeleech tool from announcing

spaghetti 8 years ago
parent
commit
6016e1c89a
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      classes/torrents.class.php
  2. 1
    1
      sections/tools/managers/sitewide_freeleech.php

+ 2
- 2
classes/torrents.class.php View File

@@ -742,7 +742,7 @@ class Torrents {
742 742
    * @param int $FreeNeutral 0 = normal, 1 = fl, 2 = nl
743 743
    * @param int $FreeLeechType 0 = Unknown, 1 = Staff picks, 2 = Perma-FL (Toolbox, etc.), 3 = Vanity House
744 744
    */
745
-  public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLeechType = 0) {
745
+  public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLeechType = 0, $Announce = true) {
746 746
     if (!is_array($TorrentIDs)) {
747 747
       $TorrentIDs = array($TorrentIDs);
748 748
     }
@@ -768,7 +768,7 @@ class Torrents {
768 768
       G::$Cache->delete_value("torrent_download_$TorrentID");
769 769
       Misc::write_log((G::$LoggedUser['Username']??'System')." marked torrent $TorrentID freeleech type $FreeLeechType");
770 770
       Torrents::write_group_log($GroupID, $TorrentID, (G::$LoggedUser['ID']??0), "marked as freeleech type $FreeLeechType", 0);
771
-      if ($FreeLeechType == 1 || $FreeLeechType == 3) {
771
+      if ($Announce && ($FreeLeechType == 1 || $FreeLeechType == 3)) {
772 772
         send_irc('PRIVMSG '.BOT_ANNOUNCE_CHAN.' FREELEECH - '.site_url()."torrents.php?id=$GroupID / ".site_url()."torrents.php?action=download&id=$TorrentID");
773 773
       }
774 774
     }

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

@@ -71,7 +71,7 @@ if (isset($_POST['type'])) {
71 71
           ('global', '" . (time() + (60 * 60 * $Duration)) . "', 'freeleech')
72 72
         ON DUPLICATE KEY UPDATE
73 73
           Value = CONVERT(Value, UNSIGNED INTEGER) + " . (60 * 60 * $Duration));
74
-      Torrents::freeleech_torrents($IDs, 1, 3);
74
+      Torrents::freeleech_torrents($IDs, 1, 3, false);
75 75
       echo("Success! Now run the indexer.");
76 76
     } else {
77 77
       error("RIP Oppaitime");

Loading…
Cancel
Save