
Mod został napisany przez johim spolszczony przez nowyyy31
bittorrent.phpznajdź
<?
if ($variant == "index")
print("<td class=\"colhead\" align=center>Dodał/a</td>\n");
zamień na
<td class="colhead" align=center width=120>dodał</td>
<td class="colhead" align=center width=120>Postęp/Prędko¶ć</td>
<?
znajdź
else
$row["owner"] = "<a href=userdetails.php?id=" . $row["owner"] . ">";
print("<td align=center>" . (isset($row["username"]) ? ("" . $row["owner"] . "<b>" . htmlspecialchars($row["username"])
. "</b></a>") : "<i>unknown</i>") . "</td>\n");
pod dodaj
// Totalspeed mod
$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 = "Brak aktywno¶ci";
// Progressbar Mod
$seedersProgressbar = array();
$leechersProgressbar = array();
$resProgressbar = mysql_query("SELECT p.seeder, p.to_go, t.size FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.torrent = '$id'") or sqlerr();
$progressPerTorrent = 0;
$iProgressbar = 0;
while ($rowProgressbar = mysql_fetch_array($resProgressbar)) {
$progressPerTorrent += sprintf("%.1f", 100 * (1 - ($rowProgressbar["to_go"] / $rowProgressbar["size"])));
$iProgressbar++;
}
if ($iProgressbar == 0)
$iProgressbar = 1;
$progressTotal = sprintf("%.1f", $progressPerTorrent / $iProgressbar);
$picProgress = get_percent_completed_image(floor($progressTotal))." (".round($progressTotal)."%)";
print("<td align=center width=120>$picProgress $totalspeed</td>\n");
// End Progress Bar mod
jeśli nie masz funkcji get_percent_completed_image to dodaj pod
$maxloginattempts = 6; // Liczba dozwolonych blednych logowan, jesli uzytkownik zaloguje sie wiecej razy niz mozliwe jego ip zostanie zbanowane.
require_once("secrets.php");
require_once("cleanup.php");
dodaj
function get_percent_completed_image($p) {
$maxpx = "100"; // Maximum amount of pixels for the progress bar
if ($p == 0) $progress = "<img src=\"/pic/progbar-rest.gif\" height=9 width=" . ($maxpx) . " />";
if ($p == 100) $progress = "<img src=\"/pic/progbar-green.gif\" height=9 width=" . ($maxpx) . " />";
if ($p >= 1 && $p <= 30) $progress = "<img src=\"/pic/progbar-red.gif\" height=9 width=" . ($p*($maxpx/100)) . " /><img src=\"/pic/progbar-rest.gif\" height=9 width=" . ((100-$p)*($maxpx/100)) . " />";
if ($p >= 31 && $p <= 65) $progress = "<img src=\"/pic/progbar-yellow.gif\" height=9 width=" . ($p*($maxpx/100)) . " /><img src=\"/pic/progbar-rest.gif\" height=9 width=" . ((100-$p)*($maxpx/100)) . " />";
if ($p >= 66 && $p <= 99) $progress = "<img src=\"/pic/progbar-green.gif\" height=9 width=" . ($p*($maxpx/100)) . " /><img src=\"/pic/progbar-rest.gif\" height=9 width=" . ((100-$p)*($maxpx/100)) . " />";
return "<img src=\"/pic/bar_left1.gif\" />" . $progress ."<img src=\"/pic/bar_right1.gif\" />";
}
i dodaj pliki(gif) do folderu pic które są w załączniku ;]
