View Single Post
Old 26th September 2019, 20:21
Elena's Avatar
Elena Elena is offline
Senior Member
Join Date: Sep 2010
Posts: 40
I propose this option with a minimum of edits and a minimum of queries in the announcer (will not hammer the database constantly).

Database query:
ALTER TABLE `torrents` ADD `free` enum('bril','yes','silver','no') DEFAULT 'no';
remove unnecessary from your request, namely: silver, dupla_seed,
to stay like this:
$res = mysql_query("SELECT id, banned, free, seeders + leechers AS numpeers, UNIX_TIMESTAMP(added) AS ts FROM torrents WHERE " . hash_where("info_hash", $info_hash));
Well, actually the code that is responsible for the double upload, gold, silver or without discounts:
case 'bril': $upthist = round($upthis * 2);$downthist = 0;break;
case 'yes': $upthist = max(0, $uploaded - $self['uploaded']);$downthist = 0;break;
case 'silver': $upthist = max(0, $uploaded - $self['uploaded']);$downthist = round($downthis / 2);break;
case 'no': $upthist = max(0, $uploaded - $self['uploaded']);$downthist = max(0, $downloaded - $self['downloaded']);break;}
$upthisr = $upthist;$downthisr = $downthist;
if($upthis > 0 || $downthis >= 0){
mysql_query('UPDATE LOW_PRIORITY users SET uploaded = uploaded + '.$upthisr.', downloaded = downloaded + '.$downthisr.' WHERE id='.$userid) or err('Users error 2 (update)');}
This is your request to userfree for what actually answers?
$rz = mysql_query("SELECT id, uploaded, downloaded, class, userfree, parked FROM users WHERE passkey=".sqlesc($passkey)." AND enabled = 'yes' ORDER BY last_access DESC LIMIT 1") or err("Tracker error 2");
Global freezing of all torrents on the tracker? Is everything in gold?
Reply With Quote