Polish Bittorrent Tracker Support

  • Maj 18, 2012, 04:35:38
  • Witamy, Gość
Zaloguj się lub zarejestruj.

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Szukanie zaawansowane  

Aktualności:

Autor Wątek: Problem z stroną  (Przeczytany 979 razy)

0 użytkowników i 1 Gość przegląda ten wątek.

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Problem z stroną
« dnia: Kwiecień 07, 2010, 10:28:39 »

Witam serdecznie mam nietypowy problem. Program w 100% mi chodzi bez żadnych kłopotów ale po zainstalowaniu na moim serwie moja pierwsza strona uległa zmianie. Problem polega na tym ze zamiast strony która posiadam pokazuje sie strona z torrentami. Jedyna opcja to jest możliwość zalogowania sie do mojego forum... osobno i ono nie uległo zmiany.

i tu moje pytanie jak mogę zrobić aby przywrócić stary ład i posiadać tą stronę z torrentami

wszystko posiadam na jednym adresie.

a jestem zielony w te sprawy ;) hehe wiec popełniam błędy ale kto ich nie popełnia to sie nie nauczy ;)
Prosze o pomoc
Zapisane

P2P

  • BTDEV Staff
  • Super zaawansowany
  • *****
  • Reputacja 45
  • Online Online
  • Płeć: Mężczyzna
  • Wiadomości: 471
Odp: Problem z stroną
« Odpowiedź #1 dnia: Kwiecień 08, 2010, 12:40:46 »

Nie bardzo ja rozumiem Program w 100% mi chodzi bez żadnych kłopotów,i druga rzecz jest taka Problem polega na tym ze zamiast strony która posiadam pokazuje sie strona z torrentami. Jedyna opcja to jest możliwość zalogowania sie do mojego forum... osobno i ono nie uległo zmiany. ja nie wiem o co ci chodzi ze co wgrałes pliki na serwer tak?? i co dalej?? jaki program jaka strona torrentowa i co za forum?? jaki silnik instalowałęs na serwerze ... bo ja sie pogubiłem w tym co przeczytałem   :) sprecyzuj porzadnie zdanie co jest nie tak ...
Zapisane
Brazylijscy naukowcy odkryli, że ludzie czytający posty i trzymający rękę na myszce mają niższe IQ

Już za późno nie zdejmujcie

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #2 dnia: Kwiecień 08, 2010, 10:30:36 »

sprecyzować hmmm oki

Posiadam strone własna z amatorska grupa fansubingowa.
Zainstalowałem bittorrenta wedle waszego manuala na stronie.
i potem mi sie posypało, zamiast strony logowania do grupy pokazuję i sie strona logowania do bt
dopiero normalnie mogę sie z forum zalogować nja swoja stronę ale nadal głównej strony nie ma tylko jest strona bt
i tu jest moj problem chciał bym odzyskać stronę logowania grupy i miec osobno bt

dokładniej to pokarze ;)

http://apfsubs.cal.pl/   i gdzie moge znaleźć panel Administracyjny do tego ;)
http://apfsubs.cal.pl/forum

a powinno byc co innego ;P
« Ostatnia zmiana: Kwiecień 08, 2010, 12:14:28 wysłana przez bogumił »
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #3 dnia: Kwiecień 08, 2010, 03:38:46 »

Albo zrobić przez ssh (np: MC ) :D
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #4 dnia: Kwiecień 08, 2010, 07:57:06 »

ast89

a dokładniej możesz bo nie chce czegoś usunac ponad ;) bo raz mi sie tak udało ;) hehe
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #5 dnia: Kwiecień 14, 2010, 10:58:34 »

hmmm jeszcze jedno ;)

pokazuje mi się takie coś kiedy staram się dodać torrenta a kod mam poprawny

Upload failed!

invalid announce url! must be http://animedna.cal.pl/announce.php


http://animedna.cal.pl/
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #6 dnia: Kwiecień 15, 2010, 10:56:48 »

W .torrent masz zly adres trackera. Zrob torka z poprawnym url.
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #7 dnia: Kwiecień 15, 2010, 07:18:43 »

