|
#1
|
|||
|
|||
Snatched Mod
hi all,hav a anybody a mod/code for Torrentstrike?
greetz |
#2
|
|||
|
|||
Try looking on the Tbdev forums m8 nearly all the mods there work with torrentstrike as its based on tbdev
|
#3
|
||||
|
||||
Simple snatched list based on oinks code, Shows global up/download on/off seeding
POSTED BY thebrass ON TBDEV
Table Code:
CREATE TABLE `snatched` ( `id` int(11) NOT NULL auto_increment, `torrentid` int(11) default '0', `userid` int(11) default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=0; Code:
if ($event == "completed") { $updateset[] = "times_completed = times_completed + 1"; } Code:
if ($event == "completed") { $updateset[] = "times_completed = times_completed + 1"; mysql_query("INSERT INTO snatched (torrentid,userid) VALUES ($torrentid,$userid)"); } Code:
} else { stdhead("Comments for torrent \"" . $row["name"] . "\""); print("<h1>Comments for <a href=details.php?id=$id>" . $row["name"] . "</a></h1>\n"); print("<p><a href=\"details.php?id=$id\">Back to full details</a></p>\n"); } Code:
else $ratio = "---"; $uploaded =mksize($arr["uploaded"]); $downloaded = mksize($arr["downloaded"]); print("<tr><td><a href=userdetails.php?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left>$uploaded</td><td align=left>$downloaded</td><td align=left>$ratio</td><td><form method=get action=sendmessage.php><input type=hidden name=receiver value=" . $arr[userid]."><input type=submit value=\"P M: $arr[username]\" style='height: 22px'></form><form method=post action=report.php?user=$arr[userid]></td><td align=left><input type=submit value=\"Report: $arr[username]\" style='height: 23px'></form></td><td align=center>" . get_user_icons($arr2, true) . " ".("'".$arr2['last_access']."'">$dt?"<img src=".$pic_base_url."online.gif border=0 alt=\"Online\">":"<img src=".$pic_base_url."offline.gif border=0 alt=\"Offline\">" )."</td>"." <td align=center>" . ($arr3["seeder"] == "yes" ? "<b><font color=green>Yes</font>" : "<font color=red>No</font></b>") . "</td></tr>\n"); } print("</table>\n"); echo $pagerbottom; Code:
print("<td align=center>" . number_format($row["times_completed"]) . "<br>time$_s</td>\n"); Code:
print("<td align=center><a href=viewsnatches.php?id=$row[id]>" . number_format($row["times_completed"]) . "<br>time$_s</a></td>\n"); Code:
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"); } Code:
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"); } Code:
// 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)"); } } change to this Code:
// 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)"); } } Code:
<? 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("<h1 align=center>Snatch Details for <a href=details.php?id=$_GET[id]><b>$arr2[name]</b></a></h1>\n"); print("<p align=center>The users at the top finished the download most recently</p>"); echo $pagertop; print("<table border=1 cellspacing=0 cellpadding=5 align=center>\n"); print("<tr><td class=colhead align=left>Username</td><td class=colhead align=left>Uploaded</td><td class=colhead align=left>Downloaded</td><td class=colhead align=left>Share Ratio</td><td class=colhead align=left>PM User</td><td class=colhead align=left><font color=red>Report User</font></td><td class=colhead align=left>On/Off</td><td class=colhead align=left>Seeding</td></tr>"); $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 = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>"; } else if ($arr["uploaded"] > 0) $ratio = "Inf."; else $ratio = "---"; $uploaded =mksize($arr["uploaded"]); $downloaded = mksize($arr["downloaded"]); print("<tr><td><a href=userdetails.php?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left>$uploaded</td><td align=left>$downloaded</td><td align=left>$ratio</td><td><form method=get action=sendmessage.php><input type=hidden name=receiver value=" . $arr[userid]."><input type=submit value=\"P M: $arr[username]\" style='height: 22px'></form><form method=post action=report.php?user=$arr[userid]></td><td align=left><input type=submit value=\"Report: $arr[username]\" style='height: 23px'></form></td><td align=center>" . get_user_icons($arr2, true) . " ".("'".$arr2['last_access']."'">$dt?"<img src=".$pic_base_url."online.gif border=0 alt=\"Online\">":"<img src=".$pic_base_url."offline.gif border=0 alt=\"Offline\">" )."</td>"." <td align=center>" . ($arr3["seeder"] == "yes" ? "<b><font color=green>Yes</font>" : "<font color=red>No</font></b>") . "</td></tr>\n"); } print("</table>\n"); echo $pagerbottom; stdfoot(); ?> |
#4
|
|||
|
|||
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 |
#5
|
||||
|
||||
Check on tbdev m8 as someone may have had the same prob ;)
|
#6
|
||||
|
||||
Funniest thing is that every single mod works from TbDev for some reason
__________________
CLICK HERE FOR IMPORTANT NEWS FROM BVLIST!! "Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut." Ernest Hemingway. "A positive attitude will not solve all your problems, but it will annoy enough people to make it worth the effort." Herm Albright. |
Tags |
mod , snatched |
|
|