Snatched Mod
hi all,hav a anybody a mod/code for Torrentstrike?
greetz |
Quote:
|
Simple snatched list based on oinks code, Shows global up/download on/off seeding
1 Attachment(s)
POSTED BY thebrass ON TBDEV Attachment 412 Table Code:
CREATE TABLE `snatched` ( Code:
if ($event == "completed") Code:
if ($event == "completed") Code:
} Code:
else |
print("" . number_format($row["times_completed"]) . "time$_s \n");
function deletetorrent($id) {
global $torrent_dir;
mysql_query("DELETE FROM torrents WHERE id = $id");
foreach(explode(".","peers.files.comments.ratings") as $x)
mysql_query("DELETE FROM $x WHERE torrent = $id");
unlink("$torrent_dir/$id.torrent");
}
function deletetorrent($id) {
global $torrent_dir;
mysql_query("DELETE FROM torrents WHERE id = $id");
mysql_query("DELETE FROM snatched WHERE torrentid = $id");
foreach(explode(".","peers.files.comments.ratings") as $x)
mysql_query("DELETE FROM $x WHERE torrent = $id");
unlink("$torrent_dir/$id.torrent");
}
// delete old torrents // old code for TTL
$days = 28;
$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
$res = mysql_query("SELECT id, name FROM torrents WHERE added < $dt");
while ($arr = mysql_fetch_assoc($res))
{
@unlink("$torrent_dir/$arr[id].torrent");
mysql_query("DELETE FROM torrents WHERE id=$arr[id]");
mysql_query("DELETE FROM peers WHERE torrent=$arr[id]");
mysql_query("DELETE FROM comments WHERE torrent=$arr[id]");
mysql_query("DELETE FROM files WHERE torrent=$arr[id]");
write_log("Torrent $arr[id] ($arr[name]) was deleted by system (older than $days days)");
}
}
// delete old torrents // old code for TTL
$days = 28;
$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
$res = mysql_query("SELECT id, name FROM torrents WHERE added < $dt");
while ($arr = mysql_fetch_assoc($res))
{
@unlink("$torrent_dir/$arr[id].torrent");
mysql_query("DELETE FROM torrents WHERE id=$arr[id]");
mysql_query("DELETE FROM snatched WHERE torrentid =$arr[id]");
mysql_query("DELETE FROM peers WHERE torrent=$arr[id]");
mysql_query("DELETE FROM comments WHERE torrent=$arr[id]");
mysql_query("DELETE FROM files WHERE torrent=$arr[id]");
write_log("Torrent $arr[id] ($arr[name]) was deleted by system (older than $days days)");
}
}
require "include/bittorrent.php";
dbconn(false);
loggedinorreturn();
ob_start("ob_gzhandler");
stdhead("Snatch Details");
begin_main_frame();
$res3 = mysql_query("select count(snatched.id) from snatched inner join users on snatched.userid = users.id inner join torrents on snatched.torrentid = torrents.id where snatched.torrentid =" . $_GET[id]) or die(mysql_error());
$row = mysql_fetch_array($res3);
$count = $row[0];
$perpage = 50;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] . "?id=" . $_GET[id] . "&" );
$res2 = mysql_query("select name from torrents where id = $_GET[id]");
$arr2 = mysql_fetch_assoc($res2);
$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
print("Snatch Details for $arr2[name]
\n");
print("The users at the top finished the download most recently
");
echo $pagertop;
print("\n");
print("Username Uploaded Downloaded Share Ratio PM User Report User On/Off Seeding ");
$res = mysql_query("select users.id, users.username, users.uploaded, users.downloaded, snatched.userid from snatched inner join users on snatched.userid = users.id inner join torrents on snatched.torrentid = torrents.id where snatched.torrentid =" . $_GET[id] . " ORDER BY snatched.id desc $limit");
while ($arr = mysql_fetch_assoc($res))
{
$res2 = mysql_query("SELECT id,donor,title,enabled,warned,last_access FROM users WHERE id=$arr[userid]") or sqlerr(__FILE__, __LINE__);
$arr2 = mysql_fetch_assoc($res2);
$res3 = mysql_query("SELECT * FROM peers WHERE torrent=$_GET[id] AND userid=$arr[userid]");
$arr3 = mysql_fetch_assoc($res3);
if ($arr["downloaded"] > 0)
{
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "$ratio";
}
else
if ($arr["uploaded"] > 0)
$ratio = "Inf.";
else
$ratio = "---";
$uploaded =mksize($arr["uploaded"]);
$downloaded = mksize($arr["downloaded"]);
print("$arr[username] $uploaded $downloaded $ratio " . get_user_icons($arr2, true) .
" ".("'".$arr2['last_access']."'">$dt?"":"" )." "."
" . ($arr3["seeder"] == "yes" ? "Yes" : "No") . " \n");
}
print("
\n");
echo $pagerbottom;
stdfoot();
?>
thanks
thx u very much;-)
just come error-- Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 greetz |
Check on tbdev m8 as someone may have had the same prob ;)
|
Funniest thing is that every single mod works from TbDev for some reason :lol:
|
All times are GMT +2. The time now is 21:05. |
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.