Polish Bittorrent Tracker Support

  • Maj 18, 2012, 03:33:52
  • Witamy, Gość
Zaloguj się lub zarejestruj.

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

Aktualności:

Strony: 1 ... 5 6 [7]   Do dołu

Autor Wątek: Hanne's shoutbox + poprawki  (Przeczytany 6817 razy)

0 użytkowników i 2 Gości przegląda ten wątek.

kiler12

  • Początkujący++
  • ***
  • Reputacja 3
  • Offline Offline
  • Wiadomości: 48
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #120 dnia: Lipiec 14, 2008, 12:32:56 »

Ja mam to w takeupload i wkleja mi się nowy torrent w sb ale jak coś pisze to mój nick się wkleja w nowy torrent a powinno być system
Zapisane

Eryk

  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Wiadomości: 143
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #121 dnia: Lipiec 14, 2008, 12:35:59 »

to co masz w takeupload zamień na

//shoutbox start
$a = mysql_query("SELECT torrents.name, torrents.owner, users.username FROM torrents LEFT JOIN users ON torrents.owner = users.id ORDER BY torrents.added DESC LIMIT 1") or sqlerr(__FILE__, __LINE__);
$as = mysql_fetch_array($a);
   $text = "[b]Nowy torrent:[/b] [url=details.php?id=$id&hit=1]" . htmlspecialchars($as["name"]) . "[/url]  Zapraszamy do pobierania! ";
//$text = "[b]Nowy torrent:[/b] [url=$BASEURL/details.php?id=$id][b]" . htmlspecialchars($as["name"]) . "[/b][/url] wstawiony przez " . htmlspecialchars($usr) . "";
$date=time();
mysql_query("INSERT INTO shoutbox (msgid, user, userid, date, message) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
//shoutbox end


powinno działać.
Zapisane

kiler12

  • Początkujący++
  • ***
  • Reputacja 3
  • Offline Offline
  • Wiadomości: 48
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #122 dnia: Lipiec 14, 2008, 12:43:55 »

Ten nie pokazuje nic na sb a dodałem go pod koniec

takeupload

<?

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

ini_set("upload_max_filesize",$max_torrent_size);
$max_public_torrent_size = 800*1024*1024;

function bark($msg) {
genbark($msg, "Wysyłanie nieudane!");
}

dbconn();

loggedinorreturn();

/*if (get_user_class() < UC_USER)
  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($_POST['poster']))
$poster = unesc($_POST['poster']);

if (!empty($_POST['youtube']))
$youtube = unesc($_POST['youtube']);

if (empty($fname))
bark("Musisz wypełnić pole: Nazwa torrenta i plik torrent!");



 

$nfofilename = $nfofile['tmp_name'];



$descr = unesc($_POST["descr"]);
if (!$descr)
  bark("Brak opisu torrenta!");

$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid))
bark("Musisz wybrać kategorie do jakiej twój torrent będzie należał!");

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("Błędny adres announce poprawny wygląda następująco: " . $announce_urls[0] . "");

if (isset($dict['value']['announce-list']))
bark("Multi-tracker torrents are NOT allowed!");
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";
}
$info['value']['source']['type'] = "string";
$info['value']['source']['value'] = $SITENAME;
$info['value']['source']['strlen'] = strlen($info['value']['source']['value']);
$info['value']['private']['type'] = "integer";
$info['value']['private']['value'] = 1;
$dict['value']['info'] = $info;
$dict = benc($dict);
$dict = bdec($dict);
list($ann, $info) = dict_check($dict, "announce(string):info");

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


// Replace punctuation characters with spaces
if (($totallen > $max_public_torrent_size) && (get_user_class() < UC_USER))
{
stderr('Bląd - Maksymalny rozmiar torrenta dla rangiu User, Power User to 800 MB','Aby wrzucic tego torrenta, musisz mieć rangę Uploadera<br/><br/>Jeśli koniecznie chcesz wrzucić tego torrenta, <a href="upform.php">zgłoś się na Uploadera</a>.');
}

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

$pub = (get_user_class()<UC_USER) ? 'yes' : 'no';

$nfo = sqlesc(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @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, poster ,youtube) 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, '".$poster."', '".$youtube."')");
if (!$ret) {
if (mysql_errno() == 1062)
bark("torrent o podanym pliku, już istnieje!");
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");

if (isset($_POST['offer'])) {
if ($_POST['offer'] > 0) {
/* PN for voted user */
$res = mysql_query("SELECT `userid` FROM `offervotes` WHERE `offerid` = ". ($_POST['offer'] + 0)) or sqlerr(__FILE__, __LINE__);
$pn_msg = "Torrent \"$torrent\" został uploadowany przez " . $CURUSER["username"] . ".\nMożesz pobrać tego torrenta [url=$DEFAULTBASEURL/details.php?id=$id&amp;hit=1]tu[/url]";
while($row = mysql_fetch_assoc($res)) {
 mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, $row[userid], '" . get_date_time() . "', " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
}

/* offer delete */
@mysql_query("DELETE FROM `offers` WHERE `id` = ". ($_POST['offer'] + 0));
@mysql_query("DELETE FROM `offervotes` WHERE `offerid` = ". ($_POST['offer'] + 0));
@mysql_query("DELETE FROM `comments` WHERE `offer` = ". ($_POST['offer'] + 0). " AND `torrent` = 0");
}
}

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-2\" ?>\n<rss version=\"0.91\">\n<channel>\n" .
"<title>TorrentBits</title>\n<description>0-week torrents</description>\n<link>$DEFAULTBASEURL/</link>\n";
@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>\n<title>" . htmlspecialchars($a["name"] . " ($cat)") . "</title>\n" .
"<description>" . htmlspecialchars($a["descr"]) . "</description>\n";
@fwrite($fd1, $s);
@fwrite($fd2, $s);
@fwrite($fd1, "<link>$DEFAULTBASEURL/details.php?id=$a[id]&amp;hit=1</link>\n</item>\n");
$filename = htmlspecialchars($a["filename"]);
@fwrite($fd2, "<link>$DEFAULTBASEURL/download.php/$a[id]/$filename</link>\n</item>\n");
}
$s = "</channel>\n</rss>\n";
@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\r\nBcc: $to", "-f$SITEEMAIL"))
  stderr("Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE!\n" .
    "There was however a problem delivering the e-mail notifcations.\n" .
    "Please let an administrator know about this error!\n");
    $nthis = 0;
  }
}