Oki dzieki za porade zmieniłem i odrazu chciało sie dodac ale pokazało mi się teraz coś takiego

Warning:   move_uploaded_file(/domains/animedna.cal.pl/public_html/torrents/1.torrent)  [function.move-uploaded-file]:  failed to open stream: No such file or directory in /home/bogumil/domains/animedna.cal.pl/public_html/takeupload.php  on line 172
 
 Warning:  move_uploaded_file() [function.move-uploaded-file]:  Unable to move '/tmp/phpI0yYYI' to  '/domains/animedna.cal.pl/public_html/torrents/1.torrent' in /home/bogumil/domains/animedna.cal.pl/public_html/takeupload.php  on line 172
 
 Warning:  Cannot modify header information - headers already sent  by (output started at  /home/bogumil/domains/animedna.cal.pl/public_html/takeupload.php:172) in  /home/bogumil/domains/animedna.cal.pl/public_html/takeupload.php  on line 266
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #8 dnia: Kwiecień 15, 2010, 09:02:42 »

Pokaż mi takeupload.php
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #9 dnia: Kwiecień 15, 2010, 10:53:09 »

<?

require_once("include/benc.php");
require_once("include/bittorrent.php");

ini_set("upload_max_filesize",$max_torrent_size);

function bark($msg) {
    genbark($msg, "Upload failed!");
}

dbconn();

loggedinorreturn();

if (get_user_class() < UC_UPLOADER)
  die;

foreach(explode(":","descr:type:name") as $v) {
    if (!isset($_POST[$v]))
        bark("missing form data");
}

if (!isset($_FILES["file"]))
    bark("missing form data");

$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
    bark("Empty filename!");
   
$nfofile = $_FILES['nfo'];
if ($nfofile['name'] == '')
  bark("No NFO!");

if ($nfofile['size'] == 0)
  bark("0-byte NFO");

if ($nfofile['size'] > 65535)
  bark("NFO is too big! Max 65,535 bytes.");

$nfofilename = $nfofile['tmp_name'];

if (@!is_uploaded_file($nfofilename))
  bark("NFO upload failed");

$descr = unesc($_POST["descr"]);
if (!$descr)
  bark("You must enter a description!");

$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid))
    bark("You must select a category to put the torrent in!");
   
if (!validfilename($fname))
    bark("Invalid filename!");
if (!preg_match('/^(.+).torrent$/si', $fname, $matches))
    bark("Invalid filename (not a .torrent).");
$shortfname = $torrent = $matches[1];
if (!empty($_POST["name"]))
    $torrent = unesc($_POST["name"]);

$tmpname = $f["tmp_name"];
if (!is_uploaded_file($tmpname))
    bark("eek");
if (!filesize($tmpname))
    bark("Empty file!");

$dict = bdec_file($tmpname, $max_torrent_size);
if (!isset($dict))
    bark("What the hell did you upload? This is not a bencoded file!");

function dict_check($d, $s) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $a = explode(":", $s);
    $dd = $d["value"];
    $ret = array();
    foreach ($a as $k) {
        unset($t);
        if (preg_match('/^(.*)((.*))$/', $k, $m)) {
            $k = $m[1];
            $t = $m[2];
        }
        if (!isset($dd[$k]))
            bark("dictionary is missing key(s)");
        if (isset($t)) {
            if ($dd[$k]["type"] != $t)
                bark("invalid entry in dictionary");
            $ret[] = $dd[$k]["value"];
        }
        else
            $ret[] = $dd[$k];
    }
    return $ret;
}

function dict_get($d, $k, $t) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $dd = $d["value"];
    if (!isset($dd[$k]))
        return;
    $v = $dd[$k];
    if ($v["type"] != $t)
        bark("invalid dictionary entry type");
    return $v["value"];
}

list($ann, $info) = dict_check($dict, "announce(string):info");
list($dname, $plen, $pieces) = dict_check($info, "name(string):piece length(integer):pieces(string)");

