The accents do not appear.
for example with the word: séries in the presentation of the stream is written s ries.
for me the trouble comes from takeupload file but I do not manage to adjust its I love that accent remains.
PHP Code:
<?php
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V4 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless,putyn. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php');
require_once (INCL_DIR . 'user_functions.php');
require_once (CLASS_DIR . 'page_verify.php');
require_once (CLASS_DIR . 'class.bencdec.php');
//require_once INCL_DIR . 'function_ircbot.php';
require_once INCL_DIR . 'function_memcache.php';
dbconn();
loggedinorreturn();
ini_set('upload_max_filesize', $INSTALLER09['max_torrent_size']);
ini_set('memory_limit', '64M');
//smth putyn
//print_r($_POST);
//print_r($_GET);
//exit();
$auth_key = array(
'2d257f64005d740db092a6b91170ab5f'
);
$gotkey = isset($_POST['key']) && strlen($_POST['key']) == 32 && in_array($_POST['key'], $auth_key) ? true : false;
$lang = array_merge(load_language('global') , load_language('takeupload'));
if (!$gotkey) {
$newpage = new page_verify();
$newpage->check('taud');
}
if ($CURUSER['class'] < UC_UPLOADER OR $CURUSER["uploadpos"] == 0 || $CURUSER["uploadpos"] > 1 || $CURUSER['suspended'] == 'yes') {
header("Location: {$INSTALLER09['baseurl']}/upload.php");
exit();
}
foreach (explode(":", "body:type:name") as $v) {
if (!isset($_POST[$v])) stderr($lang['takeupload_failed'], $lang['takeupload_no_formdata']);
}
if (!isset($_FILES["file"])) stderr($lang['takeupload_failed'], $lang['takeupload_no_formdata']);
$url = strip_tags(isset($_POST['url']) ? trim($_POST['url']) : '');
function posterupload() {
global $INSTALLER09, $CURUSER;
define('BITBUCKET_DIR', DIRECTORY_SEPARATOR.'home/pirate'.DIRECTORY_SEPARATOR.'public_html/bucket/'); //matches in bitbucket.php
define('AVATAR_DIR', BITBUCKET_DIR . DIRECTORY_SEPARATOR . 'avatar'); //matches in bitbucket.php
$SaLt = 'mE0wI924dsfsfs!@B'; //matches in bitbucket.php
$SaLty = '8368364562'; //matches in bitbucket.php
$folders = date('Y/m');
$bucketdir = BITBUCKET_DIR . '/' . $folders . '/';
$bucketlink = $folders . '/';
$address = $INSTALLER09['baseurl'] . '/';
$USERSALT = substr(md5($SaLty . $CURUSER['id']), 0, 6);
make_year(BITBUCKET_DIR);
make_month(BITBUCKET_DIR);
$file = preg_replace('`[^a-z0-9\-\_\.]`i', '', $_FILES['poster']['name']);
if (!function_exists('exif_imagetype')) {
function exif_imagetype($filename) {
if ((list($width, $height, $type, $attr) = getimagesize($filename)) !== false) {
return $type;
}
return false;
}
}
$it1 = exif_imagetype($_FILES['poster']['tmp_name']);
if ($it1 != IMAGETYPE_GIF && $it1 != IMAGETYPE_JPEG && $it1 != IMAGETYPE_PNG) return '';
$file = strtolower($file);
$path = $bucketdir . $USERSALT . '_' . $file;
$pathlink = $bucketlink . $USERSALT . '_' . $file;
$loop = 0;
while (true) {
if ($loop > 10) return '';
if (!file_exists($path)) break;
$randb = bucketrand();
$path = $bucketdir . $USERSALT . '_' . $randb . $file;
$pathlink = $bucketlink . $USERSALT . '_' . $randb . $file;
$loop++;
}
if (!move_uploaded_file($_FILES['poster']['tmp_name'], $path)) return '';
return $address . "img.php/" . $pathlink;
}
function make_year($path) {
$dir = $path . '/' . date('Y');
if (!is_dir($dir)) mkdir($dir);
}
function make_month($path) {
$dir = $path . '/' . date('Y/m');
if (!is_dir($dir)) mkdir($dir);
}
function bucketrand() {
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$out = '';
for ($i = 0; $i < 6; $i++) $out.= $chars[mt_rand(0, 61) ];
return $out;
}
$poster = (isset($_FILES["poster"]) ? $poster = posterupload() : $poster = '');
$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname)) stderr($lang['takeupload_failed'], $lang['takeupload_no_filename']);
if (isset($_POST['uplver']) && $_POST['uplver'] == 'yes') {
$anonymous = "yes";
$anon = "Anonyme";
} else {
$anonymous = "no";
$anon = $CURUSER["username"];
}
if (isset($_POST['allow_comments']) && $_POST['allow_comments'] == 'yes') {
$allow_comments = "no";
$disallow = "Oui";
} else {
$allow_comments = "yes";
$disallow = "Non";
}
if (isset($_POST["music"])) {
$genre = implode(",", $_POST['music']);
} elseif (isset($_POST["movie"])) {
$genre = implode(",", $_POST['movie']);
} elseif (isset($_POST["game"])) {
$genre = implode(",", $_POST['game']);
} elseif (isset($_POST["apps"])) {
$genre = implode(",", $_POST['apps']);
} else {
$genre = '';
}
$nfo = sqlesc('');
/////////////////////// NFO FILE ////////////////////////
if (isset($_FILES['nfo']) && !empty($_FILES['nfo']['name'])) {
$nfofile = $_FILES['nfo'];
if ($nfofile['name'] == '') stderr($lang['takeupload_failed'], $lang['takeupload_no_nfo']);
if ($nfofile['size'] == 0) stderr($lang['takeupload_failed'], $lang['takeupload_0_byte']);
if ($nfofile['size'] > 65535) stderr($lang['takeupload_failed'], $lang['takeupload_nfo_big']);
$nfofilename = $nfofile['tmp_name'];
if (@!is_uploaded_file($nfofilename)) stderr($lang['takeupload_failed'], $lang['takeupload_nfo_failed']);
$nfo = sqlesc(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @file_get_contents($nfofilename)));
}
/////////////////////// NFO FILE END /////////////////////
/// Set Freeleech on Torrent Time Based
$free = 0;
if (isset($_POST['free_length']) && ($free_length = 0 + $_POST['free_length'])) {
if ($free_length == 255) $free = 1;
elseif ($free_length == 42) $free = (86400 + TIME_NOW);
else $free = (TIME_NOW + $free_length * 604800);
}
/// end
/// Set Silver Torrent Time Based
$silver = 0;
if (isset($_POST['half_length']) && ($half_length = 0 + $_POST['half_length'])) {
if ($half_length == 255) $silver = 1;
elseif ($half_length == 42) $silver = (86400 + TIME_NOW);
else $silver = (TIME_NOW + $half_length * 604800);
}
/// end
//==Xbt freetorrent
$freetorrent = (((isset($_POST['freetorrent']) && is_valid_id($_POST['freetorrent'])) ? intval($_POST['freetorrent']) : 0));
$descr = strip_tags(isset($_POST['body']) ? trim($_POST['body']) : '');
if (!$descr) {
if (isset($_FILES['nfo']) && !empty($_FILES['nfo']['name'])) {
$descr = preg_replace("/[^\\x20-\\x7e\\x0a\\x0d]/", " ", $nfo);
} else {
stderr($lang['takeupload_failed'], $lang['takeupload_no_descr']);
}
}
$description = strip_tags(isset($_POST['description']) ? trim($_POST['description']) : '');
if (isset($_POST['strip']) && $_POST['strip']) {
require_once (INCL_DIR . 'strip.php');
$descr = preg_replace("/[^\\x20-\\x7e\\x0a\\x0d]/", " ", $descr);
strip($descr);
//$descr = preg_replace("/\n+/","\n",$descr);
}
$catid = (0 + $_POST["type"]);
if (!is_valid_id($catid)) stderr($lang['takeupload_failed'], $lang['takeupload_no_cat']);
$request = (((isset($_POST['request']) && is_valid_id($_POST['request'])) ? intval($_POST['request']) : 0));
$offer = (((isset($_POST['offer']) && is_valid_id($_POST['offer'])) ? intval($_POST['offer']) : 0));
$subs = isset($_POST["subs"]) ? implode(",", $_POST['subs']) : "";
$release_group_array = array(
'scene' => 1,
'p2p' => 1,
'none' => 1
);
$release_group = isset($_POST['release_group']) && isset($release_group_array[$_POST['release_group']]) ? $_POST['release_group'] : 'none';
$youtube = '';
if (isset($_POST['youtube']) && preg_match($youtube_pattern, $_POST['youtube'], $temp_youtube)) $youtube = $temp_youtube[0];
$tags = strip_tags(isset($_POST['tags']) ? trim($_POST['tags']) : '');
if (!validfilename($fname)) stderr($lang['takeupload_failed'], $lang['takeupload_invalid']);
if (!preg_match('/^(.+)\.torrent$/si', $fname, $matches)) stderr($lang['takeupload_failed'], $lang['takeupload_not_torrent']);
$shortfname = $torrent = $matches[1];
if (!empty($_POST["name"])) $torrent = unesc($_POST["name"]);
$tmpname = $f["tmp_name"];
if (!is_uploaded_file($tmpname)) stderr($lang['takeupload_failed'], $lang['takeupload_eek']);
if (!filesize($tmpname)) stderr($lang['takeupload_failed'], $lang['takeupload_no_file']);
// bencdec by djGrrr <3
$dict = bencdec::decode_file($tmpname, $INSTALLER09['max_torrent_size'], bencdec::OPTION_EXTENDED_VALIDATION);
if ($dict === false) stderr('Erreur', 'Que diable avez-vous transféré? Cela n\est pas un fichier bencoded!');
if (isset($dict['announce-list'])) unset($dict['announce-list']);
$dict['info']['private'] = 1;
if (!isset($dict['info'])) stderr('Erreur', 'torrent invalide, infos dictionnaire n\'existe pas');
$info = & $dict['info'];
$infohash = pack("H*", sha1(bencdec::encode($info)));
if (bencdec::get_type($info) != 'dictionary') stderr('Erreur', 'torrent invalide, info est pas un dictionnaire');
if (!isset($info['name']) || !isset($info['piece length']) || !isset($info['pieces'])) stderr('Erreur', 'torrent invalide, les parties manquantes de l\'info dictionnaire');
if (bencdec::get_type($info['name']) != 'string' || bencdec::get_type($info['piece length']) != 'integer' || bencdec::get_type($info['pieces']) != 'string') stderr('Erreur', 'torrent invalide, types non valides dans le dictionnaire d\'info');
$dname = $info['name'];
$plen = $info['piece length'];
$pieces_len = strlen($info['pieces']);
if ($pieces_len % 20 != 0) stderr('Erreur', 'pièces invalid');
if ($plen % 4096) stderr('Erreur', 'taille des pièces est pas Mod (4096), quel sorte de torrent ?');
$filelist = array();
if (isset($info['length'])) {
if (bencdec::get_type($info['length']) != 'integer') stderr('Erreur', 'longueur doit être un entier');
$totallen = $info['length'];
$filelist[] = array(
$dname,
$totallen
);
$type = 'single';
} else {
if (!isset($info['files'])) stderr('Erreur', 'manquant à la fois la longueur et fichiers');
if (bencdec::get_type($info['files']) != 'list') stderr('Erreur', 'fichier invalid, pas dans la liste');
$flist = & $info['files'];
if (!count($flist)) stderr('Erreur', 'Aucuns fichiers');
$totallen = 0;
foreach ($flist as $fn) {
if (!isset($fn['length']) || !isset($fn['path'])) stderr('Error', 'file info not found');
if (bencdec::get_type($fn['length']) != 'integer' || bencdec::get_type($fn['path']) != 'list') stderr('Erreur', 'fichier info invalide');
$ll = $fn['length'];
$ff = $fn['path'];
$totallen+= $ll;
$ffa = array();
foreach ($ff as $ffe) {
if (bencdec::get_type($ffe) != 'string') stderr('Erreur', 'erreur de type du fichier');
$ffa[] = $ffe;
}
if (!count($ffa)) stderr('Erreur', 'erreur nom du fichier');
$ffe = implode('/', $ffa);
$filelist[] = array(
$ffe,
$ll
);
}
$type = 'multi';
}
$num_pieces = $pieces_len / 20;
$expected_pieces = (int)ceil($totallen / $plen);
if ($num_pieces != $expected_pieces) stderr('Whoops', 'taille totale du fichier et nombre de pièces ne correspondent pas');
//==
$tmaker = (isset($dict['created by']) && !empty($dict['created by'])) ? sqlesc($dict['created by']) : sqlesc($lang['takeupload_unkown']);
$dict['comment'] = ("En utilisant ce torrent vous êtes lié par l'Accord de confidentialité par la loi de {$INSTALLER09['site_name']}"); // change torrent comment
// Replace punctuation characters with spaces
$visible = (XBT_TRACKER == true ? "yes" : "no");
$seedbox = (isset($_POST["seedbox"]) ? "1" : "0");
$torrent = str_replace("_", " ", $torrent);
$vip = (isset($_POST["vip"]) ? "1" : "0");
$ret = sql_query("INSERT INTO torrents (search_text, filename, owner, username, visible, seedbox, vip, release_group, newgenre, poster, anonymous, allow_comments, info_hash, name, size, numfiles, type, offer, request, url, subs, descr, ori_descr, description, category, free, silver, save_as, youtube, tags, added, last_action, mtime, ctime, freetorrent, nfo, client_created_by) VALUES (" . implode(",", array_map("sqlesc", array(
searchfield("$shortfname $dname $torrent") ,
$fname,
$CURUSER["id"],
$CURUSER["username"],
$visible,
$seedbox,
$vip,
$release_group,
$genre,
$poster,
$anonymous,
$allow_comments,
$infohash,
$torrent,
$totallen,
count($filelist) ,
$type,
$offer,
$request,
$url,
$subs,
$descr,
$descr,
$description,
0 + $_POST["type"],
$free,
$silver,
$dname,
$youtube,
$tags
))) . ", " . TIME_NOW . ", " . TIME_NOW . ", " . TIME_NOW . ", " . TIME_NOW . ", $freetorrent, $nfo, $tmaker)");
if (!$ret) {
if (((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) == 1062) stderr($lang['takeupload_failed'], $lang['takeupload_already']);
stderr($lang['takeupload_failed'], "mysql puked: " . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
}
if (XBT_TRACKER == false) {
remove_torrent($infohash);
}
$id = ((is_null($___mysqli_res = mysqli_insert_id($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res);
$mc1->delete_value('MyPeers_' . $CURUSER['id']);
//$mc1->delete_value('lastest_tor_'); //
$mc1->delete_value('last5_tor_');
$mc1->delete_value('scroll_tor_');
if (isset($_POST['uplver']) && $_POST['uplver'] == 'yes') $message = " Nouveau torrent : [url={$INSTALLER09['baseurl']}/details.php?id=$id] " . htmlsafechars($torrent) . "[/url] partagé par un membre anonyme";
else $message = " Nouveau torrent : [url={$INSTALLER09['baseurl']}/details.php?id=$id] " . htmlsafechars($torrent) . "[/url] partagé par " . $CURUSER["username"] . "";
$messages = "{$INSTALLER09['site_name']} Nouveau torrent: $torrent partagé par : $anon " . mksize($totallen) . " {$INSTALLER09['baseurl']}/details.php?id=$id";
sql_query("DELETE FROM files WHERE torrent = " . sqlesc($id));
function file_list($arr, $id)
{
foreach ($arr as $v) $new[] = "($id," . sqlesc($v[0]) . "," . $v[1] . ")";
return join(",", $new);
}
sql_query("INSERT INTO files (torrent, filename, size) VALUES " . file_list($filelist, $id));
//==
$dir = $INSTALLER09['torrent_dir'] . '/' . $id . '.torrent';
if (!bencdec::encode_file($dir, $dict)) stderr('Erreur', 'Impossible d\'encodé correctement le fichier');
@unlink($tmpname);
chmod($dir, 0664);
//==
if ($INSTALLER09['seedbonus_on'] == 1) {
//===add karma
sql_query("UPDATE users SET seedbonus=seedbonus+".sqlesc($INSTALLER09['bonus_per_upload']).", numuploads=numuploads+1 WHERE id = " . sqlesc($CURUSER["id"])) or sqlerr(__FILE__, __LINE__);
//===end
$update['seedbonus'] = ($CURUSER['seedbonus'] + $INSTALLER09['bonus_per_upload']);
$mc1->begin_transaction('userstats_' . $CURUSER["id"]);
$mc1->update_row(false, array(
'seedbonus' => $update['seedbonus']
));
$mc1->commit_transaction($INSTALLER09['expires']['u_stats']);
$mc1->begin_transaction('user_stats_' . $CURUSER["id"]);
$mc1->update_row(false, array(
'seedbonus' => $update['seedbonus']
));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
}
if ($INSTALLER09['autoshout_on'] == 1) {
autoshout($message);
//ircbot($messages);
$mc1->delete_value('shoutbox_');
}
//=== if it was an offer notify the folks who liked it :D
if ($offer > 0) {
$res_offer = sql_query('SELECT user_id FROM offer_votes WHERE vote = \'yes\' AND user_id != ' . sqlesc($CURUSER['id']) . ' AND offer_id = ' . sqlesc($offer)) or sqlerr(__FILE__, __LINE__);
$subject = sqlesc('Une offre a été téléchargé!');
$message = sqlesc("Salut, \n Une offre par laquelle vous étiez intéressé a été téléchargé!!! \n\n Cliquez [url=" . $INSTALLER09['baseurl'] . "/details.php?id=" . $id . "]" . htmlsafechars($torrent, ENT_QUOTES) . "[/url] pour voir le torrent!");
while ($arr_offer = mysqli_fetch_assoc($res_offer)) {
sql_query('INSERT INTO messages (sender, receiver, added, msg, subject, saved, location)
VALUES(0, ' . sqlesc($arr_offer['user_id']) . ', ' . TIME_NOW . ', ' . $message . ', ' . $subject . ', \'yes\', 1)') or sqlerr(__FILE__, __LINE__);
$mc1->delete_value('inbox_new_' . $arr_offer['user_id']);
$mc1->delete_value('inbox_new_sb_' . $arr_offer['user_id']);
}
write_log('Torrents offert ' . $id . ' (' . htmlsafechars($torrent) . ') a été uploadé par ' . $CURUSER['username']);
$filled = 1;
}
$filled = 0;
//=== if it was a request notify the folks who voted :D
if ($request > 0) {
$res_req = sql_query('SELECT user_id FROM request_votes WHERE vote = \'yes\' AND request_id = ' . sqlesc($request)) or sqlerr(__FILE__, __LINE__);
$subject = sqlesc('Votre demande a été téléchargé!');
$message = sqlesc("Salut :D \n Votre demande a été téléchargé!!! \n\n Cliquez [url=" . $INSTALLER09['baseurl'] . "/details.php?id=" . $id . "]" . htmlsafechars($torrent, ENT_QUOTES) . "[/url] pour voir le torrent!");
while ($arr_req = mysqli_fetch_assoc($res_req)) {
sql_query('INSERT INTO messages (sender, receiver, added, msg, subject, saved, location)
VALUES(0, ' . sqlesc($arr_req['user_id']) . ', ' . TIME_NOW . ', ' . $message . ', ' . $subject . ', \'yes\', 1)') or sqlerr(__FILE__, __LINE__);
$mc1->delete_value('inbox_new_' . $arr_req['user_id']);
$mc1->delete_value('inbox_new_sb_' . $arr_req['user_id']);
}
sql_query('UPDATE requests SET filled_by_user_id = ' . sqlesc($CURUSER['id']) . ', filled_torrent_id = ' . sqlesc($id) . ' WHERE id = ' . sqlesc($request)) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE usersachiev SET reqfilled = reqfilled + 1 WHERE id =" . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
write_log('Requête pour le torrent ' . $id . ' (' . htmlsafechars($torrent) . ') a été rempli par ' . $CURUSER['username']);
$filled = 1;
}
if ($filled == 0) write_log(sprintf($lang['takeupload_log'], $id, $torrent, $CURUSER['username']));
/* RSS feeds */
if (($fd1 = @fopen("rss.xml", "w")) && ($fd2 = fopen("rssdd.xml", "w"))) {
$cats = "";
$res = sql_query("SELECT id, name FROM categories");
while ($arr = mysqli_fetch_assoc($res)) $cats[$arr["id"]] = $arr["name"];
$s = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<rss version=\"0.91\">\n<channel>\n" . "<title>{$INSTALLER09['site_name']}</title>\n<description> est le meilleur!</description>\n<link>{$INSTALLER09['baseurl']}/</link>\n";
@fwrite($fd1, $s);
@fwrite($fd2, $s);
$r = sql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);
while ($a = mysqli_fetch_assoc($r)) {
$cat = $cats[$a["category"]];
$s = "<item>\n<title>" . htmlsafechars($a["name"] . " ($cat)") . "</title>\n" . "<description>" . htmlsafechars($a["descr"]) . "</description>\n";
@fwrite($fd1, $s);
@fwrite($fd2, $s);
@fwrite($fd1, "<link>{$INSTALLER09['baseurl']}/details.php?id=" . (int)$a['id'] . "&hit=1</link>\n</item>\n");
$filename = htmlsafechars($a["filename"]);
@fwrite($fd2, "<link>{$INSTALLER09['baseurl']}/download.php?torrent=" . (int)$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 = sql_query("SELECT name FROM categories WHERE id=".sqlesc($catid)) or sqlerr(__FILE__, __LINE__);
$arr = mysqli_fetch_assoc($res);
$cat = htmlsafechars($arr["name"]);
$res = sql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") or sqlerr(__FILE__, __LINE__);
$uploader = $CURUSER['username'];
$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);
$body = <<<EOD
Un nouveau torrent a été uploadé.
Nom: $torrent
Taille: $size
Catégorie: $cat
Uploadé par: $uploader
Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------
Vous pouvez utiliser l'URL ci-dessous pour télécharger le torrent (vous pouvez avoir à ouvrir une session).
{$INSTALLER09['baseurl']}/details.php?id=$id&hit=1
--
{$INSTALLER09['site_name']}
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysqli_num_rows($res);
while ($arr = mysqli_fetch_row($res))
{
if ($nthis == 0)
$to = $arr[0];
else
$to .= "," . $arr[0];
++$nthis;
++$ntotal;
if ($nthis == $nmax || $ntotal == $total)
{
if (!mail("Multiple recipients <{$INSTALLER09['site_email']}>", "Nouveau torrent - $torrent", $body,
"De: {$INSTALLER09['site_email']}\r\nBcc: $to"))
stderr("Erreur", "Votre torrent a été été téléchargé. NE PAS recharger la page!\n" .
"Il y avait cependant un problème pour délivrer les notifications par email.\n" .
"S'il vous plaît laissez contacter un administrateur sur cette erreur!\n");
$nthis = 0;
}
}
*******************/
header("Location: {$INSTALLER09['baseurl']}/details.php?id=$id&uploaded=1");
?>