Witam mam problem z uploadem b³ad jest mniej wiecej taki ze nie dodaje trakera,seedow,Peerów i ile razy pobrano torrenta i w tym zecz ze na innym trakerze to chodzi b.ladnie a na tym nie ;/ oto plik upload.php
<?
/* check if file is being accessed directly */
if (eregi("upload.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php?idx="); }
require_once ("include/functions.php");
require_once ("include/config.php");
require_once ("include/BDecode.php");
require_once ("include/BEncode.php");
dbconn();
if (isset($_FILES['torrent'])) {
if ($_FILES['torrent']['error'] != 4)
{
$fd = fopen($_FILES['torrent']['tmp_name'], "rb") or
die("File upload error 1n"); $alltorrent = fread($fd, filesize($_FILES['torrent']['tmp_name'])); $array = BDecode($alltorrent);
{
unlink($_FILES['torrent']['tmp_name']); echo "This is not a valid torrent file"; require "stdfooter.php";
}
if (!$array)
{
unlink($_FILES['torrent']['tmp_name']); echo "This is not a valid torrent file"; require "stdfooter.php";
}
$hash = sha1(BEncode($array['info']));
}
$reqreg = $_POST['reg'];
if ($reqreg == "")
{
unlink($_FILES['torrent']['tmp_name']); echo "Tracker registration must be filled in"; require "stdfooter.php";
}
$fname = $_POST['filename'];
if ($fname == "")
{
unlink($_FILES['torrent']['tmp_name']); echo "Please enter a filename"; require "stdfooter.php";
}
if (isset($_POST["filename"])) $filename=$_POST["filename"];
else
$url = $TORRENTSDIR . "/" . $hash . ".btf";
if (isset($_POST['info'])) $comment = $_POST['info'];
else
$comment = "";
if (isset($_POST['autoset'])) {
if (strcmp($_POST['autoset'], "enabled") == 0
) {
if (strlen($filename) == 0
&& isset($array['info']['name'])) $filename = $array['info']['name'];
if (isset($array['comment'])) $info = $array['comment'];
else
$info = "";
}
}
$upfile=$array['info'];
if (isset($upfile['length'])) {
$size = $upfile['length'];
}
else if (isset($upfile['files'])) {
$size=0;
foreach ($upfile['files'] as $file)
{
$size+=intval($file['length']); }
}
else
$size = "0";
$categoria = 0+$_POST['type'];
$announce=$array['announce'];
$anonyme=$_POST['anonymous'];
if ($categoria==0)
{
unlink($_FILES['torrent']['tmp_name']); echo "you did not fill in the category"; require "stdfooter.php";
}
if ((strlen($hash) != 40
) || !verifyHash
($hash)) {
unlink($_FILES['torrent']['tmp_name']); echo("<center><FONT COLOR="red
">Hash error</FONT></center>"); require "stdfooter.php";
}
if ($announce!=$BASEURL."/announce.php" && $EXTERNAL_TORRENTS==false)
{
unlink($_FILES['torrent']['tmp_name']); echo "external torrents are not allowed"; require "stdfooter.php";
}
$query = "INSERT INTO namemap
(info_hash, filename, url, info, category, data, size, comment, uploader,ano
nymous, userip, reqreg) VALUES
("$hash", "$filename", "$url", "$info",0 + $categoria,NOW(), "$size", "$comment",'3','$anonyme','$userip', '$reqreg')";
or sqlerr();
$status = makeTorrent($hash, true);
quickQuery($query);
if ($status)
{
move_uploaded_file($_FILES["torrent"]["tmp_name"] , $TORRENTSDIR . "/" . $hash . ".btf") or
die("Error moving torrent..."); if ($announce!=$BASEURL."/announce.php")
{
//print("<center>Please wait one moment...<br /></center>");
require_once("./include/getscrape.php");
scrape($announce,$hash);
echo "file upload succes...You can view your upload <a href="index
.php?idx
=details
&
;id
=$hash">here</a>. "; require "stdfooter.php";
}
}
else
{
echo "this torrent allready exists in our d-base"; unlink($_FILES['torrent']['tmp_name']); require "stdfooter.php";
}
}
else
{
?>
<div class="navbar"><ul>
<li>You can upload torrents that are tracked by any tracker</li>
<li>Do not send us adult content (you will get banned)</li>
<li>If you need a open tracker without registration, use <a href="http://owntracker.com" target="_blank">http://owntracker.com</a></li>
<li>Be patient while the script retrieves the data from the tracker (this may take a while)</li>
<li>All ip's are logged misuse will get you banned</li>
</ul>
</div>
<FORM name="upload" METHOD="POST" ENCTYPE="multipart/form-data">
<table width="100%" border="0" class="infotable">
<tr>
<td>Torrent</td>
<td><input type="file" name="torrent"></td>
</tr>
<tr>
<td>File name</td>
<td><input type=text name="filename" size=50 maxlength=200></td>
</tr>
<tr>
<td>Category</td>
<td><select name="type">
<option value="0">(Choose)</option>
<?php
$result = mysql_query("SELECT id, name, sort_index FROM categories ORDER BY name ASC ") or sqlerr
(); {
echo $row['id'];
echo "">";
}
?>
</select>
<input type=hidden name=user_id size=50 value= >
<input type= hidden "radio" name="anonymous2" value="false" checked />
<input type= hidden "radio" name="anonymous" value="true" />
<input type= hidden checkbox name="autoset" value="enabled" checked></td>
</tr>
<tr>
<td>Tracker requires registration</td>
<td> yes <input name="reg" type="radio" value="1" /> no <input name="reg" type="radio" value="0" /></td>
</tr>
<tr>
<td> </td>
<td><input class="form_button" name="submit" type=submit value="Send"></td>
</tr>
</table>
</FORM>
<?
}
?>