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

"Obiwan, post: 69410, member: 4":

Sorry, didn't mean to offend.
It's just that a Beta1 was made available on here, so figured a Beta2 would have followed fairly soon after. Seems like a Beta2 would have been good, and get rid if the Beta1, since it is no where near usable.
Anyway. Keep at it. Seems like nice work so far. And I imagine it is really time consuming. So once again, sorry if I offended.


Oh not at all, you guys are awesome, I just wish I had more time now. I’m proud to see a eager wait for great code and features! Keep tabs! I have lots more to share too like seedbonus and some port corrections. Will be a productive weekend!
"Botanicar, post: 69408, member: 19833":

Thanks for the information, the login was successfully completed, but that's all, nothing phenomenal. Nowhere to access for administration or the like. It remains to wait for some more realizations of this project.
Thanks for the hard work


Thanks bud. I know, I post a lot of updates but it’s all conclusive toward finally archiving the thing lol keep tabs and sub to this thread if it helps!
"Obiwan, post: 69406, member: 4":

Try
Admin
password

(That is if you want to bother with all the errors that are in Beta 1. I've been waiting for a release of Beta 2 on here...so far nothing but shouts about "this, that, and the other" being modded/fixed/written/done. And more than a couple allusions to the Beta 2 being released...soon, within couple days, etc. Whatever. Good luck.)


You wouldn’t believe the time and effort that goes into releasing my personal website (your just not getting my database). For a personal project and a very sustainable one, your lucky I’m even posting anything because I don’t have too but I believe in sharing. So some patience between life, when I’m actually parked at the computer and have some hours to spare.. that will be post time.

Patience people. I know my edition is preferred and way ahead of the game, so give it time.
I sent BETA2 to another user but their spearheading their own edition so it’s up to me.

PM me for my domain and you can see what you can expect coming. Because it’s live first, then as things ease off I post here.
Try flex 50% and min/max at 25% if your having display/alignment issues.
Logis fixed weeks back. It’s classes/account.class.php

What is happening, is it is rehashing your password, but in that specific step it is not authenticating (well non-rehashing is fine). I’ll post the class so people can finally login.

I’ve pushed this released probably 3 more betas already, it’s practically finished so if you wait a few days you’ll have a 20x better copy than what is here.
Auto-Promote Users — 2020-09-24 03:31:14 in v3 Mods Completed
Be right there guys
Auto-Promote Users — 2020-09-23 19:27:02 in v3 Mods Completed
Hi Niki, I will tackle this when I’m home today ?
You can change both queries to class 1 (all) and see it work on next cleanup, or I fix later today
Auto-Promote Users — 2020-09-22 06:03:36 in v3 Mods Completed
This mod will auto promote users to the class you choose. It works well for me and is ported from another project.

Open backend/cleanup.php and find

//DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE

Add right before // line

// Auto promote users
$regular     = 1; // Regular class ID
$promotclass = 3; // Promoted class ID
$limit       = 25 * 1024 * 1024 * 1024;
$minratio    = 1.05;
$maxdt       = get_date_time(time() - 86400 * 28);
$res         = SQL_Query_exec("SELECT id, username FROM users WHERE class = $regular AND uploaded >= $limit AND uploaded / downloaded >= $minratio AND added < $maxdt");
if ($res) {
   $dt  = get_date_time();
   $msg = "Congratulations, you have been automatically promoted to Power User. You can now do more stuff.";
   while ($arr = mysql_fetch_assoc($res)) {
       SQL_Query_exec("UPDATE users SET class = $promotclass WHERE id = $arr[id]");
       $txt   = "You have been promoted to Power User!";
       $event = "$arr[username] has been promoted Power User";
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
       SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, $arr[username], $event, $dt, 0)");
       write_log("The user <a href=\"/user/?id=$arr[id]\">$arr[username]</a> was automatically promoted to power user.");
   }
}

// Auto demote users
$minratio = 0.95;
$res      = SQL_Query_exec("SELECT id, username FROM users WHERE class = $promotclass AND uploaded / downloaded < $minratio");
if ($res) {
   $dt  = get_date_time();
   $msg = "You were automatically demoted from Power User to Regular because your share ratio fell below $minratio.";
   while ($arr = $res->fetch()) {
       SQL_Query_exec("UPDATE users SET class = $regular WHERE id = $arr[id]");
       $txt   = "You have been demoted to Regular!";
       $event = "$arr[username] has been demoted Regular";
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
       SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, $arr[username], $event, $dt, 0)");
       write_log("The user <a href=\"/user/?id=$arr[id]\">$arr[username]</a> was automatically demoted to regular.");
   }
}