*******************/
$fp = fopen("$torrent_dir/$id.torrent", "w");
if ($fp)
{
@fwrite($fp, benc($dict), strlen(benc($dict)));
fclose($fp);
}
header("Location: $BASEURL/details.php?id=".htmlspecialchars($id)."&uploaded=1");


//shoutbox start
$a = mysql_query("SELECT torrents.name, torrents.owner, users.username FROM torrents LEFT JOIN users ON torrents.owner = users.id ORDER BY torrents.added DESC LIMIT 1") or sqlerr(__FILE__, __LINE__);
$as = mysql_fetch_array($a);
   $text = "[b]Nowy torrent:[/b] [url=details.php?id=$id&hit=1]" . htmlspecialchars($as["name"]) . "[/url]  Zapraszamy do pobierania! ";
//$text = "[b]Nowy torrent:[/b] [url=$BASEURL/details.php?id=$id][b]" . htmlspecialchars($as["name"]) . "[/b][/url] wstawiony przez " . htmlspecialchars($usr) . "";
$date=time();
mysql_query("INSERT INTO shoutbox (msgid, user, userid, date, message) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
//shoutbox end

?>

Zapisane

Eryk

  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Wiadomości: 143
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #123 dnia: Lipiec 14, 2008, 12:57:13 »

<?

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

ini_set("upload_max_filesize",$max_torrent_size);
$max_public_torrent_size = 800*1024*1024;

function bark($msg) {
genbark($msg, "Wysyłanie nieudane!");
}

dbconn();

loggedinorreturn();

/*if (get_user_class() < UC_USER)
  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($_POST['poster']))
$poster = unesc($_POST['poster']);

if (!empty($_POST['youtube']))
$youtube = unesc($_POST['youtube']);

if (empty($fname))
bark("Musisz wypełnić pole: Nazwa torrenta i plik torrent!");



 

$nfofilename = $nfofile['tmp_name'];



$descr = unesc($_POST["descr"]);
if (!$descr)
  bark("Brak opisu torrenta!");

$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid))
bark("Musisz wybrać kategorie do jakiej twój torrent będzie należał!");

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("Błędny adres announce poprawny wygląda następująco: " . $announce_urls[0] . "");

if (isset($dict['value']['announce-list']))
bark("Multi-tracker torrents are NOT allowed!");
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";
}
$info['value']['source']['type'] = "string";
$info['value']['source']['value'] = $SITENAME;
$info['value']['source']['strlen'] = strlen($info['value']['source']['value']);
$info['value']['private']['type'] = "integer";
$info['value']['private']['value'] = 1;
$dict['value']['info'] = $info;
$dict = benc($dict);
$dict = bdec($dict);
list($ann, $info) = dict_check($dict, "announce(string):info");

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


// Replace punctuation characters with spaces
if (($totallen > $max_public_torrent_size) && (get_user_class() < UC_USER))
{
stderr('Bląd - Maksymalny rozmiar torrenta dla rangiu User, Power User to 800 MB','Aby wrzucic tego torrenta, musisz mieć rangę Uploadera<br/><br/>Jeśli koniecznie chcesz wrzucić tego torrenta, <a href="upform.php">zgłoś się na Uploadera</a>.');
}

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

$pub = (get_user_class()<UC_USER) ? 'yes' : 'no';

$nfo = sqlesc(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @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, poster ,youtube) 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, '".$poster."', '".$youtube."')");
if (!$ret) {
if (mysql_errno() == 1062)
bark("torrent o podanym pliku, już istnieje!");
bark("mysql puked: ".mysql_error());
}
$id = mysql_insert_id();

//shoutbox start
$a = mysql_query("SELECT torrents.name, torrents.owner, users.username FROM torrents LEFT JOIN users ON torrents.owner = users.id ORDER BY torrents.added DESC LIMIT 1") or sqlerr(__FILE__, __LINE__);
$as = mysql_fetch_array($a);
   $text = "[b]Nowy torrent:[/b] [url=$DEFAULTBASEURL/details.php?id=$id&hit=1]" . htmlspecialchars($as["name"]) . "[/url]  Zapraszamy do pobierania! ";
//$text = "[b]Nowy torrent:[/b] [url=$BASEURL/details.php?id=$id][b]" . htmlspecialchars($as["name"]) . "[/b][/url] wstawiony przez " . htmlspecialchars($usr) . "";
$date=time();
mysql_query("INSERT INTO shoutbox (msgid, user, userid, date, message) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
//shoutbox end

@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");

if (isset($_POST['offer'])) {
if ($_POST['offer'] > 0) {
/* PN for voted user */
$res = mysql_query("SELECT `userid` FROM `offervotes` WHERE `offerid` = ". ($_POST['offer'] + 0)) or sqlerr(__FILE__, __LINE__);
$pn_msg = "Torrent \"$torrent\" został uploadowany przez " . $CURUSER["username"] . ".\nMożesz pobrać tego torrenta [url=$DEFAULTBASEURL/details.php?id=$id&amp;hit=1]tu[/url]";
while($row = mysql_fetch_assoc($res)) {
 mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, $row[userid], '" . get_date_time() . "', " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
}

/* offer delete */
@mysql_query("DELETE FROM `offers` WHERE `id` = ". ($_POST['offer'] + 0));
@mysql_query("DELETE FROM `offervotes` WHERE `offerid` = ". ($_POST['offer'] + 0));
@mysql_query("DELETE FROM `comments` WHERE `offer` = ". ($_POST['offer'] + 0). " AND `torrent` = 0");
}
}

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-2\" ?>\n<rss version=\"0.91\">\n<channel>\n" .
"<title>TorrentBits</title>\n<description>0-week torrents</description>\n<link>$DEFAULTBASEURL/</link>\n";
@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>\n<title>" . htmlspecialchars($a["name"] . " ($cat)") . "</title>\n" .
"<description>" . htmlspecialchars($a["descr"]) . "</description>\n";
@fwrite($fd1, $s);
@fwrite($fd2, $s);
@fwrite($fd1, "<link>$DEFAULTBASEURL/details.php?id=$a[id]&amp;hit=1</link>\n</item>\n");
$filename = htmlspecialchars($a["filename"]);
@fwrite($fd2, "<link>$DEFAULTBASEURL/download.php/$a[id]/$filename</link>\n</item>\n");
}
$s = "</channel>\n</rss>\n";
@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\r\nBcc: $to", "-f$SITEEMAIL"))
  stderr("Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE!\n" .
    "There was however a problem delivering the e-mail notifcations.\n" .
    "Please let an administrator know about this error!\n");
    $nthis = 0;
  }
}








