function build_tor_filelist($file_contents) { global $lang; if (!($tor = bdecode($file_contents))) { return $lang['TORFILE_INVALID']; } $torrent = new torrent($tor); return $torrent->get_filelist(); }
$scrnam = $_SERVER['SCRIPT_NAME']; $reqhash = NULL; $info = explode("/", str_replace($scrnam, "", $requri)); $requri = str_replace("?", "", $info[0]); if (!file_exists('./INSTALL_LOCK') && $requri != "install") { header("Location: " . $_SERVER['PHP_SELF'] . "?install"); } if (file_exists('./INSTALL_LOCK') && $CONFIG['torrent_rewrite']) { $requri = $_GET['i']; } if (strstr($requri, "@")) { $tempRequri = explode('@', $requri, 2); $requri = $tempRequri[0]; $reqhash = $tempRequri[1]; } $torrent = new torrent($CONFIG); if ($requri == "install" || $requri == "") { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title><?php echo $torrent->setTitle($CONFIG['torrent_name']); ?> » <?php echo $torrent->titleID($requri); ?> </title> <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /> <link rel="icon" type="image/png" href="favicon.png" />