[ATTACH type="full" alt="auto-promoted.png"]5901[/ATTACH]
Vouchers under work - So this checks holidays on doclean() and if is holiday, it generates a unique code and sent to user PM for some promotional GBs or other.

This uses 2 classes on hand.

Under work:


   // BEGIN holiday / voucher check
   $t = date('Y-m-d');
   $q = $db->query_params("SELECT value_s as s, value_i as i FROM avps WHERE arg = 'lastholidaycheck'");
   $d = $q->fetch();
   if($d['s'] != $t){
       if($d['i'] === 0){
           $i = 0;
           $h = new Holidays();
           if(!$h->isDateIsHoliday($t))
               $i = 1;
           else{
               $v = new voucher();
               if($v->todaysVoucher() === false)
                   $v->create("","",0,true);
               $c = $v->code;
               $q = $db->query_params('SELECT user_id FROM users');
               $d = $q->fetch();
               $txt = "To celebrate the day you will receive ". $C." This voucher is only valid today! [url=vouchers.php] Click here![/url]";
               foreach($d as $u)
                   $db->query_params('INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, :user_id, NOW(), :message, 0)', array('user_id' => $u['user_id'], 'message' => $txt));
               $i = 1;
           }
           $q = $db->query_params("UPDATE avps SET value_s = :s, value_i = :i WHERE arg = 'lastholidaycheck'", array('s' => $t, 'i' => $i));
       }
   }
Fake Ratio Checking

// Defines the transmission rate from which a Ratiofaker entry is created in the user profile.
// For trackers that do not have a speed limit, this value should be set to approx. 5 MB per second. Ratiofaker tools usually have upload rates in the GB / s range.
// Type: Number (bytes per second)
// Possible values: N / A
if (($data['uploaded'] / 60 * 20) > 1024 * 1024 * 5) fail('Ratiofaker-Tool used!');
Annd the announce code for this

Run query to start accepting slots to user account
ALTER TABLE users ADD COLUMN slots INT(10) NOT NULL DEFAULT 3


(this will be ported for all editions)

// Max download slots check - Sep 20, 2020
$maxslots = $db->query_params("SELECT COUNT(DISTINCT torrent_id) AS total FROM peers WHERE user_id = :user_id AND seeder = 'no'", array('user_id' => $user_row['user_id']));
$maxslot2 = $db->query_params("SELECT p.user_id, u.slots FROM users u LEFT JOIN peers p ON p.user_id = u.user_id WHERE u.user_id = :user_id AND p.seeder = 'no' LIMIT 1", array('user_id' => $user_row['user_id']));

foreach ($maxslots as $slots) {
   foreach ($maxslot2 as $maxslot) {
       if ($slots['total'] > $maxslot['slots']) {
           fail("Maximum $slots[total]/$maxslot[slots] download slots exceeded! Finish current transfers to reclaim slots.");
       }
   }
}

And the config setting

UPDATE:
this is better, and doesnt need a loop. Connectable='yes', seeder='no' is important here. I made sure only their slot message happens only ONE time (since last announce) or shoutbox gets spammed really hard.

// Max Slots - Fixed - Seedbox-Compatible - Sep 20, 2020 - No foreach!
$maxslots = $db->query_params("SELECT COUNT(DISTINCT torrent_id) AS total, last_announce FROM peers WHERE user_id = :user_id AND seeder = 'no'", array('user_id' => $user_row['user_id']));
$current  = $maxslots->fetch();
if ($current['total'] > $user_row['slots']) {
   $checklast   = $db->query_params('SELECT user, date, message FROM shoutbox WHERE user = :username', array('username' => $user_row['username']));
   $lastmessage = $checklast->fetch();
   if ($lastmessage['date'] <= $current['last_announce']) {
       $event = "$user_row[username] reached their maximum download slot $current[total]/$user_row[slots]";
       $db->query_params('INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, :receiver, :event, NOW(), 0)', array('receiver' => $user_row['username'], 'event' => $event));
   }
   fail("$current[total]/$user_row[slots] download slots exceeded! Finish current transfers to reclaim slots.");
}


[ATTACH type="full" alt="MaxSlotsShoutboxAnnouncement.png"]5900[/ATTACH]

