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
User Posts

Go to Profile

dont really want to update github until end of week until a good test is carried out but the logo is done, you need to make a new logo i just use f-logo from forum for now for example
    <!-- START NAVIGATION -->
   <nav class="navbar navbar-expand-lg">
       <a class="navbar-brand" href="<?php echo TTURL; ?>/index.php">
           <img class="d-none d-sm-block" src="<?php echo TTURL; ?>/views/themes/<?php echo $_SESSION['stylesheet'] ?: $config['default_theme']; ?>/images/logo.gif"><!-- Image to show on screens from small to extra large -->
           <img class="d-sm-none" src="<?php echo TTURL; ?>/views/themes/<?php echo $_SESSION['stylesheet'] ?: $config['default_theme']; ?>/images/f-logo.gif"><!-- Image to show on extra small screen (mobile portrait) -->
       </a>
     <?php if ($_SESSION['loggedin'] == true) {?>
Going to go though mobile view today check all pages on small devices
"Propaganda, post: 69283, lmember: 60":

You have staff working on this? Haha

I had to close site issues with server and   only just transferred domain so domain was locked there .only just been able to move domain again so perfect time to make switch
My uploaders and moderators are pretty good guys there follwed me for 10+ years so far just little things like more smiles link, thanks button been able to fix everything so far
double ip — 2020-09-01 23:20:13 in v3 Mods Requests
i used autolink in signup  niki - if ip in use redirect
after

       $password_maxlength = 60;


place

       //check if IP is already a peer
       if ($site_config["ipcheck"] && $site_config["accountmax"] = "1") {
               $ip = $_SERVER['REMOTE_ADDR'];
               $ipq = get_row_count("users", "WHERE ip = '$ip'");
               if ($ipq >= $site_config["accountmax"])
               autolink("account-login.php", "This IP is already in use !");
       }
put this on fresh server and a few little bugs got my staff all testing for week so should iron any issues out
"Propaganda, post: 69271, member: 60":

Learned something again ;-)

you dont need them at start and end in templates as well just html its when you mix the two, there are required at start of a file beginning with php so its knows what its reading but if it starts with html thats the default so not needed its meant to be better for white spaces which can cause errors
Noticed rss when i tried I micromonkeys the line in footer is wrong should have been <?php echo TTURL; ?>/rss?custom=1 but this will now be wrong too lol
updating rss change link in you theme to  <?php echo TTURL; ?>/rss/custom
Php should not have ?> at the end to close files it's bad practice
Cheers m8 will give that a look
yes at the minute i dont allow movies so not in any rush, if your on xampp mate i would recommended testing this
[URL unfurl="true"]https://github.com/FabianBeiner/PHP-IMDB-Grabber[/url]

This is on my list its allows shows & games as well as movies just not had time yet to transfer it to TT heres image of my copy on xampp
Snatchlist [TTv3] — 2020-08-31 11:21:11 in v3 Mods Completed
in the old v1 mod dates are used and its much clearer, dont know why someone updated to timestamps :unsure:  
snatchlist is linked to peers table
hit n run is  attached the snatched table
Once tested I will add update sql  (y)  old passwords of md5 will not work at the minute we use bycrypt
In full release all css & html will be in templates so easier for those with skills
I think hit & run works 100% but have no members who hitnrun so maybe little issue  so it can be turned on to test. Users can use gb or seedbonus to remove them
[color=rgb(250, 197, 28)]Members are welcome to use this to test but the github has not been updated for a while, the next update will be in january[/color]

Here is my Torrent Trader Project
Its updated to pdo with a mvc core, built for the latest version of php (7.4) in bootstrap 4 this project is used on my current site and is updated regular and full support is provided.

TT has been around for at least 20 years so needed bringing up to date, but we can not forgot about the past so a big shout out to all who contributed to the code over the years. This is modded out so credit to any original authors of any code ive just updated it and put my own spin on it.

Pre-Release
Its pre-release for two little reasons, so do not let that put you off
1) Testers, i want testers - a small group have been testing but the more test the better i am pretty quick at bug fixing
2) It is MVC but there is query's & html in the controllers, this is just a time thing and is next on the list, it does not effect anything i just wanted to get mods & functionality first

Beginners
I feel software should be able to work on a free shared host, i do not recommend this especially on a torrent site you would be banned, but the principle that any one should be able to edit the config file, upload and done, no third party installs, no huge autoloads just a simple 2MB folder that can hold its own. For more experienced users of course you can implement these things like cloudflare & opcache to name a few.

