Bonjour,
Je possède une boutique en ligne hébergé chez free depuis quelques temps, qui fonctionne sous le cms nuked klan.
Free ma envoyé un email dans lequel il est marque:
Nous n'acceptons pas de statistiques/historiques web sur base de données.
Nous avons détruit une de vos tables mysql.
Depuis je me retrouve avec l'erreur suivante:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mnt/142/sdb/0/d/**********/nuked.php on line 572
je ne peu pas non plus me servir de la boutique, a chaque rajout d'article, j'ai le message suivant:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mnt/142/sdb/0/d/**********/nuked.php on line 545
Warning: Cannot modify header information - headers already sent by (output started at /mnt/142/sdb/0/d/*********/nuked.php:545) in /mnt/142/sdb/0/d/**********/modules/Boutique/caddie.php on line 231
voici mon nuked.php
<?php
// -------------------------------------------------------------------------//
// Nuked-KlaN 1.7 - PHP Portal //
// https://nuked-klan.org/ //
// -------------------------------------------------------------------------//
// This program is free software. you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License. //
// -------------------------------------------------------------------------//
include ("globals.php");
if (!defined("INDEX_CHECK"))
{
@include ("conf.inc.php");
}
connect();
$nuked = array();
$sql_conf = mysql_query("SELECT name, value FROM " . $db_prefix . "_config");
while ($row = mysql_fetch_array($sql_conf))
{
$nuked[$row['name']] = stripslashes(htmlentities($row['value'], ENT_NOQUOTES));
}
$nuked['prefix'] = $db_prefix;
$nuked['footmessage'] = eregi_replace("<", "<", $nuked['footmessage']);
$nuked['footmessage'] = eregi_replace(">", ">", $nuked['footmessage']);
include ("Includes/constants.php");
include ("Includes/nkSessions.php");
global $file, $op, $page, $nuked_nude;
if (!isset($file))
{
$file = $nuked['index_site'];
}
if (!isset($op))
{
$op = "index";
}
if ($user_theme != "" && is_file("themes/" . $user_theme . "/theme.php"))
{
$theme = $user_theme;
}
else
{
$theme = $nuked['theme'];
}
if ($user_langue != "" && is_file("lang/" . $user_langue . ".lang.php"))
{
$language = $user_langue;
}
else
{
$language = $nuked['langue'];
}
if (!isset($nuked_nude))
{
if ($language == "french" && ereg("WIN", PHP_OS)) setlocale (LC_TIME, "french");
else if ($language == "french" && ereg("BSD", PHP_OS)) setlocale (LC_TIME, "fr_FR.ISO8859-1");
else if ($language == "french") setlocale (LC_TIME, "fr_FR");
else setlocale (LC_TIME, $language);
}
function connect()
{
global $global, $db;
$db = @mysql_connect($global['db_host'], $global['db_user'], $global['db_pass']) or die ("<div style=\"text-align: center;\">Error ! Database connexion failed<br />" . mysql_error() . "</div>");
$connect = @mysql_select_db($global['db_name'], $db) or die ("<div style=\"text-align: center;\">Error ! Database connexion failed<br />Check your database's name<br />" . mysql_error() . "</div>");
}
function banip()
{
global $nuked, $user_ip, $user;
$ip_ban = $_COOKIE['ip_ban'];
if ($ip_ban != "")
{
if ($ip_ban != $user_ip && !ereg($ip_ban, $user_ip))
{
$sql = mysql_query("SELECT pseudo, email, texte FROM " . BANNED_TABLE . " WHERE ip = '" . $ip_ban . "'");
$nb_ban = mysql_num_rows($sql);
if ($nb_ban > 0)
{
$sql2 = mysql_query("SELECT id FROM " . BANNED_TABLE . " WHERE ip = '" . $user_ip . "'");
$check_ban = mysql_num_rows($sql2);
if ($check_ban == 0)
{
list($pseudo_ban, $email_ban, $texte_ban) = mysql_fetch_array($sql);
$insert = mysql_query("INSERT INTO " . BANNED_TABLE . " ( 'id' , 'ip' , 'pseudo', 'email', 'texte' ) VALUES ('', '" . $user_ip . "', '" . $pseudo_ban . "', '" . $email_ban . "', '" . $texte_ban . "')");
}
$ip_ban = $user_ip;
}
else
{
$ip_ban = "";
}
}
}
else
{
$nb_ban = 0;
$sql = mysql_query("SELECT ip, pseudo FROM " . BANNED_TABLE . " ORDER BY id");
while (list($ip_banned, $pseudo_banned) = mysql_fetch_array($sql))
{
if ($nb_ban == 0)
{
$bip = explode(".", $ip_banned);
if (isset($bip[3]) && $bip[3] != "")
{
$banlist = $ip_banned;
$verif_ip = $user_ip;
}
else
{
$banlist = $bip[0] . $bip[1] . $bip[2];
$uip = explode(".", $user_ip);
$verif_ip = $uip[0] . $uip[1] . $uip[2];
}
if ($verif_ip == $banlist)
{
$ip_ban = $ip_banned;
$nb_ban++;
}
else if ($user[2] != "" && $pseudo_banned == $user[2])
{
$ip_ban = $ip_banned;
$nb_ban++;
}
else
{
$ip_ban = "";
}
}
}
}
return $ip_ban;
}
function get_blok($side)
{
global $user, $file, $op, $nuked;
if ($side == "gauche")
{
$active = 1;
}
else if ($side == "droite")
{
$active = 2;
}
else if ($side == "centre")
{
$active = 3;
}
else if ($side == "bas")
{
$active = 4;
}
$aff_good_bl = "block_" . $side;
$sql = mysql_query("SELECT * FROM " . BLOCK_TABLE . " WHERE active = '" . $active . "' ORDER BY position");
while ($blok = mysql_fetch_array($sql))
{
$blok['titre'] = stripslashes($blok['titre']);
$blok['titre'] = htmlentities($blok['titre']);
$test_page = "";
$bl_nivo = $blok['nivo'];
$blok['page'] = explode("|", $blok['page']);
foreach ($blok['page'] as $mod)
{
if ($file == $mod || $mod == "Tous") $test_page = "ok";
}
if ($user) $visiteur = $user[1];
else $visiteur = 0;
if ($visiteur >= $bl_nivo && $test_page == "ok")
{
include_once("Includes/blocks/block_" . $blok['type'] . ".php");
$function = "affich_block_" . $blok['type'];
$blok = $function($blok);
if ($blok['content'] != "") $aff_good_bl($blok);
}
}
}
function BBcode($texte, $imgMaxWidth = 0, $imgClic = FALSE)
{
global $bgcolor3, $bgcolor1;
if ($texte != "")
{
//$texte = nl2br($texte);
$texte = " " . $texte;
$texte = preg_replace("#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="\2://\3" onclick="window.open(this.href); return false;">\2://\3</a>', $texte);
$texte = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="[[http:// ]]\2.\3" onclick="window.open(this.href); return false;">\2.\3</a>', $texte);
$texte = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $texte);
$texte = str_replace("\r", "", $texte);
$texte = str_replace("\n", "<br />", $texte);
$texte = preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/i", "<span style=\"color: \\1;\">\\2</span>", $texte);
$texte = preg_replace("/\[size=(.*?)\](.*?)\[\/size\]/i", "<span style=\"font-size: \\1px;\">\\2</span>", $texte);
$texte = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/i", "<span style=\"font-family: \\1;\">\\2</span>", $texte);
$texte = preg_replace("/\[align=(.*?)\](.*?)\[\/align\]/i", "<div style=\"text-align: \\1;\">\\2</div>", $texte);
$texte = str_replace("[b]", "<b>", $texte);
$texte = str_replace("/b", "</b>", $texte);
$texte = str_replace("[i]", "<i>", $texte);
$texte = str_replace("/i", "</i>", $texte);
$texte = str_replace("[li]", "<ul><li>", $texte);
$texte = str_replace("/li", "</li></ul>", $texte);
$texte = str_replace("[u]", "<span style=\"text-decoration: underline;\">", $texte);
$texte = str_replace("/u", "</span>", $texte);
$texte = str_replace("[center]", "<div style=\"text-align: center;\">", $texte);
$texte = str_replace("/center", "</div>", $texte);
$texte = str_replace("[strike]", "<span style=\"text-decoration: line-through;\">", $texte);
$texte = str_replace("/strike", "</span>", $texte);
$texte = str_replace("[blink]", "<span style=\"text-decoration: blink;\">", $texte);
$texte = str_replace("/blink", "</span>", $texte);
$texte = preg_replace("/\[flip\](.*?)\[\/flip\]/i", "<div style=\"width: 100%;filter: FlipV;\">\\1</div>", $texte);
$texte = preg_replace("/\[blur\](.*?)\[\/blur\]/i", "<div style=\"width: 100%;filter: blur();\">\\1</div>", $texte);
$texte = preg_replace("/\[glow\](.*?)\[\/glow\]/i", "<div style=\"width: 100%;filter: glow(color=red);\">\\1</div>", $texte);
$texte = preg_replace("/\[glow=(.*?)\](.*?)\[\/glow\]/i", "<div style=\"width: 100%;filter: glow(color=\\1);\">\\2</div>", $texte);
$texte = preg_replace("/\[shadow\](.*?)\[\/shadow\]/i", "<div style=\"width: 100%;filter: shadow(color=red);\">\\1</div>", $texte);
$texte = preg_replace("/\[shadow=(.*?)\](.*?)\[\/shadow\]/i", "<div style=\"width: 100%;filter: shadow(color=\\1);\">\\2</div>", $texte);
$texte = preg_replace("/\[email\](.*?)\[\/email\]/i", "<a href=\"mailto:\\1\">\\1</a>", $texte);
$texte = preg_replace("/\[email=(.*?)\](.*?)\[\/email\]/i", "<a href=\"mailto:\\1\">\\2</a>", $texte);
$texte = str_replace("[quote]", "<br /><table style=\"background: " . $bgcolor3 . ";\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\" border=\"0\"><tr><td style=\"background: #FFFFFF;color: #000000\"><div id=\"quote\" style=\"border: 0; overflow: auto;\"><b>" . _QUOTE . " :</b><br />", $texte);
$texte = preg_replace("/\[quote=(.*?)\]/i", "<br /><table style=\"background: " . $bgcolor3 . ";\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\" border=\"0\"><tr><td style=\"background: #FFFFFF;color: #000000\"><div id=\"quote\" style=\"border: 0; overflow: auto;\"><b>\\1 " . _HASWROTE . " :</b></div>", $texte);
$texte = str_replace("/quote", "</div></td></tr></table><br />", $texte);
$texte = str_replace("[code]", "<br /><table style=\"background: " . $bgcolor3 . ";\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\" border=\"0\"><tr><td style=\"background: #FFFFFF;color: #000000\"><div id=\"code\" style=\"border: 0; overflow: auto;\"><b>" . _CODE . " :</b><pre>", $texte);
$texte = str_replace("/code", "</pre></div></td></tr></table>", $texte);
if ($imgMaxWidth>0)
{
if ($imgClic == TRUE) $texte = preg_replace_callback('/\[img\](.*?)\[\/img\]/i', create_function('$var', '$img = "<a href=\"" . checkimg($var[1]) . "\" class=\"thickbox\" alt=\"\"><img style=\"border: 0; overflow: auto; max-width: ' . $imgMaxWidth . 'px; width: expression(this.scrollWidth >= ' . $imgMaxWidth . '? \'' . $imgMaxWidth . 'px\' : \'auto\');\" src=\"" . checkimg($var[1]) . "\" alt=\"\" /></a>";return $img;'), $texte);
else $texte = preg_replace_callback('/\[img\](.*?)\[\/img\]/i', create_function('$var', '$img = "<img style=\"border: 0; overflow: auto; max-width: ' . $imgMaxWidth . 'px; width: expression(this.scrollWidth >= ' . $imgMaxWidth . '? \'' . $imgMaxWidth . 'px\' : \'auto\');\" src=\"" . checkimg($var[1]) . "\" alt=\"\" />";return $img;'), $texte);
}
else
{
$texte = preg_replace_callback('/\[img\](.*?)\[\/img\]/i', create_function('$var', '$img = "<img style=\"border: 0;\" src=\"" . checkimg($var[1]) . "\" alt=\"\" />";return $img;'), $texte);
}
$texte = preg_replace_callback('/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/i', create_function('$var', '$img = "<a href=\"" . checkimg($var[3]) . "\" class=\"thickbox\" alt=\"\"><img style=\"border: 0;\" width=\"" . $var[1] . "\" height=\"" . $var[2] . "\" src=\"" . checkimg($var[3]) . "\" alt=\"\" /></a>";return $img;'), $texte);
$texte = preg_replace("/\[flash\](.*?)\[\/flash\]/i", "<object type=\"application/x-shockwave-flash\" data=\"\\1\"><param name=\"movie\" value=\"\\1\" /><param name=\"pluginurl\" value=\"https://get.adobe.com/flashplayer/ \" /></object>", $texte);
$texte = preg_replace("/\[flash=(.*?)x(.*?)\](.*?)\[\/flash\]/i", "<object type=\"application/x-shockwave-flash\" data=\"\\3\" width=\"\\1\" height=\"\\2\"><param name=\"movie\" value=\"\\3\" /><param name=\"pluginurl\" value=\"https://get.adobe.com/flashplayer/ \" /></object>", $texte);
$texte = preg_replace("/\[url\]www.(.*?)\[\/url\]/i", "<a href=\"http://www.\\1\" onclick=\"window.open(this.href); return false;\">\\1</a>", $texte);
$texte = preg_replace("/\[url\](.*?)\[\/url\]/i", "<a href=\"\\1\" onclick=\"window.open(this.href); return false;\">\\1</a>", $texte);
$texte = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/i", "<a href=\"\\1\" onclick=\"window.open(this.href); return false;\">\\2</a>", $texte);
$texte = preg_replace("#\[s\](http://)?(. *?)\/s\#si", "<img style=\"border: 0;\" src=\"images/icones/\\2\" alt=\"\" />", $texte);
$texte = ltrim($texte);
}
return($texte);
}
function checkimg($url)
{
$url = rtrim($url);
$ext = strrchr($url, ".");
$ext = substr($ext, 1);
if (!eregi("\.php", $url) && !eregi("\.htm", $url) && !eregi("\.[a-z]htm", $url) && substr($url, -1) != "/" && (eregi("jpg", $ext) || eregi("jpeg", $ext) || eregi("gif", $ext) || eregi("png", $ext) || eregi("bmp", $ext))) $img = $url;
else $img = "images/noimagefile.gif";
return($img);
}
function icon($texte)
{
global $nuked;
$texte = str_replace("mailto:", "mailto!", $texte);
$texte = str_replace("[[http:// ]]", "_http_", $texte);
$texte = str_replace(""", "_QUOT_", $texte);
$texte = str_replace("'", "_SQUOT_", $texte);
$texte = str_replace("à", "à", $texte);
$texte = str_replace("â", "â", $texte);
$texte = str_replace("é", "é", $texte);
$texte = str_replace("è", "è", $texte);
$texte = str_replace("ê", "ê", $texte);
$texte = str_replace("û", "û", $texte);
$sql = mysql_query("SELECT code, url, name FROM " . SMILIES_TABLE . " ORDER BY id");
while (list($code, $url, $name) = mysql_fetch_array($sql))
{
$name = stripslashes($name);
$texte = str_replace($code, "<img src=\"images/icones/" . $url . "\" alt=\"\" title=\"$name\" />", $texte);
}
$texte = str_replace("mailto!", "mailto:", $texte);
$texte = str_replace("_http_", "[[http:// ]]", $texte);
$texte = str_replace("_QUOT_", """, $texte);
$texte = str_replace("_SQUOT_", "'", $texte);
$texte = str_replace("à", "à", $texte);
$texte = str_replace("â", "â", $texte);
$texte = str_replace("é", "é", $texte);
$texte = str_replace("è", "è", $texte);
$texte = str_replace("ê", "ê", $texte);
$texte = str_replace("û", "û", $texte);
return($texte);
}
function buttonBB($BBtext)
{
echo "<script type=\"text/javascript\" src=\"js/bbcode.js\"></script>\n";
echo "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"b\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'b');\" title=\"" . _BBOLD . "\"><img src=\"images/bb_bold.gif\" alt=\"\" title=\"" . _BBOLD . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"i\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'i');\" title=\"" . _BITAL . "\"><img src=\"images/bb_italicize.gif\" alt=\"\" title=\"" . _BITAL . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"u\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'u');\" title=\"" . _BUNDERLINE . "\"><img style=\"border: 0;\" src=\"images/bb_underline.gif\" alt=\"\" title=\"" . _BUNDERLINE . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"c\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'center');\" title=\"" . _BCENTER . "\"><img style=\"border: 0;\" src=\"images/bb_center.gif\" alt=\"\" title=\"" . _BCENTER . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"l\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'li');\" title=\"" . _BLIST . "\"><img style=\"border: 0;\" src=\"images/bb_list.gif\" alt=\"\" title=\"" . _BLIST . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"q\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'quote');\" title=\"" . _BQUOTE . "\"><img style=\"border: 0;\" src=\"images/bb_quote.gif\" alt=\"\" title=\"" . _BQUOTE . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"p\" onclick=\"javascript:ajout_text('" . $BBtext . "', '" . _ENTERTEXT . "','" . _TAPEYOURTEXT . "', 'code');\" title=\"" . _BCODE . "\"><img style=\"border: 0;\" src=\"images/bb_code.gif\" alt=\"\" title=\"" . _BCODE . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"m\" onclick=\"javascript:ajout_mail('" . $BBtext . "', '" . _ENTERMAIL . "');\" title=\"" . _BMAIL . "\"><img style=\"border: 0;\" src=\"images/bb_email.gif\" alt=\"\" title=\"" . _BMAIL . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"w\" onclick=\"javascript:ajout_url('" . $BBtext . "', '" . _ENTERSITEURL . "', '" . _ENTERSITENAME . "');\" title=\"" . _BURL . "\"><img style=\"border: 0;\" src=\"images/bb_url.gif\" alt=\"\" title=\"" . _BURL . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"g\" onclick=\"javascript:ajout_img('" . $BBtext . "', '" . _ENTERIMGURL . "');\" title=\"" . _BSCREEN . "\"><img style=\"border: 0;\" src=\"images/bb_image.gif\" alt=\"\" title=\"" . _BSCREEN . "\" /></button>"
. "<button type=\"button\" style=\"padding:0;cursor: pointer;cursor: hand;border: 0;background: transparent;\" accesskey=\"s\" onclick=\"javascript:ajout_flash('" . $BBtext . "', '" . _ENTERFLASHURL . "', '" . _ENTERWIDTH . "', '" . _ENTERHEIGHT . "');\" title=\"" . _BFLASH . "\"><img style=\"border: 0;\" src=\"images/bb_flash.gif\" alt=\"\" title=\"" . _BFLASH . "\" /></button>"
. "<br />\n"
. "<select onchange=\"color(this.options[this.selectedIndex].value, '" . $BBtext . "', '" . _ENTERTEXT . "', '" . _TAPEYOURTEXT . "');this.selectedIndex=0;\">\n"
. "<option value=\"\">" . _COLOR . "</option>\n"
. "<option value=\"#FF0000\" style=\"color:#FF0000;\">" . _RED . "</option>\n"
. "<option value=\"#8B0000\" style=\"color:#8B0000;\">" . _DARKRED . "</option>\n"
. "<option value=\"#0000FF\" style=\"color:#0000FF;\">" . _BLUE . "</option>\n"
. "<option value=\"#00008B\" style=\"color:#00008B;\">" . _DARKBLUE . "</option>\n"
. "<option value=\"#FFA500\" style=\"color:#FFA500;\">" . _ORANGE . "</option>\n"
. "<option value=\"#A52A2A\" style=\"color:#A52A2A;\">" . _BROWN . "</option>\n"
. "<option value=\"#FFFF00\" style=\"color:#FFFF00;\">" . _YELLOW . "</option>\n"
. "<option value=\"#008000\" style=\"color:#008000;\">" . _GREEN . "</option>\n"
. "<option value=\"#EE82EE\" style=\"color:#EE82EE;\">" . _VIOLET . "</option>\n"
. "<option value=\"#808000\" style=\"color:#808000;\">" . _OLIVE . "</option>\n"
. "<option value=\"#00FFFF\" style=\"color:#00FFFF;\">" . _CYAN . "</option>\n"
. "<option value=\"#4B0082\" style=\"color:#4B0082;\">" . _INDIGO . "</option>\n"
. "<option value=\"#FFFFFF\" style=\"color:#FFFFFF;\">" . _WHITE . "</option>\n"
. "<option value=\"#000000\" style=\"color:#000000;\">" . _BLACK . "</option>\n"
. "</select> "
. "<select onchange=\"taille(this.options[this.selectedIndex].value, '" . $BBtext . "', '" . _ENTERTEXT . "', '" . _TAPEYOURTEXT . "');this.selectedIndex=0;\">\n"
. "<option value=\"\">" . _SIZE . "</option>\n"
. "<option value=\"8\">8</option>\n"
. "<option value=\"10\">10</option>\n"
. "<option value=\"12\">12</option>\n"
. "<option value=\"14\">14</option>\n"
. "<option value=\"18\">18</option>\n"
. "<option value=\"24\">24</option>\n"
. "<option value=\"36\">36</option>\n"
. "</select> "
. "<select onchange=\"police(this.options[this.selectedIndex].value, '" . $BBtext . "', '" . _ENTERTEXT . "', '" . _TAPEYOURTEXT . "');this.selectedIndex=0;\">\n"
. "<option value=\"\">" . _POLICE . "</option>\n"
. "<option value=\"arial\">Arial</option>\n"
. "<option value=\"verdana\">Verdana</option>\n"
. "<option value=\"times\">Times</option>\n"
. "<option value=\"courier\">Courier</option>\n"
. "<option value=\"georgia\">Georgia</option>\n"
. "</select> "
. "<input type=\"button\" value=\" X \" title=\""._BBCLOSE."\" onclick=\"BBcode_close('" . $BBtext . "');\" /> "
. "<input type=\"button\" value=\" ? \" title=\""._BBHELP."\" onclick=\"javascript:window.open('index.php?file=Forum&nuked_nude=index&op=bbcodehelp','bbcodes','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=500,height=700,top=100,left=470');return(false)\" />\n";
}
function smiley($textarea)
{
global $nuked;
$sql = mysql_query("SELECT code, url, name FROM " . SMILIES_TABLE . " ORDER BY id LIMIT 0, 15");
while (list($code, $url, $name) = mysql_fetch_array($sql))
{
$name = stripslashes($name);
$name = htmlentities($name);
echo " <a href=\"javascript:insertAtCaret('" . $textarea ."', '$code')\"><img style=\"border: 0;\" src=\"images/icones/" . $url . "\" alt=\"\" title=\"" . $name . "\" /></a>";
}
echo "<br />[ <a href=\"#\" onclick=\"javascript:window.open('index.php?file=Textbox&nuked_nude=index&op=smilies&textarea=" . $textarea . "','smilies','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=200,height=350,top=100,left=470');return(false)\">" . _MORESMILIES . "</a> ]\n";
}
function redirect($url, $tps)
{
$temps = $tps * 1000;
echo "<script type=\"text/javascript\">\n"
. "<!--\n"
. "\n"
. "function redirect() {\n"
. "window.location='" . $url . "'\n"
. "}\n"
. "setTimeout('redirect()','" . $temps ."');\n"
. "\n"
. "// -->\n"
. "</script>\n";
}
function number($count, $nb_ligne, $url)
{
global $p;
if ($nb_ligne > 0)
{
echo "<b>" . _PAGE . " :</b> ";
if ($p > 1)
{
$end2 = $p - 1;
echo "<a href=\"" . $url . "&p=" . $end2 . "\" title=\"" . _PREVIOUSPAGE . "\"><</a> ";
}
$nb_page = intval($count / $nb_ligne);
$nb_page2 = $count % $nb_ligne;
if ($nb_page2 > 0) $nb_page++;
$i = 1;
while ($i <= $nb_page && $nb_page <> 1)
{
if (($i == ($p-1)) || ($i == $p) || ($i == ($p + 1)) || ($i == 1) || ($i == 2) || ($i == 3) || ($i == $nb_page) || ($i == ($nb_page-1)) || ($i == ($nb_page-2)))
{
if ((($p + 1) <= ($nb_page - 4)) && ($i == ($nb_page - 2)) && $nb_page != 6)echo "... ";
if ($i <> $p)
{
echo "<a href=\"" . $url . "&p=" . $i . "\">" . $i . "</a>";
}
else
{
echo "<b>[" . $i . "]</b>";
}
if ($nb_page != $i)
{
echo" ";
}
if ((($p - 1) >= 5) && ($i == 3) && $nb_page != 6)
{
echo "... ";
}
}
$i++;
}
$end = $start + $nb_ligne;
if (($count > $end) && $p < $nb_page)
{
$end = $p + 1;
echo" <a href=\"" . $url . "&p=" . $end . "\" title=\"" . _NEXTPAGE . "\">></a>";
}
echo "<br />";
}
}
function nbvisiteur()
{
global $user, $nuked, $user_ip;
$limite = time() + $nuked['nbc_timeout'];
$time = time();
$req = mysql_query("DELETE FROM " . NBCONNECTE_TABLE . " WHERE date < " . $time);
if ($user_ip != "")
{
if ($user[0] != "")
{
$where = "WHERE user_id='" . $user[0] . "'";
}
else
{
$where = "WHERE IP='" . $user_ip . "'";
}
$req = mysql_query("SELECT IP FROM " . NBCONNECTE_TABLE . " " . $where);
$query = mysql_num_rows($req);
if ($query > 0)
{
if ($user[0] != "")
{
$req = mysql_query("UPDATE " . NBCONNECTE_TABLE . " SET date = '" . $limite . "', type = '" . $user[1] . "', IP = '" . $user_ip . "', username = '" . $user[2] . "' WHERE user_id = '" . $user[0] . "'");
}
else
{
$req = mysql_query("UPDATE " . NBCONNECTE_TABLE . " SET date = '" . $limite . "', type = '" . $user[1] . "', user_id = '" . $user[0] . "', username = '" . $user[2] . "' WHERE IP = '" . $user_ip . "'");
}
}
else
{
$del = mysql_query("DELETE FROM " . NBCONNECTE_TABLE . " WHERE IP = '" . $user_ip . "'");
$req = mysql_query("INSERT INTO " . NBCONNECTE_TABLE . " ( 'IP' , 'type' , 'date' , 'user_id' , 'username' ) VALUES ( '" . $user_ip . "' , '" . $user[1] . "' , '" . $limite . "' , '" . $user[0] . "' , '" . $user[2] . "' )");
}
}
$res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type = 0");
$count[0] = mysql_num_rows($res);
$res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type BETWEEN 1 AND 2");
$count[1] = mysql_num_rows($res);
$res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type > 2");
$count[2] = mysql_num_rows($res);
$count[3] = $count[1] + $count[2];
$count[4] = $count[0] + $count[3];
return $count;
}
function nivo_mod($mod)
{
$sql = mysql_query("SELECT niveau FROM " . MODULES_TABLE . " WHERE nom = '" . $mod . "'");
list($niveau) = mysql_fetch_array($sql);
return $niveau;
}
function admin_mod($mod)
{
$sql = mysql_query("SELECT admin FROM " . MODULES_TABLE . " WHERE nom = '" . $mod . "'");
list($admin) = mysql_fetch_array($sql);
return $admin;
}
function translate($file_lang)
{
global $nuked;
ob_start();
print eval(" include ('$file_lang'); ");
$lang_define = ob_get_contents();
$lang_define = htmlentities($lang_define, ENT_NOQUOTES);
$lang_define = eregi_replace("<", "<", $lang_define);
$lang_define = eregi_replace(">", ">", $lang_define);
ob_end_clean();
return $lang_define;
}
function compteur($file)
{
$upd = mysql_query("UPDATE " . STATS_TABLE . " SET count = count + 1 WHERE type = 'pages' AND nom = '" . $file . "'");
}
function visits()
{
global $nuked, $user_ip, $user;
$time = time();
$timevisit = $nuked['visit_delay'] * 60;
$limite = $time + $timevisit;
if ($user)
{
$sql = mysql_query("SELECT id, date FROM " . STATS_VISITOR_TABLE . " WHERE user_id = '" . $user[0] . "' ORDER by date DESC LIMIT 0, 1");
}
else
{
$sql = mysql_query("SELECT id, date FROM " . STATS_VISITOR_TABLE . " WHERE ip = '" . $user_ip . "' ORDER by date DESC LIMIT 0, 1");
}
list($id, $date) = mysql_fetch_array($sql);
if ($id != "" && $date > $time)
{
$upd = mysql_query("UPDATE " . STATS_VISITOR_TABLE . " SET date = '" . $limite . "' WHERE id = '" . $id . "'");
}
else
{
$month = strftime("%m", $time);
$year = strftime("%Y", $time);
$day = strftime("%d", $time);
$hour = strftime("%H", $time);
$user_referer = $_SERVER['HTTP_REFERER'];
$user_host = strtolower(@gethostbyaddr($user_ip));
$user_agent = $_SERVER['HTTP_USER_AGENT'];
// Correction de la faille
$user_referer = addslashes($user_referer);
if ($user_host == $user_ip)
{
$host = "";
}
else
{
if (ereg('([^.]{1,})((\.(co|com|net|org|edu|gov|mil))|())((\.(ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|fx|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zr|zw))|())$', $user_host, $res))
$host = $res[0];
}
if ((ereg("Nav", $user_agent)) || (ereg("Gold", $user_agent)) || (ereg("X11", $user_agent)) || (ereg("Netscape", $user_agent)) AND (!ereg("MSIE", $user_agent)))
{
$browser = "Netscape";
} else if (ereg("MSIE", $user_agent))
{
$browser = "Internet Explorer";
} else if (ereg("Firefox", $user_agent))
{
$browser = "Firefox";
} else if (ereg("Mozilla", $user_agent))
{
$browser = "Mozilla";
} else if (ereg("Lynx", $user_agent))
{
$browser = "Lynx";
} else if (ereg("Opera", $user_agent))
{
$browser = "Opera";
} else if (ereg("WebTV", $user_agent))
{
$browser = "WebTV";
} else if (ereg("Konqueror", $user_agent))
{
$browser = "Konqueror";
} else if ((eregi("bot", $user_agent)) || (ereg("Google", $user_agent)) || (ereg("Slurp", $user_agent)) || (ereg("Scooter", $user_agent)) || (eregi("Spider", $user_agent)) || (eregi("Infoseek", $user_agent)))
{
$browser = "Moteurs de recherche";
}
else
{
$browser = "Autres";
}
if ((ereg("Windows NT 6.0", $user_agent)) || (ereg("Windows Vista", $user_agent)) || (ereg("NT 6.0", $user_agent)) || (ereg("Vista", $user_agent)))
{
$os = "Windows Vista";
}else if ((ereg("Windows NT 5.1", $user_agent)) || (ereg("Windows XP", $user_agent)) || (ereg("NT 5.1", $user_agent)) || (ereg("XP", $user_agent)))
{
$os = "Windows XP";
} else if ((ereg("Windows NT 5.0", $user_agent)) || (ereg("Windows 2000", $user_agent)) || (ereg("NT 5.0", $user_agent)) || (ereg("2000", $user_agent)))
{
$os = "Windows 2000";
} else if ((ereg("Windows NT 4.0", $user_agent)) || (ereg("WinNT4.0", $user_agent)) || (ereg("NT 4.0", $user_agent)) || (ereg("NT", $user_agent)))
{
$os = "Windows NT 4.0";
} else if ((ereg("Win 9x 4.90", $user_agent)) || (ereg("Windows ME", $user_agent)) || (ereg("4.90", $user_agent)) || (ereg("Me", $user_agent)))
{
$os = "Windows ME";
} else if ((ereg("Windows 98", $user_agent)) || (ereg("Win98", $user_agent)) || (ereg("98", $user_agent)))
{
$os = "Windows 98";
} else if ((ereg("Win95", $user_agent)) || (ereg("95", $user_agent)))
{
$os = "Windows 95";
} else if ((ereg("Mac", $user_agent)) || (ereg("PPC", $user_agent)))
{
$os = "Mac";
} else if (ereg("Linux", $user_agent))
{
$os = "Linux";
} else if (ereg("FreeBSD", $user_agent))
{
$os = "FreeBSD";
} else if (ereg("SunOS", $user_agent))
{
$os = "SunOS";
} else if (ereg("IRIX", $user_agent))
{
$os = "IRIX";
} else if (ereg("BeOS", $user_agent))
{
$os = "BeOS";
} else if (ereg("OS/2", $user_agent))
{
$os = "OS/2";
} else if (ereg("AIX", $user_agent))
{
$os = "AIX";
}
else
{
$os = "Autres";
}
$sql2 = mysql_query("INSERT INTO " . STATS_VISITOR_TABLE . " ( 'id' , 'user_id' , 'ip' , 'host' , 'browser' , 'os' , 'referer' , 'day' , 'month' , 'year' , 'hour' , 'date' ) VALUES ( '' , '" . $user[0] . "' , '" . $user_ip . "' , '" . $host . "' , '" . $browser . "' , '" . $os . "' , '" . $user_referer . "' , '" . $day . "' , '" . $month . "' , '" . $year . "' , '" . $hour . "' , '" . $limite . "' )");
}
}
function verif_pseudo($string = '')
{
global $nuked;
$string = trim($string);
if (!$string || ($string == '') || (ereg("[\$\^\(\)'\"?%#<>,;:]", $string)))
{
$string = 'error1';
}
if ($string != 'error1')
{
$sql = mysql_query("SELECT pseudo FROM " . USER_TABLE . " WHERE pseudo = '" . $string . "'");
$is_reg = mysql_num_rows($sql);
if ($is_reg > 0)
{
$string = 'error2';
}
}
if ($string != 'error1' && $string != 'error2')
{
$sql2 = mysql_query("SELECT pseudo FROM " . BANNED_TABLE . " WHERE pseudo = '" . $string . "'");
$is_reg2 = mysql_num_rows($sql2);
if ($is_reg2 > 0)
{
$string = 'error3';
}
}
return($string);
}
function nk_CSS($str)
{
if ($str != "")
{
$str = eregi_replace("content-disposition:","content-disposition:",$str);
$str = eregi_replace("content-type:","content-type:",$str);
$str = eregi_replace("content-transfer-encoding:","content-transfer-encoding:",$str);
$str = eregi_replace("include","include",$str);
$str = eregi_replace("\<\?","<?",$str);
$str = eregi_replace("<\?php","<?php",$str);
$str = eregi_replace("\?\>","?>",$str);
$str = eregi_replace("script","script",$str);
$str = eregi_replace("eval","eval",$str);
$str = eregi_replace("javascript","javascript",$str);
$str = eregi_replace("embed","embed",$str);
$str = eregi_replace("iframe","iframe",$str);
$str = eregi_replace("refresh", "refresh", $str);
$str = eregi_replace("onload", "onload", $str);
$str = eregi_replace("onstart", "onstart", $str);
$str = eregi_replace("onerror", "onerror", $str);
$str = eregi_replace("onabort", "onabort", $str);
$str = eregi_replace("onblur", "onblur", $str);
$str = eregi_replace("onchange", "onchange", $str);
$str = eregi_replace("onclick", "onclick", $str);
$str = eregi_replace("ondblclick", "ondblclick", $str);
$str = eregi_replace("onfocus", "onfocus", $str);
$str = eregi_replace("onkeydown", "onkeydown", $str);
$str = eregi_replace("onkeypress", "onkeypress", $str);
$str = eregi_replace("onkeyup", "onkeyup", $str);
$str = eregi_replace("onmousedown", "onmousedown", $str);
$str = eregi_replace("onmousemove", "onmousemove", $str);
$str = eregi_replace("onmouseover", "onmouseover", $str);
$str = eregi_replace("onmouseout", "onmouseout", $str);
$str = eregi_replace("onmouseup", "onmouseup", $str);
$str = eregi_replace("onreset", "onreset", $str);
$str = eregi_replace("onselect", "onselect", $str);
$str = eregi_replace("onsubmit", "onsubmit", $str);
$str = eregi_replace("onunload", "onunload", $str);
$str = eregi_replace("document", "document", $str);
$str = eregi_replace("cookie", "cookie", $str);
$str = eregi_replace("vbscript", "vbscript", $str);
$str = eregi_replace("location", "location", $str);
$str = eregi_replace("object", "object", $str);
$str = eregi_replace("vbs", "vbs", $str);
$str = eregi_replace("href", "href", $str);
$str = eregi_replace("src", "src", $str);
$str = eregi_replace("expression", "expression", $str);
$str = eregi_replace("alert", "alert", $str);
}
return($str);
}
function trunc_hyperlink($texte)
{
$texte = preg_replace("/([a-zA-Z]+:\/\/[a-z0-9\_\.\-]+".
"[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%\=\,\.\;\#\_]+)/i",
"[<a href=\"$1\" onclick=\"window.open(this.href); return false;\">" . _TLINK . "</a>]", $texte, -1);
$texte = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1[<a href="[[http:// ]]\2.\3" onclick="window.open(this.href); return false;" title="[[http:// ]]\2.\3">' . _TLINK . '</a>]', $texte);
$texte = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1[<a href=\"mailto:\\2@\\3\" title=\"\\2@\\3\">" . _TMAIL . "</a>]", $texte);
return($texte);
}
?>
si quelqu'un sais comment résoudre mon, probleme
merci
Afficher la suite