".TORRENT_UPDATE.""); require_once("./include/getscrape.php"); scrape(urldecode($_GET["surl"]),$id); redirect("details.php?id=$id"); exit(); } if (isset($_GET["vote"]) && $_GET["vote"]==VOTE) { @mysql_query("INSERT INTO ratings SET infohash='$id',userid=$CURUSER[uid],rating=".max(0,$_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, 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("
\n"); print("\n"); print("\n"); print("\n"); if (!empty($row["comment"])) print("\n"); if (isset($row["cat_name"])) print("\n"); else print("\n"); // rating print("\n"); print("\n"); // files in torrent - by Lupin 20/10/05 ?> \n"); } // end files in torrents print("\n"); if ($row["anonymous"]=="true") $uploader=TORRENT_ANONYMOUS; else $uploader=$row["username"]; print("\n"); if ($row["speed"] < 0) { $speed = "N/D"; } else if ($row["speed"] > 2097152) { $speed = round($row["speed"]/1048576,2) . " MB/sec"; } else { $speed = round($row["speed"] / 1024, 2) . " KB/sec"; } print("\n"); print("\n"); print("\n"); if ($row["external"]=="yes") { print("\n"); print("\n"); } print("
".FILE_NAME.":" . $row["filename"]. "
".TORRENT.":" . $row["filename"] . "
".INFO_HASH.":" . $row["info_hash"]. "
".DESCRIPTION.":" . format_comment($row["comment"]) . "
".CATEGORY_FULL.":" . unesc($row["cat_name"]). "
".CATEGORY_FULL.":(nessuno)
".RATING.":\n"); $vres = mysql_query("SELECT sum(rating) as totrate, count(*) as votes FROM ratings WHERE infohash = '$id'"); $vrow = @mysql_fetch_array($vres); if ($vrow && $vrow["votes"]>=1) { $totrate=round($vrow["totrate"]/$vrow["votes"],1); if ($totrate==5) $totrate=""; elseif ($totrate>4.4 && $totrate<5) $totrate=""; elseif ($totrate>3.9 && $totrate<4.5) $totrate=""; elseif ($totrate>3.4 && $totrate<4) $totrate=""; elseif ($totrate>2.9 && $totrate<3.5) $totrate=""; elseif ($totrate>2.4 && $totrate<3) $totrate=""; elseif ($totrate>1.9 && $totrate<2.5) $totrate=""; elseif ($totrate>1.4 && $totrate<2) $totrate=""; else $totrate=""; } else $totrate=NA; if ($row["username"]!=$CURUSER["username"] && $CURUSER["uid"]>1) { $ratings = array(5 => FIVE_STAR,4 => FOUR_STAR,3 => THREE_STAR,2 => TWO_STAR,1 => ONE_STAR); $xres = mysql_query("SELECT rating, added FROM ratings WHERE infohash = '$id' AND userid = " . $CURUSER["uid"]); $xrow = @mysql_fetch_array($xres); if ($xrow) $s = $totrate. " (".YOU_RATE." \"" . $ratings[$xrow["rating"]] . "\")"; else { $s = "
\n"; $s .= "\n"; $s .= "\n"; $s .= ""; $s .= "
\n"; } } else { $s = $totrate; } print $s; print("
".SIZE.":" . makesize($row["size"]). "
Show/Hide Files:
"); $ffile=fopen($row["url"],"rb"); $content=fread($ffile,filesize($row["url"])); fclose($ffile); $content=BDecode($content); $numfiles=0; if (isset($content["info"]) && $content["info"]) { $thefile=$content["info"]; if (isset($thefile["length"])) { $numfiles++; print("\n\n\n\n"); } elseif (isset($thefile["files"])) { foreach($thefile["files"] as $singlefile) { print("\n\n\n\n"); $numfiles++; } } else { print("\n\n\n"); // can't be but... } } print("
".FILE_NAME." ".SIZE."
".htmlspecialchars($thefile["name"])."".makesize($thefile["length"])."
".htmlspecialchars(implode("/",$singlefile["path"]))."".makesize($singlefile["length"])."
no data...
$numfiles".($numfiles==1?" file":" files")."
".ADDED.":" . date("d/m/Y",$row["data"]). "
".UPLOADER.":$uploader
".SPEED.":" . $speed . "
".DOWNLOADED.":" . $row["finished"] . " " . X_TIMES. "
".PEERS.": ".SEEDERS.": " . $row["seeds"] . ", ".LEECHERS.": " . $row["leechers"] ." = " . ($row["leechers"]+$row["seeds"]) . " ".PEERS."
".UPDATE."EXTERNAL
".$row["announce_url"]."
".LAST_UPDATE."".get_date_time($row["lastupdate"])."
\n"); print(""); // comments... $subres = mysql_query("SELECT id, text,UNIX_TIMESTAMP(added) as data,user FROM comments WHERE info_hash = '" . $id . "' ORDER BY added DESC"); if (!$subres || mysql_num_rows($subres)==0) { if($CURUSER["uid"]>1) $s = "

\n\n\n\n\n"; else $s = "

\n
\n".NEW_COMMENT."\n
\n"; $s .= "\n\n\n"; $s .= "
".NO_COMMENTS."
\n"; } else { print("

"); if($CURUSER["uid"]>1) $s = "

\n\n"; else $s = "

\n
".NEW_COMMENT."
\n"; while ($subrow = mysql_fetch_array($subres)) { $s .= "\n"; // only admin can delete comments... if ($CURUSER["admin_access"]=="yes") $s .= "\n"; $s .="\n"; $s .= "\n"; } $s .= "
" . $subrow["user"] . "" . date("d/m/Y H.i.s",$subrow["data"]) . "".image_or_link("$STYLEPATH/delete.png","",DELETE)."
" . format_comment($subrow["text"]) . "
\n"; } print($s); if ($GLOBALS["usepopup"]) print("


".CLOSE.""); else print("

".BACK.""); print("
\n"); block_end(); stdfoot(($GLOBALS["usepopup"]?false:true),false); ?>