if (!in_array($ann, $announce_urls, 1))
    bark("invalid announce url! must be " . $announce_urls . "");
if (strlen($pieces) % 20 != 0)
    bark("invalid pieces");

$filelist = array();
$totallen = dict_get($info, "length", "integer");
if (isset($totallen)) {
    $filelist[] = array($dname, $totallen);
    $type = "single";
}
else {
    $flist = dict_get($info, "files", "list");
    if (!isset($flist))
        bark("missing both length and files");
    if (!count($flist))
        bark("no files");
    $totallen = 0;
    foreach ($flist as $fn) {
        list($ll, $ff) = dict_check($fn, "length(integer):path(list)");
        $totallen += $ll;
        $ffa = array();
        foreach ($ff as $ffe) {
            if ($ffe["type"] != "string")
                bark("filename error");
            $ffa[] = $ffe["value"];
        }
        if (!count($ffa))
            bark("filename error");
        $ffe = implode("/", $ffa);
        $filelist[] = array($ffe, $ll);
    }
    $type = "multi";
}

$infohash = pack("H*", sha1($info["string"]));


// Replace punctuation characters with spaces

$torrent = str_replace("_", " ", $torrent);

$nfo = sqlesc(str_replace("  ", " ", @file_get_contents($nfofilename)));
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" .
        implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no", $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) .
        ", '" . get_date_time() . "', '" . get_date_time() . "', $nfo)");
if (!$ret) {
    if (mysql_errno() == 1062)
        bark("torrent already uploaded!");
    bark("mysql puked: ".mysql_error());
}
$id = mysql_insert_id();

@mysql_query("DELETE FROM files WHERE torrent = $id");
foreach ($filelist as $file) {
    @mysql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
}

move_uploaded_file($tmpname, "$torrent_dir/$id.torrent");

write_log("Torrent $id ($torrent) was uploaded by " . $CURUSER["username"]);



/* RSS feeds */

if (($fd1 = @fopen("rss.xml", "w")) && ($fd2 = fopen("rssdd.xml", "w")))
{
    $cats = "";
    $res = mysql_query("SELECT id, name FROM categories");
    while ($arr = mysql_fetch_assoc($res))
        $cats[$arr["id"]] = $arr["name"];
    $s = "<?xml version="1.0" encoding="iso-8859-1" ?> <rss version="0.91"> <channel> " .
        "<title>TorrentBits</title> <description>0-week torrents</description> <link>$DEFAULTBASEURL/</link> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    $r = mysql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);
    while ($a = mysql_fetch_assoc($r))
    {
        $cat = $cats[$a["category"]];
        $s = "<item> <title>" . htmlspecialchars($a["name"] . " ($cat)") . "</title> " .
            "<description>" . htmlspecialchars($a["descr"]) . "</description> ";
        @fwrite($fd1, $s);
        @fwrite($fd2, $s);
        @fwrite($fd1, "<link>$DEFAULTBASEURL/details.php?id=$a[id]&amp;hit=1</link> </item> ");
        $filename = htmlspecialchars($a["filename"]);
        @fwrite($fd2, "<link>$DEFAULTBASEURL/download.php/$a[id]/$filename</link> </item> ");
    }
    $s = "</channel> </rss> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    @fclose($fd1);
    @fclose($fd2);
}

/* Email notifs */
/*******************

$res = mysql_query("SELECT name FROM categories WHERE id=$catid") or sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$res = mysql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") or sqlerr();
$uploader = $CURUSER['username'];

$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);

$body = <<<EOD
A new torrent has been uploaded.

Name: $torrent
Size: $size
Category: $cat
Uploaded by: $uploader

Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------

You can use the URL below to download the torrent (you may have to login).

$DEFAULTBASEURL/details.php?id=$id&hit=1

--
$SITENAME
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysql_num_rows($res);
while ($arr = mysql_fetch_row($res))
{
  if ($nthis == 0)
    $to = $arr[0];
  else
    $to .= "," . $arr[0];
  ++$nthis;
  ++$ntotal;
  if ($nthis == $nmax || $ntotal == $total)
  {
    if (!mail("Multiple recipients <$SITEEMAIL>", "New torrent - $torrent", $body,
    "From: $SITEEMAIL Bcc: $to", "-f$SITEEMAIL"))
      stderr("Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE! " .
        "There was however a problem delivering the e-mail notifcations. " .
        "Please let an administrator know about this error! ");
    $nthis = 0;
  }
}
*******************/

