Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Strike (http://www.bvlist.com/forumdisplay.php?f=21)
-   -   Snatched Mod (http://www.bvlist.com/showthread.php?t=1145)

50Cent 11th October 2008 12:04

Snatched Mod
 
hi all,hav a anybody a mod/code for Torrentstrike?


greetz

RikT 11th October 2008 12:12

Quote:

Originally Posted by 50Cent (Post 5076)
hi all,hav a anybody a mod/code for Torrentstrike?


greetz

Try looking on the Tbdev forums m8 nearly all the mods there work with torrentstrike as its based on tbdev :ok:

"."
\n");
}
print("
Subzero 11th October 2008 13:11

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` (
`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;

in announce find this
Code:

if ($event == "completed")
{
$updateset[] = "times_completed = times_completed + 1";
}

and change to
Code:

if ($event == "completed")
{
$updateset[] = "times_completed = times_completed + 1";
mysql_query("INSERT INTO snatched (torrentid,userid) VALUES ($torrentid,$userid)");
}

In Details find
Code:

}
else {
stdhead("Comments for torrent \"" . $row["name"] . "\"");
print("

Comments for " . $row["name"] . "

\n");
print("

Back to full details

\n");
}

add this after it
Code:

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?"\"Online\"":"\"Offline\"" )."
" . ($arr3["seeder"] == "yes" ? "Yes" : "No") . "
\n");

echo $pagerbottom;
in bittorrent find this
Code:

print("" . number_format($row["times_completed"]) . "time$_s\n");
change to
Code:

print("" .          number_format($row["times_completed"]) . "time$_s\n");
also find this
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");
}

and change to
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");
}

in cleanup find 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 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)");
}

}

or what ever you use to delete the old torrents

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)");
}

}

lastly make a file called viewsnatches.php and add this inside it
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("

Snatch Details for $arr2[name]

\n");
print("

The users at the top finished the download most recently

");

echo $pagertop;

print("\n");
print("");

$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(""."
\n");
}
print("
UsernameUploadedDownloadedShare RatioPM UserReport UserOn/OffSeeding
$arr[username]$uploaded$downloaded$ratio
" . get_user_icons($arr2, true) .

"  ".("'".$arr2['last_access']."'">$dt?"\"Online\"":"\"Offline\"" )."
" . ($arr3["seeder"] == "yes" ? "Yes" : "No") . "
\n");

echo $pagerbottom;

stdfoot();

?>


50Cent 11th October 2008 19:22

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

Subzero 11th October 2008 21:24

Check on tbdev m8 as someone may have had the same prob ;)

Dragan3591 14th October 2008 12:26

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.