| wanted to add a wait hack [message #221] |
Fri, 15 September 2006 19:56  |
|
well this work does any one know
$rzz = mysql_query("SELECT * FROM ".$db_prefix."_users WHERE ip='$ip' LIMIT 1");
$azz = mysql_fetch_assoc($rzz);
if ($left > 0 && $azz["level"] < premium )
{
$uclass = $azz["level"];
$gigs = $azz["uploaded"] / (1024*1024*1024);
$elapsed = floor((gmtime() - $torrent["ts"]) / 3600);
$ratio = (($azz["downloaded"] > 0) ? ($azz["uploaded"] / $azz["downloaded"]) : 1);
// users with ratio = 0 AND 0 gigs, wait 24hr?
if ($ratio == 0 && $gigs == 0) $wait = 24;
elseif ($ratio < 0.50 || $gigs < 1) $wait = 24;
elseif ($ratio < 0.65 || $gigs < 3) $wait = 12;
elseif ($ratio < 0.80 || $gigs < 5) $wait = 6;
elseif ($ratio < 0.95 || $gigs < 7) $wait = 2;
else $wait = 0;
if ($wait)
if ($elapsed < $wait)
err("Not authorized (" . ($wait - $elapsed) . "h) - READ THE FAQ! $SITEURL");
}
and did i mess anything
[Updated on: Fri, 15 September 2006 20:11] Report message to a moderator
|
|
|
|
| Re: wanted to add a wait hack [message #224 is a reply to message #223] |
Sat, 16 September 2006 04:22   |
|
well it wasnt intented tobe a completed hack it was intent to ask for advise
and for the question there is not a quiry for the info that i require inless i change one like $user_sql = "SELECT id, level FROM ".$db_prefix."_users WHERE ".$sql_where." ORDER BY lastlogin DESC LIMIT 1;";
if (!$userres = $db->sql_query($user_sql)) err("SQL Error: ".$user_sql);
if ($userrow = $db->sql_fetchrow($userres)) {
$uid = $userrow["id"];
$ulevel = $userrow["level"];
to this
$user_sql = "SELECT id, level, upload, download FROM ".$db_prefix."_users WHERE ".$sql_where." ORDER BY lastlogin DESC LIMIT 1;";
if (!$userres = $db->sql_query($user_sql)) err("SQL Error: ".$user_sql);
if ($userrow = $db->sql_fetchrow($userres)) {
$uid = $userrow["id"];
$ulevel = $userrow["level"];
and then change the hack to
if ($left > 0 && $azz["level"]=="user")
{
$uclass = $userrow["level"];
$gigs = $userrow["uploaded"] / (1024*1024*1024);
$elapsed = floor((gmtime() - $torrent["ts"]) / 3600);
$ratio = (($userrow["downloaded"] > 0) ? ($userrow["uploaded"] / $userrow["downloaded"]) : 1);
// users with ratio = 0 AND 0 gigs, wait 24hr?
if ($ratio == 0 && $gigs == 0) $wait = 24;
elseif ($ratio < 0.50 || $gigs < 1) $wait = 24;
elseif ($ratio < 0.65 || $gigs < 3) $wait = 12;
elseif ($ratio < 0.80 || $gigs < 5) $wait = 6;
elseif ($ratio < 0.95 || $gigs < 7) $wait = 2;
else $wait = 0;
if ($wait)
if ($elapsed < $wait)
err("Not authorized (" . ($wait - $elapsed) . "h) - READ THE FAQ! $SITEURL");
}
that would do away with the extra query and use what is there but not sure if it well carry over
[Updated on: Sun, 17 September 2006 21:36] Report message to a moderator
|
|
|
|
|
| Re: wanted to add a wait hack [message #4761 is a reply to message #4377] |
Fri, 27 August 2010 23:01  |
|
open include/bittorrent.php
find
echo "<th align=\"center\" width=\"2%\"><p>"._btcomments."</p></th>";
add below
echo"<td class=\"colhead\" align=\"center\">Wait Time</td>\n";
then find
echo"<td align=\"center\">";
if (!$row["comments"])
print($row["comments"] . "");
else {
$hit = ($row["owner"] == $user->id) ? "" : "&hit=1";
echo "<b><a href=\"details.php?id=".$row["id"].$hit."&comm=startcomments\">" . $row["comments"] . "</a></b>";
}
echo"</td>\n";
add below
if ($left > 0 && $azz["level"]=="user")
{
$uclass = $userrow["level"];
$gigs = $userrow["uploaded"] / (1024*1024*1024);
$elapsed = floor((gmtime() - $torrent["ts"]) / 3600);
$ratio = (($userrow["downloaded"] > 0) ? ($userrow["uploaded"] / $userrow["downloaded"]) : 1);
// users with ratio = 0 AND 0 gigs, wait 24hr?
if ($ratio == 0 && $gigs == 0) $wait = 24;
elseif ($ratio < 0.50 || $gigs < 1) $wait = 24;
elseif ($ratio < 0.65 || $gigs < 3) $wait = 12;
elseif ($ratio < 0.80 || $gigs < 5) $wait = 6;
elseif ($ratio < 0.95 || $gigs < 7) $wait = 2;
else $wait = 0;
if ($wait)
if ($elapsed < $wait)
err("Not authorized (" . ($wait - $elapsed) . "h) - READ THE FAQ! $SITEURL");
}
echo"<td align=\"center\">" . number_format($wait - $elapsed) . "<br>hours</td>\n";
no erros, theres more to do i think but this is a start


For cheap, fast, reliable webhosting, please click here on my affiliate link!
[Updated on: Fri, 27 August 2010 23:03] Report message to a moderator
|
|
|