예제 #1
0
        ?>
			<div id="torrentUpload">
				<h1><?php 
        echo $torrent->setTitle($CONFIG['torrent_name']);
        ?>
</h1>
				<?php 
        echo $torrent->setTagLine($CONFIG['torrent_tagline']);
        ?>
				<div id="result">
					<?php 
        $acceptTokens = $torrent->token();
        if (@$_POST['submit'] && strlen(@$_FILES['torrent_file']['name']) > 7 && in_array(@$_POST['api_token'], $acceptTokens)) {
            echo "<a name=\"result\" style=\"display: none;\">#</a>";
            $torrent_id = $torrent->generateID();
            if ($torrent->uploadFile($_FILES['torrent_file'], $torrent_id)) {
                echo "<div class=\"success\">Your torrent file has been uploaded!</div><div class=\"confirmURL\">URL to your torrent is <a href=\"" . $torrent->linker($torrent_id) . "\">" . $torrent->linker($torrent_id) . "</a></div>";
            } else {
                echo "<div class=\"error\">Upload of torrent file failed.</div>";
            }
            echo "<div class=\"spacer\">&nbsp;</div>";
        } elseif (@$_POST['submit'] && strlen(@$_FILES['torrent_file']['name']) > 7 && !in_array(@$_POST['api_token'], $acceptTokens)) {
            echo "<div class=\"error\">You have an invalid session!</div>\n<div class=\"spacer\">&nbsp;</div>";
        } elseif (@$_POST['submit'] && strlen(@$_FILES['torrent_file']['name']) < 8 && in_array(@$_POST['api_token'], $acceptTokens)) {
            echo "<div class=\"error\">Please select a valid .torrent File!</div>\n<div class=\"spacer\">&nbsp;</div>";
        } else {
            echo "&nbsp;";
        }
        ?>
				</div>
				<div id="upload_form">