header("Location: $BASEURL/details.php?id=$id&uploaded=1");

?>
« Ostatnia zmiana: Kwiecień 16, 2010, 10:29:19 wysłana przez Sheol »
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #10 dnia: Kwiecień 16, 2010, 04:59:16 »

Maileś maly bląd.

Sprawdz teraz.
Rownież sprawdz czy folder tak gdzie zapisuja sie torki ma chmod 777 i czy $torrent_dir = ten folder w ktorym maja znajdowac sie torki

<?

require_once("include/benc.php");
require_once("include/bittorrent.php");

ini_set("upload_max_filesize",$max_torrent_size);

function bark($msg) {
    genbark($msg, "Upload failed!");
}

dbconn();

loggedinorreturn();

if (get_user_class() < UC_UPLOADER)
  die;

foreach(explode(":","descr:type:name") as $v) {
    if (!isset($_POST[$v]))
        bark("missing form data");
}

if (!isset($_FILES["file"]))
    bark("missing form data");

$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
    bark("Empty filename!");
   
$nfofile = $_FILES['nfo'];
if ($nfofile['name'] == '')
  bark("No NFO!");

if ($nfofile['size'] == 0)
  bark("0-byte NFO");

if ($nfofile['size'] > 65535)
  bark("NFO is too big! Max 65,535 bytes.");

$nfofilename = $nfofile['tmp_name'];

if (@!is_uploaded_file($nfofilename))
  bark("NFO upload failed");

$descr = unesc($_POST["descr"]);
if (!$descr)
  bark("You must enter a description!");

$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid))
    bark("You must select a category to put the torrent in!");
   
if (!validfilename($fname))
    bark("Invalid filename!");
if (!preg_match('/^(.+).torrent$/si', $fname, $matches))
    bark("Invalid filename (not a .torrent).");
$shortfname = $torrent = $matches[1];
if (!empty($_POST["name"]))
    $torrent = unesc($_POST["name"]);

$tmpname = $f["tmp_name"];
if (!is_uploaded_file($tmpname))
    bark("eek");
if (!filesize($tmpname))
    bark("Empty file!");

$dict = bdec_file($tmpname, $max_torrent_size);
if (!isset($dict))
    bark("What the hell did you upload? This is not a bencoded file!");

function dict_check($d, $s) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $a = explode(":", $s);
    $dd = $d["value"];
    $ret = array();
    foreach ($a as $k) {
        unset($t);
        if (preg_match('/^(.*)((.*))$/', $k, $m)) {
            $k = $m[1];
            $t = $m[2];
        }
        if (!isset($dd[$k]))
            bark("dictionary is missing key(s)");
        if (isset($t)) {
            if ($dd[$k]["type"] != $t)
                bark("invalid entry in dictionary");
            $ret[] = $dd[$k]["value"];
        }
        else
            $ret[] = $dd[$k];
    }
    return $ret;
}

function dict_get($d, $k, $t) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $dd = $d["value"];
    if (!isset($dd[$k]))
        return;
    $v = $dd[$k];
    if ($v["type"] != $t)
        bark("invalid dictionary entry type");
    return $v["value"];
}

list($ann, $info) = dict_check($dict, "announce(string):info");
list($dname, $plen, $pieces) = dict_check($info, "name(string):piece length(integer):pieces(string)");

if (!in_array($ann, $announce_urls, 1))
    bark("invalid announce url! must be " . $announce_urls . "");
if (strlen($pieces) % 20 != 0)
    bark("invalid pieces");

