View Single Post
  #1  
Old 8th June 2013, 12:11
steveny3's Avatar
steveny3 steveny3 is offline
Member
 
Join Date: Jun 2011
United Kingdom
Posts: 7
Default Free leech per user
Im using a ts 3.1 special that ive modded over the years. Ive been trying to add a free leech per user script but just cant get it to work?
This is the section from my announce.php


}else{
$upthis = max(0, $uploaded - $self['uploaded']);
$downthis = max(0, $downloaded - $self['downloaded']);
if ($upthis > 0 || $downthis > 0)
mysql_query('UPDATE users SET uploaded = uploaded + '.$upthis * 1 . ($torrent['free'] == 'no' ? ', downloaded = downloaded + '.$downthis : ''). ' WHERE id='.$userid) or err('Tracker error 3');
}

And I need to add something like below so that $downthis is set to "0" if free leech is set for an individual user. Ive tried for a few days to make it work but cant suss is?: Ive added working script to my details so I can change the value of "$userfree" to "yes" or "no" but cant get the above code to change the value of "$downthis" to give a "0" when $userfree is set to "yes" Ive tried adding below script just below if ($upthis > 0 || $downthis > 0) and everywhere else but cant get it to work?


if ($az["userfree"] == "no")
$downthis = max(0, $downloaded - $self["downloaded"]);
else
$downthis = 0;

I would really appreciate some help to make this work and will be happy to make a donation here if I can fix this. Cheers
Reply With Quote