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
[HACK] Auto Set FreeLeech
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-07-09 23:13:46
Hi

This is an automatism freleeche on the torrent of 8 Go and more which will become freeleech automatically.

NOTE: I add a writing to make it easier for you to add the desired number for your site.

Add before closing your page [color=rgb(184, 49, 47)]?>[/color] [color=rgb(204, 204, 204)]in [/color][color=rgb(251, 160, 38)] ../backend/cleanup.php [/color]
[color=rgb(204, 204, 204)]

####################################
# AUTO SET FREELEECH BY SPIRITBLUE #
####################################
// EXAMPLE //
// 1 octet = 8 bits
// 1 ko = 1024 octets, or 8192 bits
// 1 Mo = 1024 Ko, or 1048576 octets, or 8388608 bits
// 1 Go = 1024 Mo, or 1048576 Ko, or 1073741824 octets, or 8589934592 bits
$gigs  = 8589934592;
 $query = SQL_Query_exec("SELECT `id`, `name` FROM `torrents` WHERE `banned` = 'no' AND `freeleech` = '0' AND `size` >= $gigs");
 if (mysqli_num_rows($query) > 0)
 {
   while ($row = mysqli_fetch_array($query))
   {
    SQL_Query_exec("UPDATE `torrents` SET `freeleech` = '1' WHERE `id` = '{$row["id"]}'");
    write_log("Freeleech added on  <a href='torrents-details.php?id={$row["id"]}'>{$row["name"]}</a> because it is bigger than  8gb.");
   }                                                                                                                

}
##########################
# END AUTO SET FREELEECH #
##########################
[/color]

To change the number on this line:  
[color=rgb(204, 204, 204)]$gigs  = [/color][color=rgb(65, 168, 95)]8589934592[/color][color=rgb(204, 204, 204)]; [/color]
Unknown User
2019-07-10 00:19:29
Thanks
2020-05-29 10:17:53
Addition to add to config, it's best to place things that can be set in there

In config
$site_config['freeleechgb'] = '8589934592';        // freeleech if over x gb


Replace the line in mod in cleanup
$gigs  = 8589934592; 

For
$gigs  = $site_config["freeleechgb"];
2020-12-11 15:09:17
Thank you!
2022-12-30 19:48:40
spirtblue & m-jay
thanks
2022-12-30 19:48:40
spirtblue & m-jay
thanks
2022-12-30 21:47:00
I dont think Im wrong, But I think this line should be this way right? I dont use curly on those queries
SQL_Query_exec("UPDATE `torrents` SET `freeleech` = '1' WHERE `id` = '$row[id]'");


Cool idea @Spiritblue, thanks.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2022-12-30 22:09:48
2022-12-31 06:37:50

SQL_Query_exec("UPDATE `torrents` SET `freeleech` = 1 WHERE `id` = " . $row['id']);


Or


SQL_Query_exec("UPDATE `torrents` SET `freeleech` = 1 WHERE `id` = $row[id]");
2023-01-15 03:58:41

SQL_Query_exec("UPDATE `torrents` SET `freeleech` = 1 WHERE `id` = $row[id]");


Should be;


SQL_Query_exec("UPDATE `torrents` SET `freeleech` = 1 WHERE `id` =".sqlesc($row[id]));


prevention for SQL injection added hopefully rite...SQL
Last edited by SceneTrader on 2023-01-15 03:59:09
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728