*******************/
$fp = fopen("$torrent_dir/$id.torrent", "w");
if ($fp)
{
@fwrite($fp, benc($dict), strlen(benc($dict)));
fclose($fp);
}
header("Location: $BASEURL/details.php?id=".htmlspecialchars($id)."&uploaded=1");


?>

Zobacz czy chodzi jak nie to napisz i zrobię inaczej
« Ostatnia zmiana: Lipiec 14, 2008, 12:58:48 wysłana przez Eryk »
Zapisane

kiler12

  • Początkujący++
  • ***
  • Reputacja 3
  • Offline Offline
  • Wiadomości: 48
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #124 dnia: Lipiec 14, 2008, 12:59:45 »

SQL Error
Unknown column 'msgid' in 'field list'

in /home/torrentm/public_html/takeupload.php, line 218

Teraz błąd przy dodaniu torrent
Zapisane

Eryk

  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Wiadomości: 143
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #125 dnia: Lipiec 14, 2008, 01:07:39 »

tamto zamień na:

//shoutbox start
$a = mysql_query("SELECT torrents.name, torrents.owner, users.username FROM torrents LEFT JOIN users ON torrents.owner = users.id ORDER BY torrents.added DESC LIMIT 1") or sqlerr(__FILE__, __LINE__);
$as = mysql_fetch_array($a);
   $text = "[b]Nowy torrent:[/b] [url=$DEFAULTBASEURL/details.php?id=$id&hit=1]" . htmlspecialchars($as["name"]) . "[/url]  Zapraszamy do pobierania! ";
