View Single Post
  #8  
Old 5th May 2013, 09:45
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
in include/cleanup.php comment out these lines
PHP Code:
        #Reset Statistics. Run where there is a dead peer
        
$sql "DELETE FROM ".$db_prefix."_peers WHERE UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".($announce_interval+60).";"//One minute of tolerance
        
$res $db->sql_query($sql);
        if (
$db->sql_affectedrows($res) > 0) {
                
$db->sql_query("UPDATE ".$db_prefix."_torrents SET seeders = 0, leechers = 0, tot_peer = 0, speed = 0 WHERE tracker IS NULL OR backup_tracker = 'true';");

                
$sql "SELECT COUNT(*) AS tot, torrent, seeder, SUM(upload_speed) AS speed FROM ".$db_prefix."_peers GROUP BY torrent, seeder;";
                
$res $db->sql_query($sql);
                while(
$row $db->sql_fetchrow($res)) {
                        if (
$row["seeder"] == "yes"$sql "UPDATE ".$db_prefix."_torrents SET seeders = '".$row["tot"]."', speed = speed + '".$row["speed"]."' WHERE id='".$row["torrent"]."';";
                        else 
$sql "UPDATE ".$db_prefix."_torrents SET leechers = '".$row["tot"]."', speed = speed + '".$row["speed"]."' WHERE id='".$row["torrent"]."';";
                        
$db->sql_query($sql);
                }

                
$db->sql_query("UPDATE ".$db_prefix."_torrents SET tot_peer = seeders + leechers;");
        }
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET evidence = 0 WHERE evidence = 1 AND UNIX_TIMESTAMP(added) < UNIX_TIMESTAMP(NOW()) - 14*84600;");
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET visible = 'no' WHERE type != 'link' AND tot_peer <= '".$down_limit."' AND UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".intval($dead_torrent_interval)." AND evidence != 1 AND (TRACKER IS NULL OR ".intval($autoscrape).");");
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET visible = 'yes' WHERE tot_peer > '".$down_limit."';"); 
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
The Following User Says Thank You to joeroberts For This Useful Post:
romano1 (31st July 2013)