$filelist = array();
$totallen = dict_get($info, "length", "integer");
if (isset($totallen)) {
    $filelist[] = array($dname, $totallen);
    $type = "single";
}
else {
    $flist = dict_get($info, "files", "list");
    if (!isset($flist))
        bark("missing both length and files");
    if (!count($flist))
        bark("no files");
    $totallen = 0;
    foreach ($flist as $fn) {
        list($ll, $ff) = dict_check($fn, "length(integer):path(list)");
        $totallen += $ll;
        $ffa = array();
        foreach ($ff as $ffe) {
            if ($ffe["type"] != "string")
                bark("filename error");
            $ffa[] = $ffe["value"];
        }
        if (!count($ffa))
            bark("filename error");
        $ffe = implode("/", $ffa);
        $filelist[] = array($ffe, $ll);
    }
    $type = "multi";
}

$infohash = pack("H*", sha1($info["string"]));


// Replace punctuation characters with spaces

$torrent = str_replace("_", " ", $torrent);

$nfo = sqlesc(str_replace("  ", " ", @file_get_contents($nfofilename)));
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" .
        implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no", $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) .
        ", '" . get_date_time() . "', '" . get_date_time() . "', $nfo)");
if (!$ret) {
    if (mysql_errno() == 1062)
        bark("torrent already uploaded!");
    bark("mysql puked: ".mysql_error());
}
$id = mysql_insert_id();

@mysql_query("DELETE FROM files WHERE torrent = $id");
foreach ($filelist as $file) {
    @mysql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
}

move_uploaded_file($tmpname, "$torrent_dir/$id.torrent");

write_log("Torrent $id ($torrent) was uploaded by " . $CURUSER["username"]);



/* RSS feeds */

if (($fd1 = @fopen("rss.xml", "w")) && ($fd2 = fopen("rssdd.xml", "w")))
{
    $cats = "";
    $res = mysql_query("SELECT id, name FROM categories");
    while ($arr = mysql_fetch_assoc($res))
        $cats[$arr["id"]] = $arr["name"];
    $s = "<?xml version="1.0" encoding="iso-8859-1" <rss version="0.91"> <channel> " .
        "<title>TorrentBits</title> <description>0-week torrents</description> <link>$DEFAULTBASEURL/</link> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    $r = mysql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);
    while ($a = mysql_fetch_assoc($r))
    {
        $cat = $cats[$a["category"]];
        $s = "<item> <title>" . htmlspecialchars($a["name"] . " ($cat)") . "</title> " .
            "<description>" . htmlspecialchars($a["descr"]) . "</description> ";
        @fwrite($fd1, $s);
        @fwrite($fd2, $s);
        @fwrite($fd1, "<link>$DEFAULTBASEURL/details.php?id=$a[id]&amp;hit=1</link> </item> ");
        $filename = htmlspecialchars($a["filename"]);
        @fwrite($fd2, "<link>$DEFAULTBASEURL/download.php/$a[id]/$filename</link> </item> ");
    }
    $s = "</channel> </rss> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    @fclose($fd1);
    @fclose($fd2);
}

/* Email notifs */
/*******************

$res = mysql_query("SELECT name FROM categories WHERE id=$catid") or sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$res = mysql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") or sqlerr();
$uploader = $CURUSER['username'];

$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);

$body = <<<EOD
A new torrent has been uploaded.

Name: $torrent
Size: $size
Category: $cat
Uploaded by: $uploader

Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------

You can use the URL below to download the torrent (you may have to login).

$DEFAULTBASEURL/details.php?id=$id&hit=1

--
$SITENAME
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysql_num_rows($res);
while ($arr = mysql_fetch_row($res))
{
  if ($nthis == 0)
    $to = $arr[0];
  else
    $to .= "," . $arr[0];
  ++$nthis;
  ++$ntotal;
  if ($nthis == $nmax || $ntotal == $total)
  {
    if (!mail("Multiple recipients <$SITEEMAIL>", "New torrent - $torrent", $body,
    "From: $SITEEMAIL Bcc: $to", "-f$SITEEMAIL"))
      stderr("Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE! " .
        "There was however a problem delivering the e-mail notifcations. " .
        "Please let an administrator know about this error! ");
    $nthis = 0;
  }
}
*******************/