//$text = "[b]Nowy torrent:[/b] [url=$BASEURL/details.php?id=$id][b]" . htmlspecialchars($as["name"]) . "[/b][/url] wstawiony przez " . htmlspecialchars($usr) . "";
$date=time();
mysql_query("INSERT INTO shoutbox (id, username, userid, date, text) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
//shoutbox end

wgrałem to sb na testowa stronę i u mnie chodzi napisz jak będzie działać
« Ostatnia zmiana: Lipiec 14, 2008, 01:15:53 wysłana przez Eryk »
Zapisane

kiler12

  • Początkujący++
  • ***
  • Reputacja 3
  • Offline Offline
  • Wiadomości: 48
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #126 dnia: Lipiec 14, 2008, 01:15:19 »

Teraz chodzi ale jak ktoś napisze na SB to się wkleja jego nick w nowy torrent jak to zrobić by to pokazywało jako system   :wallbash:

« Ostatnia zmiana: Lipiec 14, 2008, 02:18:50 wysłana przez kiler12 »
Zapisane

kubal

  • Zaawansowany
  • *****
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 169
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #127 dnia: Lipiec 14, 2008, 01:26:30 »

też tak mam :(
Zapisane

executor

  • Średnio zaawansowany
  • ****
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 88
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #128 dnia: Lipiec 14, 2008, 08:24:26 »

Zamiast:
mysql_query("INSERT INTO shoutbox (id, username, userid, date, text) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
To:
mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ( 'id', 0, " . sqlesc($uploader) . ", $dt, $msg)") or sqlerr(__FILE__, __LINE__);
Zapisane
Ja tylko się bawię lol Na nauke za późno!

chillo

  • Gość
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #129 dnia: Wrzesień 10, 2008, 10:28:34 »

witam,

mam problem z SB
dla nowych wszystkich userów SB przypisuje ten sam ID a użytkownicy starci nie maja tego problemu czy ktoś wie co to moze byc. W bazie zapisuje wszystkim nowym userom to zamo id w sb.

Zapisane

null

  • Super zaawansowany
  • ******
  • Reputacja 40
  • Offline Offline
  • Wiadomości: 1679
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #130 dnia: Wrzesień 11, 2008, 07:54:46 »

Zmien typ pola id na wiekszy (np INT(11))
Zapisane
NullPointerException. chantico podejście drugie. Faza projektowania.

chillo

  • Gość
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #131 dnia: Wrzesień 11, 2008, 10:35:15 »

Zmien typ pola id na wiekszy (np INT(11))

Dzięki pomogło  :yo:
Zapisane

Digress

  • Użytkownik
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 4
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #132 dnia: Grudzień 01, 2008, 05:20:27 »

Mam taki kłopot z Sb



Jak sie robi legende na Stronie głównej taka?
?

Jak na zdjęciach gdzie moge zrobic taka legende ? jaki to kod , nie widać w Sb NIku osoby co pisze.
i koloru donora warna itp
Zapisane

Julcia

  • Zaawansowany
  • *****
  • Reputacja 1
  • Offline Offline
  • Płeć: Kobieta
  • Wiadomości: 116
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #133 dnia: Grudzień 01, 2008, 05:27:22 »

1. przeczytaj kurs http://www.kurshtml.boo.pl/ !!
2. Bez pliku nie pomogę... (którą wersje pliku wziąłeś.?)
Zapisane

Digress

  • Użytkownik
  • Reputacja 0
  • Offline Offline
  • Wiadomości: 4
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #134 dnia: Grudzień 01, 2008, 06:02:39 »

Zapisane

tuno12

  • Coder
  • Super zaawansowany
  • ******
  • Reputacja 19
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 860
  • Krytyk i Tester
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #135 dnia: Grudzień 01, 2008, 09:22:53 »

ee żartujesz sobie? dodajesz w indexie tabelke i napisy odpowiednimi kolorami :) obojętnie jaki sb
Zapisane




Nawet nie próbuj pisać na PW etc.

Julcia

  • Zaawansowany
  • *****
  • Reputacja 1
  • Offline Offline
  • Płeć: Kobieta
  • Wiadomości: 116
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #136 dnia: Grudzień 01, 2008, 09:36:48 »

wgraj se ten plik http://btdev.torrentinvite.orgindex.php//topic,1715.msg10231.html#msg10231 to Ci wszystko będzie działać... gdybyś czytał cały temat to byś wiedział że ten plik który bierzesz nie do końca działa...
Zapisane

kalwin

  • <? print(" ?>
  • VIP
  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 183
  • ReactionTorrent.net
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #137 dnia: Grudzień 23, 2011, 10:02:33 »

if ($arr['userid'] != $CURUSER['id'])
$pm = "[<a class=altlink target=_blank href=sendmessage.php?receiver=$rowowner[id]>pw</a>]\n";
else
$pm = "";

cos mnie te PM nie działa if (get_user_class() >= UC_MODERATOR) {
$del="[<a href=/shoutbox.php?del=".$arr[id].">D</a>]";
}
else if ($arr['userid'] == $CURUSER['id']){
$del="[<a href=/shoutbox.php?del=".$arr[id].">D</a>]";
}
else
$del="";
zrobiłem podobnie pod tan kod ale tez nie działa mam dodac jakies funkcje ?
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #138 dnia: Grudzień 23, 2011, 12:49:04 »

w shoutbox.php

znajdź:
if (get_user_class() >= UC_MODERATOR) {
$edit="[<a href=/shoutbox.php?edit=".$arr[id].">E[/url]]";
}
else if ($arr['userid'] == $CURUSER['id']){
$edit="[<a href=/shoutbox.php?edit=".$arr[id].">E[/url]]";
}
else
$edit="";

pod tym dodaj to:

if ($arr['userid'] != $CURUSER['id'])
$pm = "[<a class=altlink target=_blank href='sendmessage.php?receiver=".$arr["userid"]."'>pw[/url]]\n";
else
$pm = "";

znajdź :

print("<tr><td><font color=gray>[<span class='date'>".strftime("%d.%m %H:%M",$arr["date"])."]</font>
$del
$edit

po tym dodaj to :

$pm
i działa kalwin
Zapisane
ReactionTorrent.net

kalwin

  • <? print(" ?>
  • VIP
  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 183
  • ReactionTorrent.net
Odp: Hanne's shoutbox + poprawki
« Odpowiedź #139 dnia: Grudzień 24, 2011, 11:52:05 »

petarda dziekuje damian działa działa :D
Zapisane
Strony: 1 ... 5 6 [7]   Do góry
 

Strona wygenerowana w 0.513 sekund z 21 zapytaniami.