Hi all!
Find in functions.php:
Add after:
Find:
Add after:
list($seedersTmp,$leechersTmp) = $rowTmp;
if ($seedersTmp >= 1 && $leechersTmp >= 1){
$speedQ = mysql_query("SELECT (t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS totalspeed FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND p.torrent = '$id' GROUP BY t.id ORDER BY added ASC LIMIT 15") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_assoc($speedQ);
$totalspeed = mksize($a["totalspeed"]) . "/s";
}
else
$totalspeed = "0.00kB/s";
print("<td class=ttable_col1 align=center><font size=1 color=black>");
echo $totalspeed;
print("</font></td>");
EnjoY!
:D wolfnet
Find in functions.php:
<td class=ttable_head><?php echo "" . HEALTH . "";?></td>Add after:
<td class=ttable_head>Speed</td>Find:
print("<td class=ttable_col1 align=center><img src=".$site_config["SITEURL"]."/images/health_".health($row["leechers"], $row["seeders"]).".gif></td>\n");Add after:
$resSpeed = mysql_query("SELECT seeders,leechers FROM torrents WHERE $where visible='yes' and id = $id ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);if ($rowTmp = mysql_fetch_row($resSpeed))list($seedersTmp,$leechersTmp) = $rowTmp;
if ($seedersTmp >= 1 && $leechersTmp >= 1){
$speedQ = mysql_query("SELECT (t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS totalspeed FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND p.torrent = '$id' GROUP BY t.id ORDER BY added ASC LIMIT 15") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_assoc($speedQ);
$totalspeed = mksize($a["totalspeed"]) . "/s";
}
else
$totalspeed = "0.00kB/s";
print("<td class=ttable_col1 align=center><font size=1 color=black>");
echo $totalspeed;
print("</font></td>");
EnjoY!
:D wolfnet