Thread: Freeleech
View Single Post
  #1  
Old 6th June 2012, 13:25
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default Freeleech
Hello!

So I have 3 types of torrents - golden ones (freeleech), silver ones (half torrent size counts to download) and normal ones. The problem is - if I set freeleech manually to any torrent that isn't in the automatic range (4,5GB and up) it just goes back to silver or normal when the cleanup happens. I know that it's because of cleanup.php function but I can't think of any way to make it stay golden when I set it manually and cleanup happens. Everything I tried just gives me an error and nothing else.

Here's freeleech and silver part from cleanup.php:
Code:
	/** all files that are bigger than x GB get freeleech, except XXX, using new function - POWER **/
	
	$izmeers = 4.5; // GB count
	mysql_query("UPDATE torrents SET free_new = '2' WHERE size >= POWER(1024,3) * $izmeers AND category <> '32'") or sqlerr(__FILE__,__LINE__);
	/***** end *****/

	/** all files that are smaller than x GB get silver, except XXX, using new function - POWER **/
	$izmeers2 = 4.5; // GB count
	mysql_query("UPDATE torrents SET free_new = '1' WHERE size < POWER(1024,3) * $izmeers2 AND category <> '32'") or sqlerr(__FILE__,__LINE__);	
	
	/** Normal torrents**/
	$izmeers1 = 1.49; // GB count
	mysql_query("UPDATE torrents SET free_new = '0' WHERE size < POWER(1024,3) * $izmeers1 AND category <> '32'") or sqlerr(__FILE__,__LINE__);	
	/***** end *****/
I know that there are better ways to do it but this one works. lol :D

So in a few words - I need to modify this so the torrents I make gold (or silver) manually, stay like that not change back whenever cleanup starts.
Reply With Quote