[color=rgb(226, 80, 65)]'max_download_slots'[/color] [color=rgb(61, 142, 185)]=>[/color] [color=rgb(147, 101, 184)]3[/color]

Note: the nature of this is reading 'users.slots' now and default of 3 slots available now, unless user exchanges points for more download slots.

This is very reliable and is not relying on (possible) spoofed upload/download stats, peer problems or other client issues. This is simply user slots! Tested and works great with also testing bonuses for more slots to ensure its working as expected.
Menu: inherit parent width on container or wrap menu in div and width 100% inside that.
I would consider using Select2 plugin or similar, it does that menu perfectly well and is fully responsive Out of the box.
download ban — 2020-09-20 18:58:50 in v3 Mods Requests
In my tests I’ve found banning peer_ID is effective but keep in mind, they can keep starting/stopping to trigger a new auto incremented peer ID after interval clean. I should check this mod
Enchanced Requests — 2020-09-20 18:56:23 in v3 Mods Completed
Yes exactly, I had to do line by line lol it’s worth it
I redid seed bonus, as I didnt like the old one and it needed to be cut down a few. So here is working copy, still progressing as I go to settle features and what not.

Full compat for any edition soon.

[ATTACH type="full" alt="1.png"]5896[/ATTACH]

[ATTACH type="full" alt="2.png"]5897[/ATTACH]


<?
// Seed Bonus - Reworked - Sep 19, 2020
require_once '../site.php';
$db->connect();
site_header();

if (!$account->sessionLogin()) {
   header(sprintf('Location: %s/siginin/', $CONFIG['base_url']));
   die;
}

$errors = array();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
   
   $data = array();
   $keys = array('id', 'userid', 'torrentid');
   foreach ($keys as $key) {
       if (!array_key_exists($key, $_POST)) {
           sprintf('Seed bonus item ID %s not valid.', $key);        
       }
       $data[$key] = $_POST[$key];
   }
   
   $res = $db->query_params('SELECT users.seedbonus, users.perk_avatar, users.username, users.slots, users.last_exchange, users.class, users.user_id, bonus.cost, bonus.descr, bonus.type, bonus.value, bonus.id FROM users, bonus WHERE users.user_id = :user_id AND bonus.id = :post_id', array('user_id' => $account->getId(), 'post_id' => $data['id'])) or die('db error');
   
   if (!($row = $res->fetch()) || $row['seedbonus'] < $row['cost']) {
       $errors []= 'Demand not valid.';
   }
   
   if (empty($errors)) {
       $db->query_params("UPDATE users SET seedbonus = seedbonus - :cost WHERE user_id = :user_id", array('cost' => $row['cost'], 'user_id' => $account->getid())) or die('User bonus update failed.');
   }
   
   $types = array(
       'invite' => true,
       'traffic' => true,
       'hnr' => true,
       'slots' => true,
       'vip' => true,
       'last_exchange' => true,
       'value' => true,
       'feature' => true
   );

   $data_row = array();
   foreach ($types as $key => $req) {
       if (array_key_exists($key, $row)) {
           $data_row[$key] = $row[$key];
       } else if ($req) {
           sprintf('Invalid type %s', $key);
       }
   }
   
 if (empty($errors) || array_key_exists('id', $data)) {
           
       if ($row['type'] == 'invite' && $data['id'] == $row['id']) {
           $db->query_params("UPDATE users SET invites = invites + :value WHERE user_id = :user_id", array('value' => $row['value'], 'user_id' => $account->getid()));
           echo sprintf('Your account has been <b>credited</b> for <b>%s</b> Extra Invites!', $row['value']);
       }
       
       if ($row['type'] == 'traffic' && $data['id'] == $row['id']) {
           $db->query_params("UPDATE users SET uploaded = uploaded + :value, last_exchange = :bonus WHERE user_id = :user_id", array('bonus' => $row['value'], 'value' => $row['value'], 'user_id' => $account->getid()));
           echo sprintf('Your account has been <b>credited</b> for <b>%s</b> bonus Upload Data!', format_size($row['value']));
       }
   
       if ($row['type'] == 'HnR' && $data['id'] == $row['id']) {
       
       $uid = $row['class'] == '1' ? $data['userid'] : $account->getId();
           
       if (!array_key_exists('torrentid', $data)) {
           die('You must fill the box with the id of the torrent.');
       }
       
       if (isset($uid)) {
           $res = $db->query_params("SELECT * FROM snatched WHERE tid = :tid AND uid = :uid AND hnr = 'yes'", array('tid' => $data['torrentid'], 'uid' => $uid));
           if ($res)
               die('No HnR found with this information.');
       
       $res1 = $db->query_params("SELECT username FROM users WHERE user_id = :uid", array('uid' => $uid));
       $row1 = $res1->fetch();
       
       $res2 = $db->query_params("SELECT name FROM torrents WHERE torrent_id = :tid", array('tid' => $tid));
       $row2 = $res2->fetch();
               
       $username = html_escape($row1['username']);
       $torname  = html_escape($row2['name']);

       // TODO: db Hit n Run logging
       echo sprintf('Hit and Run has been cleared for torrent %s', $row2['name']);
       
       if ($uid == $account->getId())
           $new_modcomment .= "H&R on the torrent " . $torname . " cleared against " . $row['cost'] . " points \n";
       else
           $new_modcomment .= "H&R on the torrent " . $torname . " cleared by " . $account->username() . " \n";
           $modcom = gmdate('d-m-Y \à H:i') . ' - ';
               
       $db->query_params('UPDATE users SET modcomment = CONCAT(:modcom,modcomment) WHERE user_id = :user_id', array('modcom' => $modcom, 'user_id' => $uid));
       $db->query_params("UPDATE snatched SET ltime = '129600', hnr = 'no' WHERE tid = :tid AND uid = :uid", array('tid' => $modcom, 'uid' => $uid));
       
       }
   }

   if ($row['type'] == 'slots' && $data['id'] == $row['id']) {
       $db->query_params('UPDATE users SET slots = :slots WHERE user_id = :user_id', array('slots' => $data_row['value'], 'user_id' => $account->getid()));
       echo sprintf('Your account has been <b>credited</b> for <b>%s</b> Extra Download Slots!', $row['value']);
   }
   
   if ($row['type'] == 'feature' && $data['id'] == $row['id']) {
       $db->query_params("UPDATE users SET perk_avatar = 'yes' WHERE user_id = :user_id", array('user_id' => $account->getid()));
       echo sprintf('Your avatar has been <b>enlarged</b> to <b>%s</b> Pixels!', $row['value']);
   }
   
 }
}
YouTube is in that zip I sent you in torrent.php, just make the column
Enchanced Requests — 2020-09-19 18:39:09 in v3 Mods Completed
just replace string by string with google translate. It took forever, but I did that for spanish.php lang file.
I still see some mistakes in this code, for instance I should be using === for absolute conditions, especially array data, but = works too, just not intended according to PHP.