header("Location: $BASEURL/details.php?id=$id&uploaded=1");

?>
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #11 dnia: Kwiecień 16, 2010, 08:13:57 »

hmm nadal nie tyka teraz mam takie cos

Parse error:  syntax error, unexpected T_DNUMBER in /home/bogumil/domains/animedna.cal.pl/public_html/takeupload.php  on line 185

i takie cos ;)

Fatal error:  Cannot redeclare local_user() (previously declared  in  /home/bogumil/domains/animedna.cal.pl/public_html/include/bittorrent.php:5)  in /home/bogumil/domains/animedna.cal.pl/public_html/bittorrent.php  on line 6
« Ostatnia zmiana: Kwiecień 16, 2010, 08:27:00 wysłana przez bogumił »
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #12 dnia: Kwiecień 16, 2010, 08:27:57 »

<?

require_once("include/benc.php");
require_once("include/bittorrent.php");

ini_set("upload_max_filesize",$max_torrent_size);

function bark($msg) {
    genbark($msg, "Upload failed!");
}

dbconn();

loggedinorreturn();

if (get_user_class() < UC_UPLOADER)
  die;

foreach(explode(":","descr:type:name") as $v) {
    if (!isset($_POST[$v]))
        bark("missing form data");
}

if (!isset($_FILES["file"]))
    bark("missing form data");

$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
    bark("Empty filename!");
   
$nfofile = $_FILES['nfo'];
if ($nfofile['name'] == '')
  bark("No NFO!");

if ($nfofile['size'] == 0)
  bark("0-byte NFO");

if ($nfofile['size'] > 65535)
  bark("NFO is too big! Max 65,535 bytes.");

$nfofilename = $nfofile['tmp_name'];

if (@!is_uploaded_file($nfofilename))
  bark("NFO upload failed");

$descr = unesc($_POST["descr"]);
if (!$descr)
  bark("You must enter a description!");

$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid))
    bark("You must select a category to put the torrent in!");
   
if (!validfilename($fname))
    bark("Invalid filename!");
if (!preg_match('/^(.+).torrent$/si', $fname, $matches))
    bark("Invalid filename (not a .torrent).");
$shortfname = $torrent = $matches[1];
if (!empty($_POST["name"]))
    $torrent = unesc($_POST["name"]);

$tmpname = $f["tmp_name"];
if (!is_uploaded_file($tmpname))
    bark("eek");
if (!filesize($tmpname))
    bark("Empty file!");

$dict = bdec_file($tmpname, $max_torrent_size);
if (!isset($dict))
    bark("What the hell did you upload? This is not a bencoded file!");

function dict_check($d, $s) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $a = explode(":", $s);
    $dd = $d["value"];
    $ret = array();
    foreach ($a as $k) {
        unset($t);
        if (preg_match('/^(.*)((.*))$/', $k, $m)) {
            $k = $m[1];
            $t = $m[2];
        }
        if (!isset($dd[$k]))
            bark("dictionary is missing key(s)");
        if (isset($t)) {
            if ($dd[$k]["type"] != $t)
                bark("invalid entry in dictionary");
            $ret[] = $dd[$k]["value"];
        }
        else
            $ret[] = $dd[$k];
    }
    return $ret;
}

function dict_get($d, $k, $t) {
    if ($d["type"] != "dictionary")
        bark("not a dictionary");
    $dd = $d["value"];
    if (!isset($dd[$k]))
        return;
    $v = $dd[$k];
    if ($v["type"] != $t)
        bark("invalid dictionary entry type");
    return $v["value"];
}

list($ann, $info) = dict_check($dict, "announce(string):info");
list($dname, $plen, $pieces) = dict_check($info, "name(string):piece length(integer):pieces(string)");

if (!in_array($ann, $announce_urls, 1))
    bark("invalid announce url! must be " . $announce_urls . "");
if (strlen($pieces) % 20 != 0)
    bark("invalid pieces");

