<?php
require_once("include/functions.php");
require_once("include/config.php");
dbconn();
standardheader('Torrent Details',($GLOBALS["usepopup"]?false:true));
?>
<script language=javascript>
function windowunder(link)
{
window.opener.document.location=link;
window.close();
}
</script>
<?php
if(!$CURUSER || $CURUSER["view_torrents"]!="yes")
{
err_msg(ERROR.NOT_AUTHORIZED." ".MNU_TORRENT."!",SORRY."...");
stdfoot(($GLOBALS["usepopup"]?false:true),false);
exit();
}
block_begin(TORRENT_DETAIL);
$id = AddSlashes((isset($_GET["id"])?$_GET["id"]:false));
if (!isset($id) || !$id)
die(ERROR_ID.": $id");
if (isset($_GET["act"]))
{
print("<center>".TORRENT_UPDATE."</center>");
require_once("./include/getscrape.php");
scrape(urldecode($_GET["surl"]),$id);
redirect("details.php?id=$id");
exit();
}
if (isset($_GET["vote"]) && $_GET["vote"]==VOTE)
{
if (isset($_GET["rating"]) && $_GET["rating"]==0)
{
err_msg(ERROR,ERR_NO_VOTE);
block_end();
stdfoot(($GLOBALS["usepopup"]?false:true),false);
exit();
}
else {
@mysql_query("INSERT INTO ratings SET infohash='$id',userid=$CURUSER[uid],rating=".intval($_GET["rating"]).",added='".time()."'");
redirect("details.php?id=$id");
}
exit();
}
$res = mysql_query("SELECT namemap.info_hash, namemap.filename, namemap.url, UNIX_TIMESTAMP(namemap.data) as data, namemap.size, namemap.comment, namemap.uploader, categories.name as cat_name, summary.seeds, summary.leechers, summary.finished, summary.speed, namemap.external, namemap.announce_url,UNIX_TIMESTAMP(namemap.lastupdate) as lastupdate, namemap.anonymous, users.username FROM namemap LEFT JOIN categories ON categories.id=namemap.category LEFT JOIN summary ON summary.info_hash=namemap.info_hash LEFT JOIN users ON users.id=namemap.uploader WHERE namemap.info_hash ='" . $id . "'")
or die(mysql_error());
$row = mysql_fetch_array($res);
if (!$row)
die("Bad ID!");
$spacer = " ";
print("<div align=center><table class=\"lista\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\">\n");
//print("<tr><td align=\"right\" class=\"header\"> ".FILE_NAME.":</td><td class=\"lista\" align=\"center\">" . $row["filename"]. "</td></tr>\n");
print("<tr><td align=\"right\" class=\"header\"> ".FILE_NAME);
if ($CURUSER["uid"]>1 && ($CURUSER["uid"]==$row["uploader"] || $CURUSER["edit_torrents"]=="yes" || $CURUSER["delete_torrents"]=="yes"))