Thread: Hit & Run mod
View Single Post
  #10  
Old 19th December 2018, 14:51
Elena Elena is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 111
Lightbulb Ban on racing if the rating is bad
Open announce.php and remove this code here:
Quote:
if ($az['class'] < UC_VIP) {
if ($use_wait) {
$gigs = $az['uploaded'] / (1024*1024*1024);
$elapsed = floor((strtotime(date('Y-m-d H:i:s')) - $torrent['ts']) / 3600);
$ratio = (($az['downloaded'] > 0) ? ($az['uploaded'] / $az['downloaded']) : 1);
if ($ratio < 0.5 || $gigs < 5)
$wait = 48;
elseif ($ratio < 0.65 || $gigs < 6.5)
$wait = 24;
elseif ($ratio < 0.8 || $gigs < 8)
$wait = 12;
elseif ($ratio < 0.95 || $gigs < 9.5)
$wait = 6;
else
$wait = 0;
if ($elapsed < $wait)
err('Not authorized (' . ($wait - $elapsed) . 'h) - READ THE FAQ!');
}
}
and two queries in the 153 default line from GIT, here it is:
Quote:
$rz = mysql_query('SELECT id, uploaded, downloaded, enabled, parked, class, passkey_ip FROM users WHERE passkey = '.sqlesc($passkey).' ORDER BY last_access DESC LIMIT 1') or err('Users error 1 (select)');
namely, uploaded, downloaded, since they are NOT NEEDED there anymore.

open download.php and everything before this request:

Quote:
sql_query("UPDATE torrents SET hits = hits + 1 WHERE id = ".sqlesc($id));
change to this:
Quote:
<?php
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
parked();

if (@ini_get('output_handler') == 'ob_gzhandler' AND @ob_get_length() !== false)
{ // if output_handler = ob_gzhandler, turn it off and remove the header sent by PHP
@ob_end_clean();
header('Content-Encoding:');
}
$id = (int) $_GET["id"];
if (!is_numeric($id))
stderr($tracker_lang['error'],$tracker_lang['invalid_id']);
if ($use_wait)
if (($CURUSER["class"] < UC_POWER_USER) && $CURUSER) {
$gigs = $CURUSER["uploaded"] / (1024*1024*1024);
$ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 0);
if ($ratio < 0.5 || $gigs < 5) $wait = 48;
elseif ($ratio < 0.65 || $gigs < 6.5) $wait = 24;
elseif ($ratio < 0.8 || $gigs < 8) $wait = 12;
elseif ($ratio < 0.95 || $gigs < 9.5) $wait = 6;
else $wait = 0;
}
$res = mysql_query("SELECT name, filename, added, owner, banned FROM torrents WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
////////////////////////////////
$row = mysql_fetch_assoc($res);
if (!$row)
stderr($tracker_lang['error'], $tracker_lang['invalid_id']);
//////////////////////////////////
$name = $row['filename'];
$fn = "$torrent_dir/$id.torrent";
if (!$row || !is_file($fn) || !is_readable($fn))
stderr($tracker_lang['error'], $tracker_lang['unable_to_read_torrent']);
///////////////////
if ($row['banned'] == 'yes' && $row['owner'] != $CURUSER['id'] && get_user_class() < UC_MODERATOR)
stderr($tracker_lang['error'], 'Oops, and torrentik banned!');
///////////////////////////
if ($wait)
{
$elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
if ($elapsed < $wait)
{
$color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
stderr($tracker_lang['error'], "&nbsp;&nbsp;<nobr><font size="1" color="red">Raise the rating! You can download this release only through</font>&nbsp;<a href="faq.php#dl8"><font color="$color">".number_format($wait - $elapsed)." h</font></a></nobr><br>");
} }
////////////////////
Then play with the Details and Brows page, there you can paste the same code for the jump limit - close the download button and the message will be waiting for ** hours instead.
Reply With Quote