$filelist = array();
$totallen = dict_get($info, "length", "integer");
if (isset($totallen)) {
    $filelist[] = array($dname, $totallen);
    $type = "single";
}
else {
    $flist = dict_get($info, "files", "list");
    if (!isset($flist))
        bark("missing both length and files");
    if (!count($flist))
        bark("no files");
    $totallen = 0;
    foreach ($flist as $fn) {
        list($ll, $ff) = dict_check($fn, "length(integer):path(list)");
        $totallen += $ll;
        $ffa = array();
        foreach ($ff as $ffe) {
            if ($ffe["type"] != "string")
                bark("filename error");
            $ffa[] = $ffe["value"];
        }
        if (!count($ffa))
            bark("filename error");
        $ffe = implode("/", $ffa);
        $filelist[] = array($ffe, $ll);
    }
    $type = "multi";
}

$infohash = pack("H*", sha1($info["string"]));


// Replace punctuation characters with spaces

$torrent = str_replace("_", " ", $torrent);

$nfo = sqlesc(str_replace("  ", " ", @file_get_contents($nfofilename)));
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" .
        implode(",", array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname, $CURUSER["id"], "no", $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) .
        ", '" . get_date_time() . "', '" . get_date_time() . "', $nfo)");
if (!$ret) {
    if (mysql_errno() == 1062)
        bark("torrent already uploaded!");
    bark("mysql puked: ".mysql_error());
}
$id = mysql_insert_id();

@mysql_query("DELETE FROM files WHERE torrent = $id");
foreach ($filelist as $file) {
    @mysql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
}

move_uploaded_file($tmpname, "$torrent_dir/$id.torrent");

write_log("Torrent $id ($torrent) was uploaded by " . $CURUSER["username"]);



/* RSS feeds */

if (($fd1 = @fopen("rss.xml", "w")) && ($fd2 = fopen("rssdd.xml", "w")))
{
    $cats = "";
    $res = mysql_query("SELECT id, name FROM categories");
    while ($arr = mysql_fetch_assoc($res))
        $cats[$arr["id"]] = $arr["name"];
    $s = "<?xml version=/"1.0/" encoding=/"iso-8859-1/" <rss version=/"0.91/"> <channel> " .
        "<title>TorrentBits</title> <description>0-week torrents</description> <link>$DEFAULTBASEURL/</link> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    $r = mysql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);
    while ($a = mysql_fetch_assoc($r))
    {
        $cat = $cats[$a["category"]];
        $s = "<item> <title>" . htmlspecialchars($a["name"] . " ($cat)") . "</title> " .
            "<description>" . htmlspecialchars($a["descr"]) . "</description> ";
        @fwrite($fd1, $s);
        @fwrite($fd2, $s);
        @fwrite($fd1, "<link>$DEFAULTBASEURL/details.php?id=$a[id]&amp;hit=1</link> </item> ");
        $filename = htmlspecialchars($a["filename"]);
        @fwrite($fd2, "<link>$DEFAULTBASEURL/download.php/$a[id]/$filename</link> </item> ");
    }
    $s = "</channel> </rss> ";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    @fclose($fd1);
    @fclose($fd2);
}

/* Email notifs */
/*******************

$res = mysql_query("SELECT name FROM categories WHERE id=$catid") or sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$res = mysql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") or sqlerr();
$uploader = $CURUSER['username'];

$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);

$body = <<<EOD
A new torrent has been uploaded.

Name: $torrent
Size: $size
Category: $cat
Uploaded by: $uploader

Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------

You can use the URL below to download the torrent (you may have to login).

$DEFAULTBASEURL/details.php?id=$id&hit=1

--
$SITENAME
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysql_num_rows($res);
while ($arr = mysql_fetch_row($res))
{
  if ($nthis == 0)
    $to = $arr[0];
  else
    $to .= "," . $arr[0];
  ++$nthis;
  ++$ntotal;
  if ($nthis == $nmax || $ntotal == $total)
  {
    if (!mail("Multiple recipients <$SITEEMAIL>", "New torrent - $torrent", $body,
    "From: $SITEEMAIL Bcc: $to", "-f$SITEEMAIL"))
      stderr("Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE! " .
        "There was however a problem delivering the e-mail notifcations. " .
        "Please let an administrator know about this error! ");
    $nthis = 0;
  }
}
*******************/

