Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[HACK] Torrent speed in torrents.php
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-03-27 13:37:44
Hi all!

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
Unknown User
2008-03-27 13:48:00
not needed.... 2.04 has it
Unknown User
2008-03-27 20:47:26
ehh  :D  :( :D
Unknown User
2008-03-27 21:05:05
i allready apllied this in my tt2.02/cause i don't want to change to 2.04 (mine is almost 100% translated)!

and it would be nice to have also a row with # of Completed
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728