View Single Post
  #10  
Old 5th March 2008, 14:58
Neptune
Guest
 
Posts: n/a
Default Re: Torrentstrike Fullymodded v1.0
Quote:
Originally Posted by pepegrillo
Hi, in tracker Torrentstrike Fullymodded v1.0 when download .torrent this error:

Code:
Not Found

Sorry pal :(
Please help fix !?

Thanks from Argentina !!!
change your download.php with this 1

Code:
<?
require_once("include/bittorrent.php");
require_once("include/benc.php");

$id = (int)$_GET["id"];
$name = $_GET["name"];

if (!$id)
httperr();

$res = mysql_query("SELECT name FROM torrents WHERE id = $id") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($res);

$fn = "$torrent_dir/$id.torrent";

if (!$row || !is_file($fn) || !is_readable($fn))
   httperr();

mysql_query("UPDATE torrents SET hits = hits + 1 WHERE id = $id");

header("Content-Type: application/x-bittorrent");
header("Content-Disposition: attachment; filename=".$_GET["name"]."");

$dict = bdec_file($fn, filesize($fn));
if(ENA_PASSKEY) {
   verify_passkey($CURUSER['passkey']);
   $dict['value']['announce'] = bdec(benc_str("$BASEURL/". (ENA_ALTANNOUNCE ? "tracker.php/$CURUSER[passkey]/announce":"announce.php?passkey=$CURUSER[passkey]")));
} else if(ENA_ALTANNOUNCE)
   $dict['value']['announce'] = bdec(benc_str("$BASEURL/tracker.php/announce"));

print benc($dict);

?>
and in your details.php
change

Code:
print("<a class=\"index\" href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\">" . htmlspecialchars($row["filename"]) . "</a>")
to

Code:
print("<a class=\"index\" href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\">" . htmlspecialchars($row["filename"]) . "</a>");
Reply With Quote