header("Location: $BASEURL/details.php?id=$id&uploaded=1");

?>


Mocno dziurawy ten silnik masz, skad go brales?

Co masz w bittorrent.php  w lini 6? Najlepiej podaj od 1 do 10
 
Jeżeli korzystasz z secrets.php to zobacz czy nie masz dwa razy include w bitorrent.
« Ostatnia zmiana: Kwiecień 16, 2010, 08:35:08 wysłana przez maciej2 »
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #13 dnia: Kwiecień 16, 2010, 08:40:57 »

pobrałem go z tematu instal wersja angielska ;) wersja 01.03.06

bittorrent.php
<?

function local_user()
{
  return $_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"];
}
//$FUNDS = "$2,610.31";

$SITE_ONLINE = true;
//$SITE_ONLINE = local_user();
//$SITE_ONLINE = false;

$max_torrent_size = 1000000;
$announce_interval = 60 * 30;
$signup_timeout = 86400 * 3;
$minvotes = 1;
$max_dead_torrent_time = 6 * 3600;
Zapisane

maciej2

  • Średnio zaawansowany
  • ****
  • Reputacja 4
  • Offline Offline
  • Wiadomości: 71
Odp: Problem z stroną
« Odpowiedź #14 dnia: Kwiecień 16, 2010, 09:18:18 »

Funkcja:

function local_user()
{
  return $_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"];
}

powinna być niżej pod


if (!function_exists("stripos")) {
  function stripos($str,$needle,$offset=0)
  {
      return strpos(strtolower($str),strtolower($needle),$offset);
  }
}

jezeli tego nie masz daj pod

$mysql_host = "...";
$mysql_user = "...";
$mysql_pass = "...";
$mysql_db = "...";




Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #15 dnia: Kwiecień 16, 2010, 09:51:28 »

hmm nadal nie dział, i kod chciałęm wkleic do sprawdzenia ale nie chce mi go przyjąćhttp://www.sendspace.com/file/p43nnl ;) 
Zapisane

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #16 dnia: Maj 11, 2010, 08:33:30 »

Witajcie sorki ze nie odpisałem ale neta nie miałem dłuższy czas ;(

nadal nie działa wiec polska wersje postanowiłem zainstalować ;) tbsource-1.5.0-PL_wersja_finalna

ale mam pytanie jest tam plik squel co ma 27 kb a na moim servie tylko mogę upnac 8 kb jak to podzielić :? na mniejsze
Zapisane

Dawid

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 12
Odp: Problem z stroną
« Odpowiedź #17 dnia: Maj 11, 2010, 10:21:42 »

Chyba najprostszym sposobem będzie wczytanie bazy przez bigdump'a.

Tutaj masz wszystko opisane. http://webhosting.pl/BigDump.jak.przeniesc.duza.baze.danych   :salute:
Zapisane
Code TBDev. <3

P2P

  • BTDEV Staff
  • Super zaawansowany
  • *****
  • Reputacja 45
  • Online Online
  • Płeć: Mężczyzna
  • Wiadomości: 471
Odp: Problem z stroną
« Odpowiedź #18 dnia: Maj 11, 2010, 10:25:17 »

jaki masz serwer?? jezeli masz taką mozliwosc to sam mozesz zwiekszyc wage wgrywanego pliku ... nie widze tutaj problemu :) albo tak jak pisze Dawid ..
Zapisane
Brazylijscy naukowcy odkryli, że ludzie czytający posty i trzymający rękę na myszce mają niższe IQ

Już za późno nie zdejmujcie

bogumił

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 15
Odp: Problem z stroną
« Odpowiedź #19 dnia: Maj 11, 2010, 10:37:59 »

server mam od firmy cal.pl nawet nie wiem jak mam na nim zwiększyć
Zapisane
 

Strona wygenerowana w 0.386 sekund z 22 zapytaniami.