query(" SELECT FreeTorrent, FreeLeechType FROM torrents WHERE ID = $TorrentID"); if ($DB->has_results()) { list($FreeTorrent, $FreeLeechType) = $DB->next_record(); if ($FreeTorrent == 2) { error('Torrent is already neutral leech.'); } elseif ($FreeTorrent == 1 && $FreeLeechType != 3) { error('Torrent is already free leech for another reason.'); } } else { error('Torrent does not exist'); } $DB->query(" SELECT BonusPoints FROM users_main WHERE ID = $UserID"); if ($DB->has_results()) { list($Points) = $DB->next_record(); if ($Points >= 20000) { $DB->query(" SELECT TorrentID FROM shop_freeleeches WHERE TorrentID = $TorrentID"); if ($DB->has_results()) { $DB->query(" UPDATE shop_freeleeches SET ExpiryTime = ExpiryTime + INTERVAL 1 DAY WHERE TorrentID = $TorrentID"); } else { $DB->query(" INSERT INTO shop_freeleeches (TorrentID, ExpiryTime) VALUES($TorrentID, NOW() + INTERVAL 1 DAY)"); Torrents::freeleech_torrents($TorrentID, 1, 3); } $DB->query(" UPDATE users_main SET BonusPoints = BonusPoints - 20000 WHERE ID = $UserID"); $DB->query(" UPDATE users_info SET AdminComment = CONCAT('".sqltime()." - Made TorrentID $TorrentID freeleech for 24 more hours via the store\n\n', AdminComment) WHERE UserID = $UserID"); $Cache->delete_value('user_info_heavy_'.$UserID); $Cache->delete_value('shop_freeleech_list'); } else { error("Not enough points"); } } View::show_header('Store'); ?>

Purchase Successful

You purchased 24 hours of freeleech for this torrent

Back to Store

Enter the URL of the torrent you wish to make freeleech for 24 hours:

Back to Store