isConnectable() has poor conditions, and no return true/false making it somewhat unpredictable in case result.

Events causes all clients to disconnect. So we keep it off and all is well. Strange things like that. That’s why this weekend will finalize this script to final.

Other stuff like comments that are reverted back due to testing and conclusion of best fit, etc.

Live Stats:

I say, just read the peers. Thats where it all originates anyway.


<?
$findseeders  = $db->query_params("SELECT COUNT(torrent) FROM peers WHERE seeder = 'yes' AND torrent = :torrent_id", array(
   'torrent_id' => $torrent['id']
));
$findleechers = $db->query_params("SELECT COUNT(torrent) FROM peers WHERE seeder = 'no' AND torrent = :torrent_id", array(
   'torrent_id' => $torrent['id']
));
foreach ($findseeders->fetch() as $row) {
   $getseeders = $row;
   foreach ($findleechers->fetch() as $row2) {
       $getleechers = $row2;
   }
}

echo $getseeders;
echo $getleechers;


Replace $torrent['id'] with a real torrent ID in database, or simulate the query on a SQL IDE to see stats either way.


SELECT COUNT(torrent) FROM peers WHERE seeder = 'yes' AND torrent = 27;
SELECT COUNT(torrent) FROM peers WHERE seeder = 'no' AND torrent = 27;
"m-jay, post: 69356, member: 20288":

Two things I've learnt that might be useful
Close connection under header()
header("Connection: Close");


Close page after output
exit();



exit/die function doesn’t need to be wrapped unless you are defining a variable or string. Stateless is appropriate.  

This is not needed for my script (or probably any announce), maybe older scripts that rely on older methods. You also can’t interfere with bencode output at EOF because you will never have a working announce response from client.

Work inside file and leave the logic and routines as is. There is a lot of room for functions to be added and tested before queries. Be careful however, because that last echo must be a successful execution to reach that point and push to client.

I encourage anyone to test control mods with this as it is good to go. That is all it is expecting really.
Updates to follow this weekend **
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728