Donations
I do NOT except donations, i do NOT do paid work, i am old skool i believe in community. Its together we improve and move forward so please post thoughts, ideas, recommendations and bugs here. Any private message will be ignored. Except technical php issues like a class, becoding re-doing announce i am always looking to try new things and learn.
I have had a website for 12 years first phpbb then TT so i am in it for the long haul.

Mods
There is so many mods to name imdb, snatch, vip, ip checks, encrypted passwords and much more there is two mods on that are in progress but that will be finished soon
1) Hit & Run (in last stages of testing) so is disabled in config
2) External scraper (i dont use external torrents so this has been left until last)

Snatchlist [TTv3] — 2020-08-30 15:25:54 in v3 Mods Completed
Just added hit & run mod and I think I've got utime and ltime mixed up so query would need changing
Snatchlist [TTv3] — 2020-08-30 09:50:55 in v3 Mods Completed
Dug this out of a old announce [USER=60]@Propaganda[/USER] sent me so big thank you to him
looks like missing piece of snatchlist mod that records part completed torrents in announce

if ($event == "stopped") {

////////////////////////SNATCHED/////////////////////////////////////////
               $res_se = mysql_query("SELECT userid, seed_end, torrentid FROM snatched WHERE torrentid = $torrentid AND userid = $userid");
while ($row_se = mysql_fetch_assoc($res_se)) {
mysql_query("UPDATE snatched SET seed_end  = $dt WHERE finished = 'yes' AND torrentid = ". $row_se[torrentid] ." AND userid = ". $row_se[userid] ."");
}
/////////////////////////////////////////////////////////////////////////

// UPDATE "STOPPED" EVENT


cant really test this at minute and not 100% sure of the sql heres my pdo update for reference


function portblacklisted($port)


above add

$dt = gmtime() - 180;
$dt = get_date_time($dt);


find

if ($event == "stopped") { // UPDATE "STOPPED" EVENT


below add

// SNATCHED
$res_se = DB::run("SELECT uid, utime, tid FROM snatched WHERE tid = $torrentid AND uid = $userid");
while ($row_se = $res_se->fetch(PDO::FETCH_ASSOC)) {
   DB::run("UPDATE snatched SET utime  =? WHERE completed =? AND tid =? AND uid =?", [$dt, 'yes', $row_se['tid'], $row_se['uid']]);
}


here is my understanding of sql (its the times im not sure of)
// sid = id
// uid = userid
// tid = torrentid
// completed = finished
// uload = upload time
// dload = download time
// hnr = was snatched

// utime = seeded time ?
// ltime = lastaction ?
// stime - start time ?
Unfortunately i can not test. i look at files and clean a little, in 3 files search for
// mjay edit


// mjay edit - is 4 times to help guide

if not work something else is wrong. with no test its a guess what is in admincp sql log
Upload image error — 2020-08-29 13:43:30 in M-BiTsy Support
la valeur par défaut peut être changée en null
mais cela a l'air bien, d'après mon expérience, nul ne peut être non
mieux vaut vérifier lors du téléchargement ajouter image2 miss image1

the default value can be changed to null
but it looks good in my experience null can not be no
better check when uploading add image2 miss image1
first post updated
Quick cleanup class, if you get chance to test, ive kept it simple for now where you should be able to copy and paste existing code just follow the notes want to check speed difference before splitting it down into little pieces. Autoload or include class

in admincp find

       if ($action == "forceclean") {
           $now = gmtime();
           DB::run("UPDATE tasks SET last_time=$now WHERE task='cleanup'");
           require_once "helpers/cleanup_helper.php";
           do_cleanup();
           autolink(TTURL . '/admincp', T_("FORCE_CLEAN_COMPLETED"));
       }


replace with
  
if ($action == "forceclean") {
           $now = gmtime();
           DB::run("UPDATE tasks SET last_time=$now WHERE task='cleanup'");
           $cleanup = new Cleanup();
           $cleanup->run();
           autolink(TTURL . '/admincp', T_("FORCE_CLEAN_COMPLETED"));
       }


in functions dbconn find

if ($autoclean) {
       autoclean();
   }


replace with

if ($autoclean) {
           $cleanup = new Cleanup();
           $cleanup->run();
   }


the class  Cleanup.php = notes for functions added

<?php
class Cleanup
{
 
   // add old autoinvites function
   public function autoinvites($interval, $minlimit, $maxlimit, $minratio, $invites, $maxinvites)
   {
       global $pdo;
       $time = gmtime() - ($interval * 86400);
       $minlimit = $minlimit * 1024 * 1024 * 1024;
       $maxlimit = $maxlimit * 1024 * 1024 * 1024;
       $res = $pdo->run("SELECT id, username, class, invites FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND downloaded >= $minlimit AND downloaded < $maxlimit AND uploaded / downloaded >= $minratio AND warned = 'no' AND UNIX_TIMESTAMP(invitedate) <= $time");
       if ($res->rowCount() > 0) {
           while ($arr = $res->fetch(PDO::FETCH_ASSOC)) {
               $maxninvites = $maxinvites[$arr['class']];
               if ($arr['invites'] >= $maxninvites) {
                   continue;
               }
               if (($maxninvites - $arr['invites']) < $invites) {
                   $invites = $maxninvites - $arr['invites'];
               }
               $pdo->run("UPDATE users SET invites = invites+$invites, invitedate = NOW() WHERE id=$arr[id]");
               write_log("Gave $invites invites to '$arr[username]' - Class: " . get_user_class_name($arr['class']) . "");
           }
       }
   }
   // this will be different time sets for now full cleanup and optimize
   public function run()
   {
       global $pdo;
       $this->docleanup();
       // OPTIMIZE TABLES
       $res = $pdo->run("SHOW TABLES");
       while ($table = $res->fetch(PDO::FETCH_LAZY)) {
           // Get rid of overhead.
           $pdo->run("REPAIR TABLE `$table[0]`;");
           // Analyze table for faster indexing.
           $pdo->run("ANALYZE TABLE `$table[0]`;");
           // Optimize table to minimize thrashing.
           $pdo->run("OPTIMIZE TABLE `$table[0]`;");
       }
   }
   // the old autoclean function replace do_cleanup with $this->run();
   public function autoclean()
   {
       global $config, $pdo;
       $now = gmtime();
       $docleanup = 0;
       $res = $pdo->run("SELECT last_time FROM tasks WHERE task='cleanup'");
       $row = $res->fetch(PDO::FETCH_ASSOC);
       if (!$row) {
           $pdo->run("INSERT INTO tasks (task, last_time) VALUES ('cleanup',$now)");
           return;
       }
       $ts = $row['last_time'];
       if ($ts + $config["autoclean_interval"] > $now) {
           return;
       }
       $planned_clean = $pdo->run("UPDATE tasks SET last_time=? WHERE task=? AND last_time =?", [$now, 'cleanup', $ts]);
       if (!$planned_clean) {
           return;
       }
       // Run cleanup
       $this->run();
   }
   // for now all cleanup except optimize add $this-> to autoinvites eg $this->autoinvites
   public function docleanup()
   {
       global $config, $pdo;
       // LOCAL TORRENTS - GET PEERS DATA AND UPDATE BROWSE STATS
       // DELETE OLD NON-ACTIVE PEERS
       $deadtime = get_date_time(gmtime() - $config['announce_interval']);
       $pdo->run("DELETE FROM peers WHERE last_action < '$deadtime'");
       $torrents = array();
       $res = $pdo->run("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");
       while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
           if ($row["seeder"] == "yes") {
               $key = "seeders";
           } else {
               $key = "leechers";
           }
 
           $torrents[$row["torrent"]][$key] = $row["c"];
       }
       $res = $pdo->run("SELECT torrent, COUNT(torrent) as c FROM comments WHERE torrent > 0 GROUP BY torrent");
       while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
           $torrents[$row["torrent"]]["comments"] = $row["c"];
       }
       $fields = explode(":", "comments:leechers:seeders");
       $res = $pdo->run("SELECT id, external, seeders, leechers, comments FROM torrents WHERE banned = 'no'");
       while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
           $id = $row["id"];
           $torr = $torrents[$id];
           foreach ($fields as $field) {
               if (!isset($torr[$field])) {
                   $torr[$field] = 0;
               }
           }
           $update = array();
           foreach ($fields as $field) {
               if ($row["external"] == "no" || $field == "comments") {
                   if ($torr[$field] != $row[$field]) {
                       $update[] = "$field = " . $torr[$field];
                   }
               }
           }
           if (count($update)) {
               $pdo->run("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id");
           }
       }
       // LOCAL TORRENTS - MAKE NON-ACTIVE/OLD TORRENTS INVISIBLE
       $deadtime = gmtime() - $config["max_dead_torrent_time"];
       $pdo->run("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime) AND seeders = '0' AND leechers = '0' AND external !='yes'");
 
       // Seedbonus Mod
       $now = gmtime();
       $dobonus = 0;
       $res = DB::run("SELECT last_time FROM tasks WHERE task='bonus'");
       $row = $res->fetch(PDO::FETCH_ASSOC);
       if (!$row) {
           $pdo->run("INSERT INTO tasks (task, last_time) VALUES ('bonus',$now)");
       }
       $ts = $row['last_time'];
       if ($ts + $config['add_bonus'] < $now) {
           $qry = "SELECT DISTINCT userid as peer, (
       SELECT DISTINCT COUNT( torrent )
       FROM peers
       WHERE seeder = 'yes'  AND userid = peer) AS count
       FROM peers WHERE seeder = 'yes'";
           $res1 = DB::run($qry);
           while ($row = $res1->fetch(PDO::FETCH_LAZY)) {
               DB::run("UPDATE users SET seedbonus = seedbonus + '" . ($config["bonuspertime"] * $row->count) . "' WHERE id = '" . $row->peer . "'");
               DB::run("UPDATE tasks SET last_time=$now WHERE task='bonus'");
           }
       }
       // Start Vipuntil mod vip
       $timenow = get_date_time();
       $subject = 'Your VIP class stay has just expired';
       $msg = 'Your VIP class stay has just expired';
       $resv = DB::run("SELECT id, oldclass FROM users WHERE vipuntil < ? AND vipuntil <> ?", [$timenow, '0000-00-00 00:00:00']);
       if ($resv->rowCount()) {
           $rowv = $resv->fetch(PDO::FETCH_LAZY);
           $id = $rowv->id;
           $oldclass = $rowv->oldclass;
           DB::run("UPDATE users SET class =?, oldclass=?, vipuntil =? WHERE vipuntil < ? AND vipuntil <> ?", [$oldclass, 1, '0000-00-00 00:00:00', $timenow, '0000-00-00 00:00:00']);
           DB::run("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(?, ?, ?, ?, ?, ?)", [0, $id, $timenow, $subject, $msg, 0]);
       }
       // DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE
       $deadtime = gmtime() - $config["signup_timeout"];
       $pdo->run("DELETE FROM users WHERE status = 'pending' AND added < FROM_UNIXTIME($deadtime)");
 
       // DELETE OLD LOG ENTRIES
       $ts = gmtime() - $config["LOGCLEAN"];
       $pdo->run("DELETE FROM log WHERE added < FROM_UNIXTIME($ts)");
 
       // LEECHWARN USERS WITH LOW RATIO
       if ($config["ratiowarn_enable"]) {
           $minratio = $config["ratiowarn_minratio"];
           $downloaded = $config["ratiowarn_mingigs"] * 1024 * 1024 * 1024;
           $length = $config["ratiowarn_daystowarn"];
           // ADD WARNING
           $res = $pdo->run("SELECT id,username FROM users WHERE class = 1 AND warned = 'no' AND enabled='yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");
           if ($res->rowCount() > 0) {
               $timenow = get_date_time();
               $reason = "You have been warned because of having low ratio. You need to get a " . $minratio . " before next " . $length . " days or your account may be banned.";
               $expiretime = gmdate("Y-m-d H:i:s", gmtime() + (86400 * $length));
               while ($arr = $res->fetch(PDO::FETCH_ASSOC)) {
                   $pdo->run("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ('" . $arr["id"] . "','" . $reason . "','" . $timenow . "','" . $expiretime . "','0','Poor Ratio')");
                   $pdo->run("UPDATE users SET warned='yes' WHERE id='" . $arr["id"] . "'");
                   $pdo->run("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES ('0', '" . $arr["id"] . "', '" . $timenow . "', '" . $reason . "', '0')");
                   write_log("Auto Leech warning has been <b>added</b> for: <a href='$config[SITEURL]/users/profile?id=" . $arr["id"] . "'>" . class_user_colour($arr["username"]) . "</a>");
               }
           }
 
           // REMOVE WARNING
           $res1 = $pdo->run("SELECT users.id, users.username FROM users INNER JOIN warnings ON users.id=warnings.userid WHERE type='Poor Ratio' AND active = 'yes' AND warned = 'yes'  AND enabled='yes' AND uploaded / downloaded >= $minratio AND downloaded >= $downloaded");
           if ($res1->rowCount() > 0) {
               $timenow = get_date_time();
               $reason = "Your warning of low ratio has been removed. We highly recommend you to keep a your ratio up to not be warned again.\n";
 
               while ($arr1 = $res1->fetch(PDO::FETCH_ASSOC)) {
                   write_log("Auto Leech warning has been removed for: <a href='$config[SITEURL]/users/profile?id=" . $arr1["id"] . "'>" . class_user_colour($arr1["username"]) . "</a>");
 
                   $pdo->run("UPDATE users SET warned = 'no' WHERE id = '" . $arr1["id"] . "'");
                   $pdo->run("UPDATE warnings SET expiry = '$timenow', active = 'no' WHERE userid = $arr1[id]");
                   $pdo->run("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES ('0', '" . $arr1["id"] . "', '" . $timenow . "', '" . $reason . "', '0')");
               }
           }
 
           // BAN WARNED USERS
           $res = $pdo->run("SELECT users.id, users.username, UNIX_TIMESTAMP(warnings.expiry) AS expiry FROM users INNER JOIN warnings ON users.id=warnings.userid WHERE type='Poor Ratio' AND active = 'yes' AND class = 1 AND enabled='yes' AND warned = 'yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");
 
           if ($res->rowCount() > 0) {
               $timenow = get_date_time();
               $expires = (86400 * $length);
               while ($arr = $res->fetch(PDO::FETCH_ASSOC)) {
                   if (gmtime() - $arr["expiry"] >= 0) {
                       $pdo->run("UPDATE users SET enabled='no', warned='no' WHERE id='" . $arr["id"] . "'");
                       write_log("User <a href='$config[SITEURL]/users/profile?id=" . $arr["id"] . "'>" . class_user_colour($arr["username"]) . "</a> has been banned (Auto Leech warning).");
                   }
               }
           }
       } // check if warning system is on
       // REMOVE WARNINGS
       $res = $pdo->run("SELECT users.id, users.username, warnings.expiry FROM users INNER JOIN warnings ON users.id=warnings.userid WHERE type != 'Poor Ratio' AND warned = 'yes'  AND enabled='yes' AND warnings.active = 'yes' AND warnings.expiry < '" . get_date_time() . "'");
       while ($arr1 = $res->fetch(PDO::FETCH_ASSOC)) {
           $pdo->run("UPDATE users SET warned = 'no' WHERE id = $arr1[id]");
           $pdo->run("UPDATE warnings SET active = 'no' WHERE userid = $arr1[id] AND expiry < '" . get_date_time() . "'");
           write_log("Removed warning for $arr1[username]. Expiry: $arr1[expiry]");
       }
       // WARN USERS THAT STILL HAVE ACTIVE WARNINGS
       $pdo->run("UPDATE users SET warned = 'yes' WHERE warned = 'no' AND id IN (SELECT userid FROM warnings WHERE active = 'yes')");
 
       // SET freeleech
       if ($config['freeleechgbon']); {
       $gigs  = $config['freeleechgb'];
       $query = $pdo->run("SELECT `id`, `name` FROM `torrents` WHERE `banned` = 'no' AND `freeleech` = '0' AND `size` >= $gigs");
       if ($query->rowCount() > 0) {
           while ($row =$query->fetch(PDO::FETCH_ASSOC)) {
               $pdo->run("UPDATE `torrents` SET `freeleech` = '1' WHERE `id` = '$row[id]'");
               write_log("Freeleech added on  <a href='torrents/read?id=$row[id]'>$row[name]</a> because it is bigger than  8gb.");
           }
       }
       }
       // autoinvites(interval to give invites (days), min downloaded GB, max downloaded GB, min ratio, invites to give, max invites allowed (array))
       $maxinvites[1] = 5; // User
       $maxinvites[2] = 10; // Power User
       $maxinvites[3] = 20; // VIP
       $maxinvites[4] = 25; // Uploader
       $maxinvites[5] = 100; // Moderator
       $maxinvites[6] = 100; // Super Moderator
       $maxinvites[7] = 400; // Administrator
 
       // Give 1 invite every 21 days to users with > 1GB downloaded AND < 4GB downloaded AND ratio > 0.50
       $this->autoinvites(21, 1, 4, 0.50, 1, $maxinvites);
       $this->autoinvites(14, 1, 4, 0.90, 2, $maxinvites);
       $this->autoinvites(14, 4, 7, 0.95, 2, $maxinvites);
 
       $maxinvites[1] = 7; // User
       $this->autoinvites(14, 7, 10, 1.00, 3, $maxinvites);
 
       $maxinvites[1] = 10; // User
       $this->autoinvites(14, 10, 100000, 1.05, 4, $maxinvites);
       //END INVITES
     
}
}
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: 10

  • Online

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