Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Hit and Run Issue
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2024-09-10 17:19:32
I have the default function installed on my TT version. But some of the users Pm'ed me that the HR function is somehow broken. They have the torrents on seeding for quite long time and they have the HR announce on those torrents on main page.

What is your sugestion to check? I use the TT 3.0 version.
Last edited by Astaroth on 2024-09-10 17:25:22
2024-09-11 20:54:27
Hello,
What code do you have in the cleanup.php file for the Hit and Run System


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2024-09-11 21:28:00
//hit mod
$site_config["hnr_deadline"] = 7*86400; // 7 days to hit the seed target
$site_config["hnr_seedtime"] = 1*86400; // target is to seed for 5 days
$site_config["hnr_warn"] = 5; // 5 hit & runs then warned
$site_config["hnr_stop_dl"] = 5;  // After 5 H & R stop downloading
$site_config["hnr_ban"] = 50;  // After 50 H&R they are banned
$site_config["hnr_disabled"] = 50*86400;



It is the default one. I guess the problem it is în snachlist.php but I need some advice.
2024-09-11 21:35:09

//HIT & RUN mod
  $timenow = gmtime();
  SQL_Query_exec("UPDATE snatched SET hnr = 'yes' WHERE completed = '1' AND hnr = 'no' AND uload < dload AND $timenow - $site_config[hnr_deadline] > stime AND $site_config[hnr_seedtime] >= ltime AND done='no'");
  SQL_Query_exec("UPDATE `snatched` SET `hnr` = 'no' WHERE `hnr` = 'yes' AND uload >= dload");
  SQL_Query_exec("UPDATE `snatched` SET `hnr` = 'no' WHERE `hnr` = 'yes' AND ltime >= $site_config[hnr_seedtime]");
  $a = SQL_Query_exec("SELECT DISTINCT uid FROM snatched WHERE hnr = 'yes' AND done='no'");
  if ( mysqli_num_rows($a) > 0 ) :
  while ($b = mysqli_fetch_row($a)) :
  $c = SQL_Query_exec("SELECT COUNT( hnr ) FROM snatched WHERE uid = $b[0] AND hnr = 'yes'");
  $d = mysqli_fetch_row($c);
  $count = $d[0];
  $user = $b[0];

  $length = $site_config["hnr_disabled"];
  $expiretime = gmdate("Y-m-d H:i:s", $timenow + $length);

  $e = SQL_Query_exec("SELECT type, active FROM warnings WHERE userid = '$user'");
  $f = mysqli_fetch_row($e);
  $type = $f[0];
  $active = $f[1];

  //warn
  if ( $count >= $site_config["hnr_warn"] && $type != "HnR" ) :
  $reason = "".T_("CLEANUP_WARNING_FOR_ACCUMULATING")." ".$site_config['hnr_warn']." H&R.";
  $subject = "".T_("CLEANUP_WARNING_FOR_H&R")."";
  $msg = "".T_("CLEANUP_YOU_HAVE_BEEN_WARNEWD_ACCUMULATED")." ".$site_config['hnr_warn']." ".T_("CLEANUP_H&R_INVITE_CHECK_RULE")."\n".T_("CLEANUP_MSG_WARNING_7_DAYS_BANNED")."";

  $rev = SQL_Query_exec("SELECT enabled FROM users WHERE id = $user");
  $rov = mysqli_fetch_assoc($rev);
  if ($site_config["hnr_stop_dl"]){
  SQL_Query_exec("UPDATE users SET downloadbanned = 'yes' WHERE id = $user");
  }
  if ($rov["enabled"] == "yes") :
                   SQL_Query_exec("UPDATE users SET warned = 'yes' WHERE id = $user");

                   SQL_Query_exec("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ($user,".sqlesc($reason).",'".get_date_time()."','".$expiretime."','0','HnR')");
 
                   SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES (0, $user, '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", 1)");
  endif;
  endif;

  //Unwarned
$timenow = gmtime();

// Update active timed warnings that have expired
SQL_Query_exec("UPDATE warnings SET active = 'no' WHERE active = 'yes' AND expiry < '".get_date_time()."'");

$res = SQL_Query_exec("SELECT users.id, users.username, warnings.expiry FROM users INNER JOIN warnings ON users.id = warnings.userid WHERE warned = 'yes' AND enabled = 'yes' AND warnings.active = 'yes'");

while ($arr1 = mysqli_fetch_assoc($res)) {
   $user = $arr1["id"];
   $type = "HnR"; // Assuming the warning type is HnR

   $subject = "".T_("CLEANUP_REMOVAL_OF_H&R_WARNING")."";
   $msg = "".T_("CLEANUP_YOU_NOW_HAVE_LESS_THAN")." ".$site_config['hnr_warn']." H&R.\n".T_("CLEANUP_YOUR_WARNING_FOR_H&R_HAS_REMOVED")."";

   // Get the HnR count for the user
   $hnrCountResult = SQL_Query_exec("SELECT COUNT(*) FROM snatched WHERE uid = $user AND hnr = 'yes'");
   $hnrCount = mysqli_fetch_row($hnrCountResult)[0];

   // Check if the user's HnR count is zero and they have a timed warning
   if ($hnrCount == 0 && $type == "HnR") {
       // Remove the warning for a user with zero HnR count and a timed warning
       SQL_Query_exec("UPDATE users SET warned = 'no' WHERE id = $user");
       
       // Remove the active timed warning
       SQL_Query_exec("UPDATE warnings SET active = 'no' WHERE userid = $user AND type = 'HnR' AND active = 'yes'");

       // Update the download ban status
       if ($site_config["hnr_stop_dl"]) {
           SQL_Query_exec("UPDATE users SET downloadbanned = 'no' WHERE id = $user");
       }

       // Insert a message to notify the user
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES (0, $user, '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", 1)");
   }
}


  /*//Ban
  if ( $count >= $site_config["hnr_ban"] ) :
  $g = SQL_Query_exec("SELECT username, email, modcomment FROM users WHERE id = $user");
  $h = mysqli_fetch_row($g);
  $modcomment = $h[2];
  $modcomment = gmdate("d/m/Y") . " - ".T_("CLEANUP_BANNED_FOR")." " .$count. " H&R.\n " .$modcomment;
  SQL_Query_exec("UPDATE users SET enabled = 'no', warned = 'no', modcomment = '$modcomment' WHERE id = $user");

  SQL_Query_exec("DELETE FROM warnings WHERE userid = $user AND type = 'HnR'");

  write_log(T_("CLEANUP_THE_MEMBER")." <a href='account-details.php?id=".$user."'>".$h[0]."</a> ".T_("CLEANUP_HAS_BEEN_BANNED_REASON")." ".$count." H&R.");

  $subject = "".T_("CLEANUP_YOUR_ACCOUNT")." $site_config[SITENAME] ".T_("CLEANUP_HAS_BEEN_DISABLED")."";
  $body = "".T_("CLEANUP_YOU_WERE_BANNED_FOLLOWING")."\n
  ------------------------------
  \n/".T_("CLEANUP_YOU_HAVE_ACCUMULATED")." $count H&R.\n
  ------------------------------
  \n".T_("CLEANUP_YOU_CAN_CONTACT_BY_LINK")." :
  ".$site_config['SITEURL']."/contact.php
  \n\n\n".$site_config['SITENAME']." ".T_("ADMIN");
  sendmail($h[1], "$subject", "$body", "".T_("OF").": $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
  endif;*/
  endwhile;
  endif;

 /* //Ban warned
  $timenow = gmtime();
  $k = SQL_Query_exec("SELECT userid FROM warnings WHERE type = 'HnR' AND active = 'yes' AND UNIX_TIMESTAMP(expiry) < $timenow");
  if ( mysqli_num_rows($k) > 0 ) :
  while ($l = mysqli_fetch_row($k)) :
  $m = SQL_Query_exec("SELECT username, email, modcomment FROM users WHERE id = $l[0] AND enabled = 'yes' AND warned = 'yes'");
  $n = mysqli_fetch_row($m);

  $modcomment = $n[2];
  $modcomment = gmdate("d/m/Y") . " - ".T_("CLEANUP_BANNED_FOR_EXPIRED_H&R_WARNING_TIMEOUT")."\n " .$modcomment;
  SQL_Query_exec("UPDATE users SET enabled = 'no', warned = 'no', modcomment = '$modcomment' WHERE id = $l[0]");

  SQL_Query_exec("DELETE FROM warnings WHERE userid = $l[0] AND type = 'HnR'");

  write_log(T_("CLEANUP_THE_MEMBER")." <a href='account-details.php?id=".$l[0]."'>".$n[0]."</a> ".T_("CLEANUP_HAS_BEEN_BANNED_TIMEOUT")."");

  $subject = "".T_("CLEANUP_YOUR_ACCOUNT")." $site_config[SITENAME] ".T_("CLEANUP_HAS_BEEN_DISABLED")."";
  $body = "".T_("CLEANUP_YOU_WERE_BANNED_FOLLOWING")."\n
  ------------------------------
  \n".T_("CLEANUP_TIMEOUT_WARNING_H&R_EXPIRED")."\n
  ------------------------------
  \n".T_("CLEANUP_YOU_CAN_CONTACT_BY_LINK")." :
  ".$site_config['SITEURL']."/contact.php
  \n\n\n".$site_config['SITENAME']." ".T_("ADMIN");
  sendmail($n[1], "$subject", "$body", "".T_("OF").": $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
  endwhile;
  endif;*/
  // END HIT & RUN
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728