rendered paste body$seedsarr = @mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `cnt` FROM `peers` WHERE `userid`=" . $CURUSER["id"] . " AND `seeder`='yes'"));
$seeds = $seedsarr["cnt"];
$leechesarr = @mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `cnt` FROM `peers` WHERE `userid`=" . $CURUSER["id"] . " AND `seeder`='no'"));
$leeches = $leechesarr["cnt"];
$tlimits = get_torrent_limits($CURUSER);
if ($ratio < 0.5) {
$ratiowarn = " style=\"background-color:red;color:white;\"";
} elseif ($ratio < 0.75) {
$ratiowarn = " style=\"background-color:#FFFF00;color:black;\"";
}
if ($tlimits["seeds"] >= 0) {
if ($tlimits["seeds"] - $seeds < 1)
$seedwarn = " style=\"background-color:red;color:white;\"";
$tlimits["seeds"] = " / " . $tlimits["seeds"];
} else
$tlimits["seeds"] = "";
if ($tlimits["leeches"] >= 0) {
if ($tlimits["leeches"] - $leeches < 1)
$leechwarn = " style=\"background-color:red;color:white;\"";
$tlimits["leeches"] = " / " . $tlimits["leeches"];
} else
$tlimits["leeches"] = "";
if ($tlimits["total"] >= 0) {
if ($tlimits["total"] - $leeches + $seeds < 1)
$totalwarn = " style=\"background-color:red;color:white;\"";
$tlimits["total"] = " / " . $tlimits["total"];
} else
$tlimits["total"] = "";
}
?>