Patch php

Bonjour,
Bonjour,j'ai un petit probleme je voudrais mettre sur mon site le patch (qui est en ligne),donc je telecharge le patch et le probleme c'est que si je change le fichier viewtopic sur mon ftp ca marche mais il me retire mon autre patch reponse rapide.Donc j'ai essayer de les fusionner avec le logiciel WINMERGE mais cela ne fonctionne pas merci de m'aider pour ce probleme car j'ai des autres fichier aussi en attente pour faire pareil amicalement scania500.
Configuration: Windows Vista
Safari 530.5

13 réponses

  1. Je voudrais fusionner 2 fichiers php ensemble,car j'ai sur mon site un patch (qui est en ligne) et je voudrais mettre aussi un patch (reponse rapide) mais le probleme quand j installe un patch l'autre ce retire car le fichier a installer et viewtopic et les 2 patch on un fichier viewtopic donc j'essai de les fusionner avec WINMERGE mais ca fonctionne pas voila j'epere que c'est clair et excuser moi de mal m'exprimer cordialement.
    1. Bah je suis désolé car moi je ne comprends rien du tout... En espérant pour toi que quelqu'un d'autre comprenne...
      1. Bin c'est simple pourtant je m'exprime quand meme xd.

        j'ai 2 fichier viewtopic.php 1 s'appel (reponse rapide) et l'autre (qui est en ligne) et je voudrais mettre les 2 patchs ensemble mais cela n'est pas possible car quand je l'installe le patch (qui est en ligne) automatiquement il me vire le patch (reponse rapide) puisque c'est les meme fichier ,donc je cherche un moyen de mettre les codes de reponse rapide sur le fichier php de (qui est en ligne) voila c'est bon là j'espere xd ^^.
        1. c'est ça que je cherche a faire mais pas moyen.Je les fait avec lelogiciel WINMERGE mais ça va pas .
          1. Pourquoi te servir d'un logiciel ?

            Ouvres tes fichiers avec bloc-note et balances nous les codes PHP !
            1. premier code

              <?php
              // -------------------------------------------------------------------------//
              // Nuked-KlaN - 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. //
              // -------------------------------------------------------------------------//
              if (!defined("INDEX_CHECK"))
              {
              die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
              }

              global $nuked, $user, $language, $theme, $thread_id, $forum_id, $p, $vote, $highlight;

              translate("modules/Forum/lang/" . $language . ".lang.php");
              include("modules/Forum/template.php");

              opentable();

              if (!$user)
              {
              $visiteur = 0;
              }
              else
              {
              $visiteur = $user[1];
              }
              $ModName = basename(dirname(__FILE__));
              $level_access = nivo_mod($ModName);
              if ($visiteur >= $level_access && $level_access > -1)
              {
              $nb_mess_for_mess = $nuked[mess_forum_page];

              $sql = mysql_query("SELECT nom, moderateurs, cat, level FROM " . FORUM_TABLE . " WHERE " . $visiteur . " >= niveau AND id = '" . $forum_id . "'");
              $level_ok = mysql_num_rows($sql);

              $sql2 = mysql_query("SELECT titre, view, closed, annonce, last_post, auteur_id, sondage FROM " . FORUM_THREADS_TABLE . " WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");
              $topic_ok = mysql_num_rows($sql2);

              if ($level_ok == 0)
              {
              echo "<br /><br /><div style=\"text-align: center;\">" . _NOACCESSFORUM . "</div><br /><br />";
              }
              else if ($topic_ok == 0)
              {
              echo "<br /><br /><div style=\"text-align: center;\">" . _NOTOPICEXIST . "</div><br /><br />";
              }
              else
              {
              list($nom, $modos, $cat, $level) = mysql_fetch_array($sql);
              $nom = stripslashes($nom);
              $nom = htmlentities($nom);

              $sql_cat = mysql_query("SELECT nom FROM " . FORUM_CAT_TABLE . " WHERE id = '" . $cat . "'");
              list($cat_name) = mysql_fetch_array($sql_cat);
              $cat_name = stripslashes($cat_name);
              $cat_name = htmlentities($cat_name);

              if ($user && $modos != "" && ereg($user[0], $modos))
              {
              $administrator = 1;
              }
              else
              {
              $administrator = 0;
              }

              list($titre, $read, $closed, $annonce, $lastpost, $topic_aid, $sondage) = mysql_fetch_array($sql2);
              $titre = stripslashes($titre);
              $titre = htmlentities($titre);
              $titre = nk_CSS($titre);

              $upd = mysql_query("UPDATE " . FORUM_THREADS_TABLE . " SET view = view + 1 WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");

              $sql_next = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post > " . $lastpost. " AND forum_id = '" . $forum_id . "' ORDER BY last_post LIMIT 0, 1");
              list($nextid) = mysql_fetch_array($sql_next);

              if ($nextid != "")
              {
              $next = "<small><a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $nextid . "\">" . _NEXTTHREAD . "</a> ></small>";
              }

              $sql_last = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post < " . $lastpost . " AND forum_id = '" . $forum_id . "' ORDER BY last_post DESC LIMIT 0, 1");
              list($lastid) = mysql_fetch_array($sql_last);

              if ($lastid != "")
              {
              $prev = "<small>< <a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $lastid . "\">" . _LASTTHREAD . "</a> </small>";
              }

              echo "<br /><a name=\"top\"></a><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\">\n"
              . "<tr><td><big><b>" . $titre . "</b></big></td><td align=\"right\">" . $prev . " " . $next . "</td></tr>\n"
              . "<tr><td valign=\"bottom\"><a href=\"index.php?file=Forum\"><b>" . _INDEXFORUM . "</b></a> -> <a href=\"index.php?file=Forum&cat=" . $cat . "\"><b>" . $cat_name . "</b></a> -> <a href=\"index.php?file=Forum&page=viewforum&forum_id=" . $forum_id . "\"><b>" . $nom . "</b></a>\n";

              $sql3 = mysql_query("SELECT thread_id FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "'");
              $count = mysql_num_rows($sql3);

              if (!$p) $p = 1;
              $start = $p * $nb_mess_for_mess - $nb_mess_for_mess;

              if ($highlight != "")
              {
              $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
              }
              else
              {
              $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
              }

              if ($count > $nb_mess_for_mess)
              {
              echo "<br /><br />\n";
              number($count, $nb_mess_for_mess, $url_page);
              }

              echo "</td><td align=\"right\" valign=\"bottom\">";

              if ($level == 0 || $visiteur >= $level || $administrator == 1)
              {
              echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

              if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
              {
              echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
              }
              }

              echo "</td></tr></table>\n"
              . "<table style=\"background: " . $color3 . ";\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">\n";

              if ($sondage == 1)
              {
              echo "<tr style=\"background: " . $color2 . ";\"><td colspan=\"2\" align=\"center\">";

              $sql_poll = mysql_query("SELECT id, titre FROM " . FORUM_POLL_TABLE . " WHERE thread_id = '" . $thread_id . "'");
              list($poll_id, $question) = mysql_fetch_array($sql_poll);
              $question = stripslashes($question);
              $question = htmlentities($question);

              if ($user && $topic_aid == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Forum&op=edit_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" alt=\"\" title=\"" . _EDITPOLL . "\" /></a> <a href=\"index.php?file=Forum&op=del_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELPOLL . "\" /></a> </div>\n";
              }

              $check = mysql_query("SELECT auteur_ip FROM " . FORUM_VOTE_TABLE . " WHERE poll_id = '" . $poll_id . "' AND auteur_id = '" . $user[0] . "'");
              $test = mysql_num_rows($check);

              if ($user && $test > 0 || $vote == "view")
              {
              echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"2\" cellpadding=\"4\" border=\"0\">\n"
              . "<tr><td colspan=\"2\" align=\"center\"><b>" . $question . "</b></td></tr>\n";

              $sql_options = mysql_query("SELECT option_vote FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
              $nbcount = 0;

              while (list($option_vote) = mysql_fetch_array($sql_options))
              {
              $nbcount = $nbcount + $option_vote;
              }

              $sql_res = mysql_query("SELECT option_vote, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
              while (list($optioncount, $option_text) = mysql_fetch_array($sql_res))
              {
              $optiontext = stripslashes($option_text);
              $optiontext = htmlentities($option_text);

              if ($nbcount <> 0)
              {
              $etat = ($optioncount * 100) / $nbcount ;
              }
              else
              {
              $etat = 0;
              }

              $pourcent_arrondi = round($etat);

              echo "<tr><td>" . $optiontext . "</td><td>";

              if ($etat < 1)
              {
              $width = 2;
              }
              else
              {
              $width = $etat * 2;
              }

              if (is_file("themes/" . $theme . "/images/bar.gif"))
              {
              $img = "themes/" . $theme . "/images/bar.gif";
              }
              else
              {
              $img = "modules/Forum/images/bar.gif";
              }

              echo "<img src=\"" . $img . "\" width=\"" . $width . "\" height=\"10\" alt=\"\" title=\"" . $pourcent_arrondi . "%\" /> " . $pourcent_arrondi . "% (" . $optioncount . ")</td></tr>\n";
              }
              echo "<tr></tr><td align=\"center\" colspan=\"2\"><b>" . _TOTALVOTE . " : </b>" . $nbcount . "</td></tr></table>\n";
              }
              else
              {
              echo "<form method=\"post\" action=\"index.php?file=Forum&op=vote&poll_id=" . $poll_id . "\">\n"
              . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n"
              . "<tr><td align=\"center\"><b>" . $question . "</b></td></tr>\n";

              $sql_options = mysql_query("SELECT id, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
              while (list($voteid, $optiontext) = mysql_fetch_array($sql_options))
              {
              $optiontext = stripslashes($optiontext);
              $optiontext = htmlentities($optiontext);

              echo "<tr><td><input type=\"radio\" class=\"checkbox\" name=\"voteid\" value=\"" . $voteid . "\" /> " . $optiontext . "</td></tr>\n";
              }

              echo "<tr><td> <input type=\"hidden\" name=\"forum_id\" value=\"" . $forum_id . "\" /><input type=\"hidden\" name=\"thread_id\" value=\"" . $thread_id . "\" /></td></tr>\n"
              . "<tr><td align=\"center\"><input type=\"submit\" value=\"" . _TOVOTE . "\" /> <input type=\"button\" value=\"" . _RESULT . "\" onclick=\"document.location='index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&vote=view'\" /></td></tr></table></form>\n";
              }

              echo "</td></tr>\n";
              }

              echo "<tr " . $background . "><td style=\"width: 25%;\" align=\"center\"><b>" . _AUTHOR . "</b></td><td style=\"width: 75%;\" align=\"center\"><b>" . _MESSAGE . "</b></td></tr>\n";

              $sql4 = mysql_query("SELECT id, titre, auteur, auteur_id, auteur_ip, txt, date, edition, bbcodeoff, smileyoff, cssoff, usersig, file FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' ORDER BY date ASC limit " . $start . ", " . $nb_mess_for_mess);
              while (list($mess_id, $title, $auteur, $auteur_id, $auteur_ip, $txt, $date, $edition, $bbcodeoff, $smileyoff, $cssoff, $usersig, $fichier) = mysql_fetch_row($sql4))
              {
              $txt = stripslashes($txt);
              $title = stripslashes($title);
              $auteur = stripslashes($auteur);

              if ($highlight != "")
              {
              $string = trim($highlight);
              $search = explode(" ", $string);

              for($i = 0; $i < count($search); $i++)
              {
              $words = preg_quote($search[$i]);
              $title = eregi_replace($words, "<span style=\"color: #FF0000;\">" . $words . "</span>", $title);

              if ($bbcodeoff == 0)
              {
              $txt = eregi_replace($words, "[color= #FF0000][b]" . $words . "/b/color", $txt);
              }
              else
              {
              $txt = eregi_replace($words, "<span style=\"color: #FF0000;\"><b>" . $words . "</b></span>", $txt);
              }
              }

              }

              $title = htmlentities($title, ENT_NOQUOTES);
              $title = eregi_replace("<", "<", $title);
              $title = eregi_replace(">", ">", $title);

              if ($bbcodeoff == 0)
              {
              $txt = htmlentities($txt);
              }
              else
              {
              $txt = htmlentities($txt, ENT_NOQUOTES);

              $txt = eregi_replace("<", "<", $txt);
              $txt = eregi_replace(">", ">", $txt);
              }

              if ($cssoff == 0)
              {
              $title = nk_CSS($title);
              $txt = nk_CSS($txt);
              $auteur = nk_CSS($auteur);
              }

              if ($bbcodeoff == 0) $txt = BBcode($txt);
              if ($smileyoff == 0) $txt = icon($txt);

              if (strftime("%d %m %Y", time()) == strftime("%d %m %Y", $date)) $date = _FTODAY . " " . strftime("%H:%M", $date);
              else if (strftime("%d", $date) == (strftime("%d", time()) - 1) && strftime("%m %Y", time()) == strftime("%m %Y", $date)) $date = _FYESTERDAY . " " . strftime("%H:%M", $date);
              else $date = _THE . " " . strftime("%x %H:%M", $date);

              $tmpcnt++ % 2 == 1 ? $color = $color1 : $color = $color2;

              echo "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"top\"><a name=\"" . $mess_id . "\"></a>";

              if ($auteur_id != "")
              {
              $sq_user = mysql_query("SELECT pseudo, niveau, rang, avatar, signature, date, email, icq, msn, aim, yim, url, count FROM " . USER_TABLE . " WHERE id = '" . $auteur_id . "'");
              $test = mysql_num_rows($sq_user);
              list($autor, $user_level, $rang, $avatar, $signature, $date_member, $email, $icq, $msn, $aim, $yim, $homepage, $nb_post) = mysql_fetch_array($sq_user);

              if ($test > 0 && $autor != "")
              {
              $date_member = strftime("%x", $date_member);

              if ($signature != "")
              {
              $signature = stripslashes($signature);
              $signature = nk_CSS($signature);
              if ($signature_resize == "on") $signature = preg_replace("/\[img\](.*?)\[\/img\]/e", "resize_signature('\\1')", $signature);
              $signature = BBcode($signature);
              }

              if ($fichier != "" && is_file("upload/Forum/" . $fichier))
              {
              $url_file = "upload/Forum/" . $fichier;
              $filesize = filesize($url_file) / 1024;
              $arrondi_size = ceil($filesize);
              $file = explode(".", $fichier);
              $ext = count($file)-1;

              if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              $del = " <a href=\"index.php?file=Forum&op=del_file&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/del.gif\" alt=\"\" title=\"" . _DELFILE . "\" /></a>";
              }
              else
              {
              $del = "";
              }

              $attach_file = "<br /><img src=\"modules/Forum/images/file.gif\" alt=\"\" title=\"" . _ATTACHFILE . "\" /><a href=\"" . $url_file . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _DOWNLOADFILE . "\">" . $fichier . "</a> (" . $arrondi_size . " Ko)" . $del;
              }
              else
              {
              $attach_file = "";
              }

              if ($modos != "" && ereg($auteur_id, $modos))
              {
              $auteur_modo = 1;
              }
              else
              {
              $auteur_modo = 0;
              }

              if ($rang > 0 && $nuked['forum_rank_team'] == "on")
              {
              $sql_rank_team = mysql_query("SELECT titre FROM " . TEAM_RANK_TABLE . " WHERE id = '" . $rang . "'");
              list($rank_name) = mysql_fetch_array($sql_rank_team);
              $rank_name = stripslashes($rank_name);
              $rank_name = htmlentities($rank_name);
              $rank_image = "";
              }
              else
              {
              if ($user_level >= admin_mod("Forum"))
              {
              $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 2");
              }
              else if ($auteur_modo == 1)
              {
              $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 1");
              }
              else
              {
              $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE " . $nb_post . " >= post AND type = 0 ORDER BY post DESC LIMIT 0, 1");
              }

              list($rank_name, $rank_image) = mysql_fetch_array($user_rank);
              $rank_name = stripslashes($rank_name);
              $rank_name = htmlentities($rank_name);
              }

              echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\"><b>" . $autor . "</b></a><br />\n";

              if ($rank_name != "")
              {
              echo $rank_name . "<br />\n";
              }

              if ($rank_image != "")
              {
              echo "<img src=\"" . $rank_image . "\" alt=\"\" /><br /><br />\n";
              }

              if ($avatar != "")
              {
              if ($avatar_resize == "off") $ar_ok = 0;
              else if (eregi("http://", $avatar) && $avatar_resize == "local") $ar_ok = 0;
              else $ar_ok = 1;

              if (!eregi("%20", $avatar) && $ar_ok == 1) list($w, $h, $type, $attr) = @getimagesize($avatar);
              if ($w != "" && $w <= $avatar_width) $width = "width=\"" . $w . "\" ";
              else if ($w != "") $width = "width=\"" . $avatar_width . "\" ";
              else $width = "";
              echo "<img src=\"" . $avatar . "\" " . $width . "alt=\"\" /><br />\n";
              }

              $online_connect = mysql_query("SELECT user_id FROM " . NBCONNECTE_TABLE . " WHERE user_id = '" . $auteur_id . "'");
              list($connect_id) = mysql_fetch_array($online_connect);

              if($auteur_id == $connect_id)
              {
              $online = _STATUT . " : <span style=\"color: limegreen;\"><b>" . _ONLINE2 . "</b></span>\n";
              }
              else
              {
              $online = _STATUT . " : <span style=\"color: red;\"><b>" . _OFFLINE . "</b></span>\n";
              }

              echo _MESSAGES . " : " . $nb_post . "<br />" . _REGISTERED . ": " . $date_member . "<br />" . $online . "<br />\n";

              if ($visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo _IP . " : " . $auteur_ip;
              }
              }
              else
              {
              echo "<b>" . $auteur . "</b><br />\n";

              if ($visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo _IP . " : " . $auteur_ip;
              }
              }
              }
              else
              {
              echo "<b>" . $auteur . "</b><br />\n";

              if ($visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo _IP . " : " . $auteur_ip;
              }
              }

              echo "</td><td style=\"width: 75%;\" valign=\"top\">\n"
              . "<table width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n"
              . "<tr><td><img src=\"images/posticon.gif\" alt=\"\" />" . _POSTEDON . " " . $date . "  " . $attach_file . "</td><td align=\"right\">";

              if ($closed == 0 && $administrator == 1 || $visiteur >= admin_mod("Forum") || $visiteur >= $level)
              {
              echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "&do=quote\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/quote.gif\" alt=\"\" title=\"" . _REPLYQUOTE . "\" /></a>";
              }

              if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo " <a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&mess_id=" . $mess_id . "&do=edit\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" title=\"" . _EDITMESSAGE . "\" alt=\"\" /></a>";
              }

              if ($visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo " <a href=\"index.php?file=Forum&op=del&mess_id=" . $mess_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELMESSAGE . "\" /></a>";
              }

              echo "</td></tr><tr style=\"background: " . $color . ";\"><td colspan=\"2\"><b>" . $title . "</b></td></tr>\n"
              . "<tr style=\"background: " . $color . ";\"><td colspan=\"2\">" . $txt . "<br /><br /></td></tr>\n";

              if ($edition != "")
              {
              echo "<tr style=\"background: " . $color . ";\"><td colspan=\"2\"><small><i>" . $edition . "</i></small></td></tr>\n";
              }

              if ($auteur_id != "" && $signature != "" && $usersig == 1)
              {
              echo "<tr style=\"background: " . $color . ";\"><td style=\"border-top: 1px dashed " . $color3 . ";\" colspan=\"2\">" . $signature . "</td></tr>\n";
              }

              echo "</table></td></tr>\n"
              . "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"middle\"><a href=\"#top\"><b>" . _BACKTOTOP . "</b></a></td><td style=\"width: 75%;\" valign=\"bottom\">";

              if ($auteur_id != "")
              {
              echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\" title=\"" . _SEEPROFIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/profile.gif\" alt=\"\" /></a>";
              }

              if ($user && $auteur_id != "")
              {
              echo "<a href=\"index.php?file=Userbox&op=post_message&for=" . $auteur_id . "\" title=\"" . _SENDPM . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/message.gif\" alt=\"\" /></a>";
              }

              if ($email != "" && $auteur_id != "")
              {
              echo "<a href=\"mailto:" . $email . "\" title=\"" . _SENDEMAIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/email.gif\" alt=\"\" /></a>";
              }

              if ($homepage != "" && $auteur_id != "")
              {
              echo "<a href=\"" . $homepage . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _SEEHOMEPAGE . " " . $autor . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/website.gif\" alt=\"\" /></a>";
              }

              if ($icq != "" && $auteur_id != "")
              {
              echo "<a href=\"https://web.icq.com?from=/whitepages/add_me&uin=" . $icq . "&action=add\"><img style=\"border: 0;\" src=\"modules/Forum/images/icq.gif\" title=\"" . $icq . "\" alt=\"\" /></a>";
              }

              if ($msn != "" && $auteur_id != "")
              {
              echo "<a href=\"mailto:" . $msn . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/msn.gif\" title=\"" . $msn . "\" alt=\"\" /></a>";
              }

              if ($aim != "" && $auteur_id != "")
              {
              echo "<a href=\"aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there+?\" onclick=\"window.open(this.href); return false;\"><img style=\"border: 0;\" src=\"modules/Forum/images/aol.gif\" title=\"" . $aim . "\" alt=\"\" /></a>";
              }

              if ($yim != "" && $auteur_id != "")
              {
              echo "<a href=\"https://fr.yahoo.com/?p=us" . $yim . "&src=pg\"><img style=\"border: 0;\" src=\"modules/Forum/images/yim.gif\" title=\"" . $yim . "\" alt=\"\" /></a>";
              }

              echo "</td></tr>\n";
              }

              echo "</table><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td valign=\"top\">";

              if ($highlight != "")
              {
              $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
              }
              else
              {
              $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
              }

              if ($count > $nb_mess_for_mess)
              {
              number($count, $nb_mess_for_mess, $url_page);
              }

              echo "</td><td align=\"right\" valign=\"top\">";

              if ($user[0] != "")
              {
              $sql_notify = mysql_query("SELECT emailnotify FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' AND auteur_id = '" . $user[0] . "'");
              $user_notify = mysql_num_rows($sql_notify);

              if ($user_notify > 0)
              {
              $inotify = 0;
              while(list($notify) = mysql_fetch_array($sql_notify))
              {
              if ($notify == 1)
              {
              $inotify++;
              }

              }

              if ($inotify > 0)
              {
              echo "<a href=\"index.php?file=Forum&op=notify&do=off&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYOFF . "</a><br />\n";
              }
              else
              {
              echo "<a href=\"index.php?file=Forum&op=notify&do=on&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYON . "</a><br />\n";
              }

              }

              }

              if ($level == 0 || $visiteur >= $level || $administrator == 1)
              {
              echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

              if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
              {
              echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
              }

              }

              echo "</td></tr></table>\n";

              if ($visiteur >= admin_mod("Forum") || $administrator == 1)
              {
              echo "<br /><a href=\"index.php?file=Forum&op=del_topic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_delete.gif\" alt=\"\" title=\"" . _TOPICDEL . "\" /></a>"
              . " <a href=\"index.php?file=Forum&op=move&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_move.gif\" alt=\"\" title=\"" . _TOPICMOVE . "\" /></a>";

              if ($closed == 1)
              {
              echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=open\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_unlock.gif\" alt=\"\" title=\"" . _TOPICUNLOCK . "\" /></a>";
              }
              else
              {
              echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=close\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_lock.gif\" alt=\"\" title=\"" . _TOPICLOCK . "\" /></a>";
              }

              if ($annonce == 1)
              {
              echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=down\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_down.gif\" alt=\"\" title=\"" . _TOPICDOWN . "\" /></a>";
              }
              else
              {
              echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=up\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_up.gif\" alt=\"\" title=\"" . _TOPICUP . "\" /></a>";
              }
              }

              if ($user)
              {
              $visit = mysql_query("SELECT id FROM " . FORUM_READ_TABLE . " WHERE thread_id = '" . $thread_id . "' AND forum_id = '" . $forum_id . "' AND user_id = '" . $user[0] . "'");
              $user_visit = mysql_num_rows($visit);

              if ($user_visit == 0)
              {
              $sql_visit = mysql_query("INSERT INTO " . FORUM_READ_TABLE . " ( `id` , `user_id` , `thread_id` , `forum_id` ) VALUES ( '' , '" . $user[0] . "' , '" . $thread_id . "' , '" . $forum_id . "' )");
              }
              }
              }
              }
              else if ($level_access == -1)
              {
              echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
              }
              else if ($level_access == 1 && $visiteur == 0)
              {
              echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b></div><br /><br />";
              }
              else
              {
              echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
              }

              function resize_signature($img_sign)
              {
              global $sign_width;

              $img_sign = checkimg($img_sign);
              $ext = strrchr($img_sign, '.');
              $ext = strtolower(substr($ext, 1));

              if ($ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png") $test = 1;
              else $test = 0;

              if (!eregi("%20", $img_sign) && $test == 1) list($w_sign, $h_sign, $t_sign, $at_sign) = @getimagesize($img_sign);

              if ($w_sign != "" && $w_sign <= $sign_width) $s_width = "width=\"" . $w_sign . "\" ";
              else if ($w_sign != "") $s_width = "width=\"" . $sign_width . "\" ";
              else $s_width = "";

              $image_signature = "<img src=\"" . $img_sign . "\" " . $s_width . "alt=\"\" />";
              return($image_signature);
              }

              closetable();

              ?>
              1. premier code

                <?php
                // -------------------------------------------------------------------------//
                // Nuked-KlaN - 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. //
                // -------------------------------------------------------------------------//
                if (!defined("INDEX_CHECK"))
                {
                die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
                }

                global $nuked, $user, $language, $theme, $thread_id, $forum_id, $p, $vote, $highlight;

                translate("modules/Forum/lang/" . $language . ".lang.php");
                include("modules/Forum/template.php");

                opentable();

                if (!$user)
                {
                $visiteur = 0;
                }
                else
                {
                $visiteur = $user[1];
                }
                $ModName = basename(dirname(__FILE__));
                $level_access = nivo_mod($ModName);
                if ($visiteur >= $level_access && $level_access > -1)
                {
                $nb_mess_for_mess = $nuked[mess_forum_page];

                $sql = mysql_query("SELECT nom, moderateurs, cat, level FROM " . FORUM_TABLE . " WHERE " . $visiteur . " >= niveau AND id = '" . $forum_id . "'");
                $level_ok = mysql_num_rows($sql);

                $sql2 = mysql_query("SELECT titre, view, closed, annonce, last_post, auteur_id, sondage FROM " . FORUM_THREADS_TABLE . " WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");
                $topic_ok = mysql_num_rows($sql2);

                if ($level_ok == 0)
                {
                echo "<br /><br /><div style=\"text-align: center;\">" . _NOACCESSFORUM . "</div><br /><br />";
                }
                else if ($topic_ok == 0)
                {
                echo "<br /><br /><div style=\"text-align: center;\">" . _NOTOPICEXIST . "</div><br /><br />";
                }
                else
                {
                list($nom, $modos, $cat, $level) = mysql_fetch_array($sql);
                $nom = stripslashes($nom);
                $nom = htmlentities($nom);

                $sql_cat = mysql_query("SELECT nom FROM " . FORUM_CAT_TABLE . " WHERE id = '" . $cat . "'");
                list($cat_name) = mysql_fetch_array($sql_cat);
                $cat_name = stripslashes($cat_name);
                $cat_name = htmlentities($cat_name);

                if ($user && $modos != "" && ereg($user[0], $modos))
                {
                $administrator = 1;
                }
                else
                {
                $administrator = 0;
                }

                list($titre, $read, $closed, $annonce, $lastpost, $topic_aid, $sondage) = mysql_fetch_array($sql2);
                $titre = stripslashes($titre);
                $titre = htmlentities($titre);
                $titre = nk_CSS($titre);

                $upd = mysql_query("UPDATE " . FORUM_THREADS_TABLE . " SET view = view + 1 WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");

                $sql_next = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post > " . $lastpost. " AND forum_id = '" . $forum_id . "' ORDER BY last_post LIMIT 0, 1");
                list($nextid) = mysql_fetch_array($sql_next);

                if ($nextid != "")
                {
                $next = "<small><a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $nextid . "\">" . _NEXTTHREAD . "</a> ></small>";
                }

                $sql_last = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post < " . $lastpost . " AND forum_id = '" . $forum_id . "' ORDER BY last_post DESC LIMIT 0, 1");
                list($lastid) = mysql_fetch_array($sql_last);

                if ($lastid != "")
                {
                $prev = "<small>< <a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $lastid . "\">" . _LASTTHREAD . "</a> </small>";
                }

                echo "<br /><a name=\"top\"></a><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\">\n"
                . "<tr><td><big><b>" . $titre . "</b></big></td><td align=\"right\">" . $prev . " " . $next . "</td></tr>\n"
                . "<tr><td valign=\"bottom\"><a href=\"index.php?file=Forum\"><b>" . _INDEXFORUM . "</b></a> -> <a href=\"index.php?file=Forum&cat=" . $cat . "\"><b>" . $cat_name . "</b></a> -> <a href=\"index.php?file=Forum&page=viewforum&forum_id=" . $forum_id . "\"><b>" . $nom . "</b></a>\n";

                $sql3 = mysql_query("SELECT thread_id FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                $count = mysql_num_rows($sql3);

                if (!$p) $p = 1;
                $start = $p * $nb_mess_for_mess - $nb_mess_for_mess;

                if ($highlight != "")
                {
                $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                }
                else
                {
                $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                }

                if ($count > $nb_mess_for_mess)
                {
                echo "<br /><br />\n";
                number($count, $nb_mess_for_mess, $url_page);
                }

                echo "</td><td align=\"right\" valign=\"bottom\">";

                if ($level == 0 || $visiteur >= $level || $administrator == 1)
                {
                echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                {
                echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                }
                }

                echo "</td></tr></table>\n"
                . "<table style=\"background: " . $color3 . ";\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">\n";

                if ($sondage == 1)
                {
                echo "<tr style=\"background: " . $color2 . ";\"><td colspan=\"2\" align=\"center\">";

                $sql_poll = mysql_query("SELECT id, titre FROM " . FORUM_POLL_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                list($poll_id, $question) = mysql_fetch_array($sql_poll);
                $question = stripslashes($question);
                $question = htmlentities($question);

                if ($user && $topic_aid == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Forum&op=edit_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" alt=\"\" title=\"" . _EDITPOLL . "\" /></a> <a href=\"index.php?file=Forum&op=del_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELPOLL . "\" /></a> </div>\n";
                }

                $check = mysql_query("SELECT auteur_ip FROM " . FORUM_VOTE_TABLE . " WHERE poll_id = '" . $poll_id . "' AND auteur_id = '" . $user[0] . "'");
                $test = mysql_num_rows($check);

                if ($user && $test > 0 || $vote == "view")
                {
                echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"2\" cellpadding=\"4\" border=\"0\">\n"
                . "<tr><td colspan=\"2\" align=\"center\"><b>" . $question . "</b></td></tr>\n";

                $sql_options = mysql_query("SELECT option_vote FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                $nbcount = 0;

                while (list($option_vote) = mysql_fetch_array($sql_options))
                {
                $nbcount = $nbcount + $option_vote;
                }

                $sql_res = mysql_query("SELECT option_vote, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                while (list($optioncount, $option_text) = mysql_fetch_array($sql_res))
                {
                $optiontext = stripslashes($option_text);
                $optiontext = htmlentities($option_text);

                if ($nbcount <> 0)
                {
                $etat = ($optioncount * 100) / $nbcount ;
                }
                else
                {
                $etat = 0;
                }

                $pourcent_arrondi = round($etat);

                echo "<tr><td>" . $optiontext . "</td><td>";

                if ($etat < 1)
                {
                $width = 2;
                }
                else
                {
                $width = $etat * 2;
                }

                if (is_file("themes/" . $theme . "/images/bar.gif"))
                {
                $img = "themes/" . $theme . "/images/bar.gif";
                }
                else
                {
                $img = "modules/Forum/images/bar.gif";
                }

                echo "<img src=\"" . $img . "\" width=\"" . $width . "\" height=\"10\" alt=\"\" title=\"" . $pourcent_arrondi . "%\" /> " . $pourcent_arrondi . "% (" . $optioncount . ")</td></tr>\n";
                }
                echo "<tr></tr><td align=\"center\" colspan=\"2\"><b>" . _TOTALVOTE . " : </b>" . $nbcount . "</td></tr></table>\n";
                }
                else
                {
                echo "<form method=\"post\" action=\"index.php?file=Forum&op=vote&poll_id=" . $poll_id . "\">\n"
                . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n"
                . "<tr><td align=\"center\"><b>" . $question . "</b></td></tr>\n";

                $sql_options = mysql_query("SELECT id, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                while (list($voteid, $optiontext) = mysql_fetch_array($sql_options))
                {
                $optiontext = stripslashes($optiontext);
                $optiontext = htmlentities($optiontext);

                echo "<tr><td><input type=\"radio\" class=\"checkbox\" name=\"voteid\" value=\"" . $voteid . "\" /> " . $optiontext . "</td></tr>\n";
                }

                echo "<tr><td> <input type=\"hidden\" name=\"forum_id\" value=\"" . $forum_id . "\" /><input type=\"hidden\" name=\"thread_id\" value=\"" . $thread_id . "\" /></td></tr>\n"
                . "<tr><td align=\"center\"><input type=\"submit\" value=\"" . _TOVOTE . "\" /> <input type=\"button\" value=\"" . _RESULT . "\" onclick=\"document.location='index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&vote=view'\" /></td></tr></table></form>\n";
                }

                echo "</td></tr>\n";
                }

                echo "<tr " . $background . "><td style=\"width: 25%;\" align=\"center\"><b>" . _AUTHOR . "</b></td><td style=\"width: 75%;\" align=\"center\"><b>" . _MESSAGE . "</b></td></tr>\n";

                $sql4 = mysql_query("SELECT id, titre, auteur, auteur_id, auteur_ip, txt, date, edition, bbcodeoff, smileyoff, cssoff, usersig, file FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' ORDER BY date ASC limit " . $start . ", " . $nb_mess_for_mess);
                while (list($mess_id, $title, $auteur, $auteur_id, $auteur_ip, $txt, $date, $edition, $bbcodeoff, $smileyoff, $cssoff, $usersig, $fichier) = mysql_fetch_row($sql4))
                {
                $txt = stripslashes($txt);
                $title = stripslashes($title);
                $auteur = stripslashes($auteur);

                if ($highlight != "")
                {
                $string = trim($highlight);
                $search = explode(" ", $string);

                for($i = 0; $i < count($search); $i++)
                {
                $words = preg_quote($search[$i]);
                $title = eregi_replace($words, "<span style=\"color: #FF0000;\">" . $words . "</span>", $title);

                if ($bbcodeoff == 0)
                {
                $txt = eregi_replace($words, "[color= #FF0000][b]" . $words . "/b/color", $txt);
                }
                else
                {
                $txt = eregi_replace($words, "<span style=\"color: #FF0000;\"><b>" . $words . "</b></span>", $txt);
                }
                }

                }

                $title = htmlentities($title, ENT_NOQUOTES);
                $title = eregi_replace("<", "<", $title);
                $title = eregi_replace(">", ">", $title);

                if ($bbcodeoff == 0)
                {
                $txt = htmlentities($txt);
                }
                else
                {
                $txt = htmlentities($txt, ENT_NOQUOTES);

                $txt = eregi_replace("<", "<", $txt);
                $txt = eregi_replace(">", ">", $txt);
                }

                if ($cssoff == 0)
                {
                $title = nk_CSS($title);
                $txt = nk_CSS($txt);
                $auteur = nk_CSS($auteur);
                }

                if ($bbcodeoff == 0) $txt = BBcode($txt);
                if ($smileyoff == 0) $txt = icon($txt);

                if (strftime("%d %m %Y", time()) == strftime("%d %m %Y", $date)) $date = _FTODAY . " " . strftime("%H:%M", $date);
                else if (strftime("%d", $date) == (strftime("%d", time()) - 1) && strftime("%m %Y", time()) == strftime("%m %Y", $date)) $date = _FYESTERDAY . " " . strftime("%H:%M", $date);
                else $date = _THE . " " . strftime("%x %H:%M", $date);

                $tmpcnt++ % 2 == 1 ? $color = $color1 : $color = $color2;

                echo "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"top\"><a name=\"" . $mess_id . "\"></a>";

                if ($auteur_id != "")
                {
                $sq_user = mysql_query("SELECT pseudo, niveau, rang, avatar, signature, date, email, icq, msn, aim, yim, url, count FROM " . USER_TABLE . " WHERE id = '" . $auteur_id . "'");
                $test = mysql_num_rows($sq_user);
                list($autor, $user_level, $rang, $avatar, $signature, $date_member, $email, $icq, $msn, $aim, $yim, $homepage, $nb_post) = mysql_fetch_array($sq_user);

                if ($test > 0 && $autor != "")
                {
                $date_member = strftime("%x", $date_member);

                if ($signature != "")
                {
                $signature = stripslashes($signature);
                $signature = nk_CSS($signature);
                if ($signature_resize == "on") $signature = preg_replace("/\[img\](.*?)\[\/img\]/e", "resize_signature('\\1')", $signature);
                $signature = BBcode($signature);
                }

                if ($fichier != "" && is_file("upload/Forum/" . $fichier))
                {
                $url_file = "upload/Forum/" . $fichier;
                $filesize = filesize($url_file) / 1024;
                $arrondi_size = ceil($filesize);
                $file = explode(".", $fichier);
                $ext = count($file)-1;

                if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                $del = " <a href=\"index.php?file=Forum&op=del_file&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/del.gif\" alt=\"\" title=\"" . _DELFILE . "\" /></a>";
                }
                else
                {
                $del = "";
                }

                $attach_file = "<br /><img src=\"modules/Forum/images/file.gif\" alt=\"\" title=\"" . _ATTACHFILE . "\" /><a href=\"" . $url_file . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _DOWNLOADFILE . "\">" . $fichier . "</a> (" . $arrondi_size . " Ko)" . $del;
                }
                else
                {
                $attach_file = "";
                }

                if ($modos != "" && ereg($auteur_id, $modos))
                {
                $auteur_modo = 1;
                }
                else
                {
                $auteur_modo = 0;
                }

                if ($rang > 0 && $nuked['forum_rank_team'] == "on")
                {
                $sql_rank_team = mysql_query("SELECT titre FROM " . TEAM_RANK_TABLE . " WHERE id = '" . $rang . "'");
                list($rank_name) = mysql_fetch_array($sql_rank_team);
                $rank_name = stripslashes($rank_name);
                $rank_name = htmlentities($rank_name);
                $rank_image = "";
                }
                else
                {
                if ($user_level >= admin_mod("Forum"))
                {
                $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 2");
                }
                else if ($auteur_modo == 1)
                {
                $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 1");
                }
                else
                {
                $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE " . $nb_post . " >= post AND type = 0 ORDER BY post DESC LIMIT 0, 1");
                }

                list($rank_name, $rank_image) = mysql_fetch_array($user_rank);
                $rank_name = stripslashes($rank_name);
                $rank_name = htmlentities($rank_name);
                }

                echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\"><b>" . $autor . "</b></a><br />\n";

                if ($rank_name != "")
                {
                echo $rank_name . "<br />\n";
                }

                if ($rank_image != "")
                {
                echo "<img src=\"" . $rank_image . "\" alt=\"\" /><br /><br />\n";
                }

                if ($avatar != "")
                {
                if ($avatar_resize == "off") $ar_ok = 0;
                else if (eregi("http://", $avatar) && $avatar_resize == "local") $ar_ok = 0;
                else $ar_ok = 1;

                if (!eregi("%20", $avatar) && $ar_ok == 1) list($w, $h, $type, $attr) = @getimagesize($avatar);
                if ($w != "" && $w <= $avatar_width) $width = "width=\"" . $w . "\" ";
                else if ($w != "") $width = "width=\"" . $avatar_width . "\" ";
                else $width = "";
                echo "<img src=\"" . $avatar . "\" " . $width . "alt=\"\" /><br />\n";
                }

                $online_connect = mysql_query("SELECT user_id FROM " . NBCONNECTE_TABLE . " WHERE user_id = '" . $auteur_id . "'");
                list($connect_id) = mysql_fetch_array($online_connect);

                if($auteur_id == $connect_id)
                {
                $online = _STATUT . " : <span style=\"color: limegreen;\"><b>" . _ONLINE2 . "</b></span>\n";
                }
                else
                {
                $online = _STATUT . " : <span style=\"color: red;\"><b>" . _OFFLINE . "</b></span>\n";
                }

                echo _MESSAGES . " : " . $nb_post . "<br />" . _REGISTERED . ": " . $date_member . "<br />" . $online . "<br />\n";

                if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo _IP . " : " . $auteur_ip;
                }
                }
                else
                {
                echo "<b>" . $auteur . "</b><br />\n";

                if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo _IP . " : " . $auteur_ip;
                }
                }
                }
                else
                {
                echo "<b>" . $auteur . "</b><br />\n";

                if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo _IP . " : " . $auteur_ip;
                }
                }

                echo "</td><td style=\"width: 75%;\" valign=\"top\">\n"
                . "<table width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n"
                . "<tr><td><img src=\"images/posticon.gif\" alt=\"\" />" . _POSTEDON . " " . $date . "  " . $attach_file . "</td><td align=\"right\">";

                if ($closed == 0 && $administrator == 1 || $visiteur >= admin_mod("Forum") || $visiteur >= $level)
                {
                echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "&do=quote\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/quote.gif\" alt=\"\" title=\"" . _REPLYQUOTE . "\" /></a>";
                }

                if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo " <a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&mess_id=" . $mess_id . "&do=edit\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" title=\"" . _EDITMESSAGE . "\" alt=\"\" /></a>";
                }

                if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo " <a href=\"index.php?file=Forum&op=del&mess_id=" . $mess_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELMESSAGE . "\" /></a>";
                }

                echo "</td></tr><tr style=\"background: " . $color . ";\"><td colspan=\"2\"><b>" . $title . "</b></td></tr>\n"
                . "<tr style=\"background: " . $color . ";\"><td colspan=\"2\">" . $txt . "<br /><br /></td></tr>\n";

                if ($edition != "")
                {
                echo "<tr style=\"background: " . $color . ";\"><td colspan=\"2\"><small><i>" . $edition . "</i></small></td></tr>\n";
                }

                if ($auteur_id != "" && $signature != "" && $usersig == 1)
                {
                echo "<tr style=\"background: " . $color . ";\"><td style=\"border-top: 1px dashed " . $color3 . ";\" colspan=\"2\">" . $signature . "</td></tr>\n";
                }

                echo "</table></td></tr>\n"
                . "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"middle\"><a href=\"#top\"><b>" . _BACKTOTOP . "</b></a></td><td style=\"width: 75%;\" valign=\"bottom\">";

                if ($auteur_id != "")
                {
                echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\" title=\"" . _SEEPROFIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/profile.gif\" alt=\"\" /></a>";
                }

                if ($user && $auteur_id != "")
                {
                echo "<a href=\"index.php?file=Userbox&op=post_message&for=" . $auteur_id . "\" title=\"" . _SENDPM . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/message.gif\" alt=\"\" /></a>";
                }

                if ($email != "" && $auteur_id != "")
                {
                echo "<a href=\"mailto:" . $email . "\" title=\"" . _SENDEMAIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/email.gif\" alt=\"\" /></a>";
                }

                if ($homepage != "" && $auteur_id != "")
                {
                echo "<a href=\"" . $homepage . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _SEEHOMEPAGE . " " . $autor . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/website.gif\" alt=\"\" /></a>";
                }

                if ($icq != "" && $auteur_id != "")
                {
                echo "<a href=\"https://web.icq.com?from=/whitepages/add_me&uin=" . $icq . "&action=add\"><img style=\"border: 0;\" src=\"modules/Forum/images/icq.gif\" title=\"" . $icq . "\" alt=\"\" /></a>";
                }

                if ($msn != "" && $auteur_id != "")
                {
                echo "<a href=\"mailto:" . $msn . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/msn.gif\" title=\"" . $msn . "\" alt=\"\" /></a>";
                }

                if ($aim != "" && $auteur_id != "")
                {
                echo "<a href=\"aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there+?\" onclick=\"window.open(this.href); return false;\"><img style=\"border: 0;\" src=\"modules/Forum/images/aol.gif\" title=\"" . $aim . "\" alt=\"\" /></a>";
                }

                if ($yim != "" && $auteur_id != "")
                {
                echo "<a href=\"https://fr.yahoo.com/?p=us" . $yim . "&src=pg\"><img style=\"border: 0;\" src=\"modules/Forum/images/yim.gif\" title=\"" . $yim . "\" alt=\"\" /></a>";
                }

                echo "</td></tr>\n";
                }

                echo "</table><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td valign=\"top\">";

                if ($highlight != "")
                {
                $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                }
                else
                {
                $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                }

                if ($count > $nb_mess_for_mess)
                {
                number($count, $nb_mess_for_mess, $url_page);
                }

                echo "</td><td align=\"right\" valign=\"top\">";

                if ($user[0] != "")
                {
                $sql_notify = mysql_query("SELECT emailnotify FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' AND auteur_id = '" . $user[0] . "'");
                $user_notify = mysql_num_rows($sql_notify);

                if ($user_notify > 0)
                {
                $inotify = 0;
                while(list($notify) = mysql_fetch_array($sql_notify))
                {
                if ($notify == 1)
                {
                $inotify++;
                }

                }

                if ($inotify > 0)
                {
                echo "<a href=\"index.php?file=Forum&op=notify&do=off&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYOFF . "</a><br />\n";
                }
                else
                {
                echo "<a href=\"index.php?file=Forum&op=notify&do=on&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYON . "</a><br />\n";
                }

                }

                }

                if ($level == 0 || $visiteur >= $level || $administrator == 1)
                {
                echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                {
                echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                }

                }

                echo "</td></tr></table>\n";

                if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                {
                echo "<br /><a href=\"index.php?file=Forum&op=del_topic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_delete.gif\" alt=\"\" title=\"" . _TOPICDEL . "\" /></a>"
                . " <a href=\"index.php?file=Forum&op=move&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_move.gif\" alt=\"\" title=\"" . _TOPICMOVE . "\" /></a>";

                if ($closed == 1)
                {
                echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=open\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_unlock.gif\" alt=\"\" title=\"" . _TOPICUNLOCK . "\" /></a>";
                }
                else
                {
                echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=close\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_lock.gif\" alt=\"\" title=\"" . _TOPICLOCK . "\" /></a>";
                }

                if ($annonce == 1)
                {
                echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=down\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_down.gif\" alt=\"\" title=\"" . _TOPICDOWN . "\" /></a>";
                }
                else
                {
                echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=up\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_up.gif\" alt=\"\" title=\"" . _TOPICUP . "\" /></a>";
                }
                }

                if ($user)
                {
                $visit = mysql_query("SELECT id FROM " . FORUM_READ_TABLE . " WHERE thread_id = '" . $thread_id . "' AND forum_id = '" . $forum_id . "' AND user_id = '" . $user[0] . "'");
                $user_visit = mysql_num_rows($visit);

                if ($user_visit == 0)
                {
                $sql_visit = mysql_query("INSERT INTO " . FORUM_READ_TABLE . " ( `id` , `user_id` , `thread_id` , `forum_id` ) VALUES ( '' , '" . $user[0] . "' , '" . $thread_id . "' , '" . $forum_id . "' )");
                }
                }
                }
                }
                else if ($level_access == -1)
                {
                echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                }
                else if ($level_access == 1 && $visiteur == 0)
                {
                echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b></div><br /><br />";
                }
                else
                {
                echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                }

                function resize_signature($img_sign)
                {
                global $sign_width;

                $img_sign = checkimg($img_sign);
                $ext = strrchr($img_sign, '.');
                $ext = strtolower(substr($ext, 1));

                if ($ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png") $test = 1;
                else $test = 0;

                if (!eregi("%20", $img_sign) && $test == 1) list($w_sign, $h_sign, $t_sign, $at_sign) = @getimagesize($img_sign);

                if ($w_sign != "" && $w_sign <= $sign_width) $s_width = "width=\"" . $w_sign . "\" ";
                else if ($w_sign != "") $s_width = "width=\"" . $sign_width . "\" ";
                else $s_width = "";

                $image_signature = "<img src=\"" . $img_sign . "\" " . $s_width . "alt=\"\" />";
                return($image_signature);
                }

                closetable();

                ?>
                1. premier code

                  <?php
                  // -------------------------------------------------------------------------//
                  // Nuked-KlaN - 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. //
                  // -------------------------------------------------------------------------//
                  if (!defined("INDEX_CHECK"))
                  {
                  die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
                  }

                  global $nuked, $user, $language, $theme, $thread_id, $forum_id, $p, $vote, $highlight;

                  translate("modules/Forum/lang/" . $language . ".lang.php");
                  include("modules/Forum/template.php");

                  opentable();

                  if (!$user)
                  {
                  $visiteur = 0;
                  }
                  else
                  {
                  $visiteur = $user[1];
                  }
                  $ModName = basename(dirname(__FILE__));
                  $level_access = nivo_mod($ModName);
                  if ($visiteur >= $level_access && $level_access > -1)
                  {
                  $nb_mess_for_mess = $nuked[mess_forum_page];

                  $sql = mysql_query("SELECT nom, moderateurs, cat, level FROM " . FORUM_TABLE . " WHERE " . $visiteur . " >= niveau AND id = '" . $forum_id . "'");
                  $level_ok = mysql_num_rows($sql);

                  $sql2 = mysql_query("SELECT titre, view, closed, annonce, last_post, auteur_id, sondage FROM " . FORUM_THREADS_TABLE . " WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");
                  $topic_ok = mysql_num_rows($sql2);

                  if ($level_ok == 0)
                  {
                  echo "<br /><br /><div style=\"text-align: center;\">" . _NOACCESSFORUM . "</div><br /><br />";
                  }
                  else if ($topic_ok == 0)
                  {
                  echo "<br /><br /><div style=\"text-align: center;\">" . _NOTOPICEXIST . "</div><br /><br />";
                  }
                  else
                  {
                  list($nom, $modos, $cat, $level) = mysql_fetch_array($sql);
                  $nom = stripslashes($nom);
                  $nom = htmlentities($nom);

                  $sql_cat = mysql_query("SELECT nom FROM " . FORUM_CAT_TABLE . " WHERE id = '" . $cat . "'");
                  list($cat_name) = mysql_fetch_array($sql_cat);
                  $cat_name = stripslashes($cat_name);
                  $cat_name = htmlentities($cat_name);

                  if ($user && $modos != "" && ereg($user[0], $modos))
                  {
                  $administrator = 1;
                  }
                  else
                  {
                  $administrator = 0;
                  }

                  list($titre, $read, $closed, $annonce, $lastpost, $topic_aid, $sondage) = mysql_fetch_array($sql2);
                  $titre = stripslashes($titre);
                  $titre = htmlentities($titre);
                  $titre = nk_CSS($titre);

                  $upd = mysql_query("UPDATE " . FORUM_THREADS_TABLE . " SET view = view + 1 WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");

                  $sql_next = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post > " . $lastpost. " AND forum_id = '" . $forum_id . "' ORDER BY last_post LIMIT 0, 1");
                  list($nextid) = mysql_fetch_array($sql_next);

                  if ($nextid != "")
                  {
                  $next = "<small><a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $nextid . "\">" . _NEXTTHREAD . "</a> ></small>";
                  }

                  $sql_last = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post < " . $lastpost . " AND forum_id = '" . $forum_id . "' ORDER BY last_post DESC LIMIT 0, 1");
                  list($lastid) = mysql_fetch_array($sql_last);

                  if ($lastid != "")
                  {
                  $prev = "<small>< <a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $lastid . "\">" . _LASTTHREAD . "</a> </small>";
                  }

                  echo "<br /><a name=\"top\"></a><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\">\n"
                  . "<tr><td><big><b>" . $titre . "</b></big></td><td align=\"right\">" . $prev . " " . $next . "</td></tr>\n"
                  . "<tr><td valign=\"bottom\"><a href=\"index.php?file=Forum\"><b>" . _INDEXFORUM . "</b></a> -> <a href=\"index.php?file=Forum&cat=" . $cat . "\"><b>" . $cat_name . "</b></a> -> <a href=\"index.php?file=Forum&page=viewforum&forum_id=" . $forum_id . "\"><b>" . $nom . "</b></a>\n";

                  $sql3 = mysql_query("SELECT thread_id FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                  $count = mysql_num_rows($sql3);

                  if (!$p) $p = 1;
                  $start = $p * $nb_mess_for_mess - $nb_mess_for_mess;

                  if ($highlight != "")
                  {
                  $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                  }
                  else
                  {
                  $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                  }

                  if ($count > $nb_mess_for_mess)
                  {
                  echo "<br /><br />\n";
                  number($count, $nb_mess_for_mess, $url_page);
                  }

                  echo "</td><td align=\"right\" valign=\"bottom\">";

                  if ($level == 0 || $visiteur >= $level || $administrator == 1)
                  {
                  echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                  if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                  {
                  echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                  }
                  }

                  echo "</td></tr></table>\n"
                  . "<table style=\"background: " . $color3 . ";\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">\n";

                  if ($sondage == 1)
                  {
                  echo "<tr style=\"background: " . $color2 . ";\"><td colspan=\"2\" align=\"center\">";

                  $sql_poll = mysql_query("SELECT id, titre FROM " . FORUM_POLL_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                  list($poll_id, $question) = mysql_fetch_array($sql_poll);
                  $question = stripslashes($question);
                  $question = htmlentities($question);

                  if ($user && $topic_aid == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Forum&op=edit_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" alt=\"\" title=\"" . _EDITPOLL . "\" /></a> <a href=\"index.php?file=Forum&op=del_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELPOLL . "\" /></a> </div>\n";
                  }

                  $check = mysql_query("SELECT auteur_ip FROM " . FORUM_VOTE_TABLE . " WHERE poll_id = '" . $poll_id . "' AND auteur_id = '" . $user[0] . "'");
                  $test = mysql_num_rows($check);

                  if ($user && $test > 0 || $vote == "view")
                  {
                  echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"2\" cellpadding=\"4\" border=\"0\">\n"
                  . "<tr><td colspan=\"2\" align=\"center\"><b>" . $question . "</b></td></tr>\n";

                  $sql_options = mysql_query("SELECT option_vote FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                  $nbcount = 0;

                  while (list($option_vote) = mysql_fetch_array($sql_options))
                  {
                  $nbcount = $nbcount + $option_vote;
                  }

                  $sql_res = mysql_query("SELECT option_vote, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                  while (list($optioncount, $option_text) = mysql_fetch_array($sql_res))
                  {
                  $optiontext = stripslashes($option_text);
                  $optiontext = htmlentities($option_text);

                  if ($nbcount <> 0)
                  {
                  $etat = ($optioncount * 100) / $nbcount ;
                  }
                  else
                  {
                  $etat = 0;
                  }

                  $pourcent_arrondi = round($etat);

                  echo "<tr><td>" . $optiontext . "</td><td>";

                  if ($etat < 1)
                  {
                  $width = 2;
                  }
                  else
                  {
                  $width = $etat * 2;
                  }

                  if (is_file("themes/" . $theme . "/images/bar.gif"))
                  {
                  $img = "themes/" . $theme . "/images/bar.gif";
                  }
                  else
                  {
                  $img = "modules/Forum/images/bar.gif";
                  }

                  echo "<img src=\"" . $img . "\" width=\"" . $width . "\" height=\"10\" alt=\"\" title=\"" . $pourcent_arrondi . "%\" /> " . $pourcent_arrondi . "% (" . $optioncount . ")</td></tr>\n";
                  }
                  echo "<tr></tr><td align=\"center\" colspan=\"2\"><b>" . _TOTALVOTE . " : </b>" . $nbcount . "</td></tr></table>\n";
                  }
                  else
                  {
                  echo "<form method=\"post\" action=\"index.php?file=Forum&op=vote&poll_id=" . $poll_id . "\">\n"
                  . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n"
                  . "<tr><td align=\"center\"><b>" . $question . "</b></td></tr>\n";

                  $sql_options = mysql_query("SELECT id, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                  while (list($voteid, $optiontext) = mysql_fetch_array($sql_options))
                  {
                  $optiontext = stripslashes($optiontext);
                  $optiontext = htmlentities($optiontext);

                  echo "<tr><td><input type=\"radio\" class=\"checkbox\" name=\"voteid\" value=\"" . $voteid . "\" /> " . $optiontext . "</td></tr>\n";
                  }

                  echo "<tr><td> <input type=\"hidden\" name=\"forum_id\" value=\"" . $forum_id . "\" /><input type=\"hidden\" name=\"thread_id\" value=\"" . $thread_id . "\" /></td></tr>\n"
                  . "<tr><td align=\"center\"><input type=\"submit\" value=\"" . _TOVOTE . "\" /> <input type=\"button\" value=\"" . _RESULT . "\" onclick=\"document.location='index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&vote=view'\" /></td></tr></table></form>\n";
                  }

                  echo "</td></tr>\n";
                  }

                  echo "<tr " . $background . "><td style=\"width: 25%;\" align=\"center\"><b>" . _AUTHOR . "</b></td><td style=\"width: 75%;\" align=\"center\"><b>" . _MESSAGE . "</b></td></tr>\n";

                  $sql4 = mysql_query("SELECT id, titre, auteur, auteur_id, auteur_ip, txt, date, edition, bbcodeoff, smileyoff, cssoff, usersig, file FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' ORDER BY date ASC limit " . $start . ", " . $nb_mess_for_mess);
                  while (list($mess_id, $title, $auteur, $auteur_id, $auteur_ip, $txt, $date, $edition, $bbcodeoff, $smileyoff, $cssoff, $usersig, $fichier) = mysql_fetch_row($sql4))
                  {
                  $txt = stripslashes($txt);
                  $title = stripslashes($title);
                  $auteur = stripslashes($auteur);

                  if ($highlight != "")
                  {
                  $string = trim($highlight);
                  $search = explode(" ", $string);

                  for($i = 0; $i < count($search); $i++)
                  {
                  $words = preg_quote($search[$i]);
                  $title = eregi_replace($words, "<span style=\"color: #FF0000;\">" . $words . "</span>", $title);

                  if ($bbcodeoff == 0)
                  {
                  $txt = eregi_replace($words, "[color= #FF0000][b]" . $words . "/b/color", $txt);
                  }
                  else
                  {
                  $txt = eregi_replace($words, "<span style=\"color: #FF0000;\"><b>" . $words . "</b></span>", $txt);
                  }
                  }

                  }

                  $title = htmlentities($title, ENT_NOQUOTES);
                  $title = eregi_replace("<", "<", $title);
                  $title = eregi_replace(">", ">", $title);

                  if ($bbcodeoff == 0)
                  {
                  $txt = htmlentities($txt);
                  }
                  else
                  {
                  $txt = htmlentities($txt, ENT_NOQUOTES);

                  $txt = eregi_replace("<", "<", $txt);
                  $txt = eregi_replace(">", ">", $txt);
                  }

                  if ($cssoff == 0)
                  {
                  $title = nk_CSS($title);
                  $txt = nk_CSS($txt);
                  $auteur = nk_CSS($auteur);
                  }

                  if ($bbcodeoff == 0) $txt = BBcode($txt);
                  if ($smileyoff == 0) $txt = icon($txt);

                  if (strftime("%d %m %Y", time()) == strftime("%d %m %Y", $date)) $date = _FTODAY . " " . strftime("%H:%M", $date);
                  else if (strftime("%d", $date) == (strftime("%d", time()) - 1) && strftime("%m %Y", time()) == strftime("%m %Y", $date)) $date = _FYESTERDAY . " " . strftime("%H:%M", $date);
                  else $date = _THE . " " . strftime("%x %H:%M", $date);

                  $tmpcnt++ % 2 == 1 ? $color = $color1 : $color = $color2;

                  echo "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"top\"><a name=\"" . $mess_id . "\"></a>";

                  if ($auteur_id != "")
                  {
                  $sq_user = mysql_query("SELECT pseudo, niveau, rang, avatar, signature, date, email, icq, msn, aim, yim, url, count FROM " . USER_TABLE . " WHERE id = '" . $auteur_id . "'");
                  $test = mysql_num_rows($sq_user);
                  list($autor, $user_level, $rang, $avatar, $signature, $date_member, $email, $icq, $msn, $aim, $yim, $homepage, $nb_post) = mysql_fetch_array($sq_user);

                  if ($test > 0 && $autor != "")
                  {
                  $date_member = strftime("%x", $date_member);

                  if ($signature != "")
                  {
                  $signature = stripslashes($signature);
                  $signature = nk_CSS($signature);
                  if ($signature_resize == "on") $signature = preg_replace("/\[img\](.*?)\[\/img\]/e", "resize_signature('\\1')", $signature);
                  $signature = BBcode($signature);
                  }

                  if ($fichier != "" && is_file("upload/Forum/" . $fichier))
                  {
                  $url_file = "upload/Forum/" . $fichier;
                  $filesize = filesize($url_file) / 1024;
                  $arrondi_size = ceil($filesize);
                  $file = explode(".", $fichier);
                  $ext = count($file)-1;

                  if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  $del = " <a href=\"index.php?file=Forum&op=del_file&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/del.gif\" alt=\"\" title=\"" . _DELFILE . "\" /></a>";
                  }
                  else
                  {
                  $del = "";
                  }

                  $attach_file = "<br /><img src=\"modules/Forum/images/file.gif\" alt=\"\" title=\"" . _ATTACHFILE . "\" /><a href=\"" . $url_file . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _DOWNLOADFILE . "\">" . $fichier . "</a> (" . $arrondi_size . " Ko)" . $del;
                  }
                  else
                  {
                  $attach_file = "";
                  }

                  if ($modos != "" && ereg($auteur_id, $modos))
                  {
                  $auteur_modo = 1;
                  }
                  else
                  {
                  $auteur_modo = 0;
                  }

                  if ($rang > 0 && $nuked['forum_rank_team'] == "on")
                  {
                  $sql_rank_team = mysql_query("SELECT titre FROM " . TEAM_RANK_TABLE . " WHERE id = '" . $rang . "'");
                  list($rank_name) = mysql_fetch_array($sql_rank_team);
                  $rank_name = stripslashes($rank_name);
                  $rank_name = htmlentities($rank_name);
                  $rank_image = "";
                  }
                  else
                  {
                  if ($user_level >= admin_mod("Forum"))
                  {
                  $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 2");
                  }
                  else if ($auteur_modo == 1)
                  {
                  $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 1");
                  }
                  else
                  {
                  $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE " . $nb_post . " >= post AND type = 0 ORDER BY post DESC LIMIT 0, 1");
                  }

                  list($rank_name, $rank_image) = mysql_fetch_array($user_rank);
                  $rank_name = stripslashes($rank_name);
                  $rank_name = htmlentities($rank_name);
                  }

                  echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\"><b>" . $autor . "</b></a><br />\n";

                  if ($rank_name != "")
                  {
                  echo $rank_name . "<br />\n";
                  }

                  if ($rank_image != "")
                  {
                  echo "<img src=\"" . $rank_image . "\" alt=\"\" /><br /><br />\n";
                  }

                  if ($avatar != "")
                  {
                  if ($avatar_resize == "off") $ar_ok = 0;
                  else if (eregi("http://", $avatar) && $avatar_resize == "local") $ar_ok = 0;
                  else $ar_ok = 1;

                  if (!eregi("%20", $avatar) && $ar_ok == 1) list($w, $h, $type, $attr) = @getimagesize($avatar);
                  if ($w != "" && $w <= $avatar_width) $width = "width=\"" . $w . "\" ";
                  else if ($w != "") $width = "width=\"" . $avatar_width . "\" ";
                  else $width = "";
                  echo "<img src=\"" . $avatar . "\" " . $width . "alt=\"\" /><br />\n";
                  }

                  $online_connect = mysql_query("SELECT user_id FROM " . NBCONNECTE_TABLE . " WHERE user_id = '" . $auteur_id . "'");
                  list($connect_id) = mysql_fetch_array($online_connect);

                  if($auteur_id == $connect_id)
                  {
                  $online = _STATUT . " : <span style=\"color: limegreen;\"><b>" . _ONLINE2 . "</b></span>\n";
                  }
                  else
                  {
                  $online = _STATUT . " : <span style=\"color: red;\"><b>" . _OFFLINE . "</b></span>\n";
                  }

                  echo _MESSAGES . " : " . $nb_post . "<br />" . _REGISTERED . ": " . $date_member . "<br />" . $online . "<br />\n";

                  if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo _IP . " : " . $auteur_ip;
                  }
                  }
                  else
                  {
                  echo "<b>" . $auteur . "</b><br />\n";

                  if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo _IP . " : " . $auteur_ip;
                  }
                  }
                  }
                  else
                  {
                  echo "<b>" . $auteur . "</b><br />\n";

                  if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo _IP . " : " . $auteur_ip;
                  }
                  }

                  echo "</td><td style=\"width: 75%;\" valign=\"top\">\n"
                  . "<table width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n"
                  . "<tr><td><img src=\"images/posticon.gif\" alt=\"\" />" . _POSTEDON . " " . $date . "  " . $attach_file . "</td><td align=\"right\">";

                  if ($closed == 0 && $administrator == 1 || $visiteur >= admin_mod("Forum") || $visiteur >= $level)
                  {
                  echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "&do=quote\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/quote.gif\" alt=\"\" title=\"" . _REPLYQUOTE . "\" /></a>";
                  }

                  if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo " <a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&mess_id=" . $mess_id . "&do=edit\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" title=\"" . _EDITMESSAGE . "\" alt=\"\" /></a>";
                  }

                  if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo " <a href=\"index.php?file=Forum&op=del&mess_id=" . $mess_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELMESSAGE . "\" /></a>";
                  }

                  echo "</td></tr><tr style=\"background: " . $color . ";\"><td colspan=\"2\"><b>" . $title . "</b></td></tr>\n"
                  . "<tr style=\"background: " . $color . ";\"><td colspan=\"2\">" . $txt . "<br /><br /></td></tr>\n";

                  if ($edition != "")
                  {
                  echo "<tr style=\"background: " . $color . ";\"><td colspan=\"2\"><small><i>" . $edition . "</i></small></td></tr>\n";
                  }

                  if ($auteur_id != "" && $signature != "" && $usersig == 1)
                  {
                  echo "<tr style=\"background: " . $color . ";\"><td style=\"border-top: 1px dashed " . $color3 . ";\" colspan=\"2\">" . $signature . "</td></tr>\n";
                  }

                  echo "</table></td></tr>\n"
                  . "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"middle\"><a href=\"#top\"><b>" . _BACKTOTOP . "</b></a></td><td style=\"width: 75%;\" valign=\"bottom\">";

                  if ($auteur_id != "")
                  {
                  echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\" title=\"" . _SEEPROFIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/profile.gif\" alt=\"\" /></a>";
                  }

                  if ($user && $auteur_id != "")
                  {
                  echo "<a href=\"index.php?file=Userbox&op=post_message&for=" . $auteur_id . "\" title=\"" . _SENDPM . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/message.gif\" alt=\"\" /></a>";
                  }

                  if ($email != "" && $auteur_id != "")
                  {
                  echo "<a href=\"mailto:" . $email . "\" title=\"" . _SENDEMAIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/email.gif\" alt=\"\" /></a>";
                  }

                  if ($homepage != "" && $auteur_id != "")
                  {
                  echo "<a href=\"" . $homepage . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _SEEHOMEPAGE . " " . $autor . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/website.gif\" alt=\"\" /></a>";
                  }

                  if ($icq != "" && $auteur_id != "")
                  {
                  echo "<a href=\"https://web.icq.com?from=/whitepages/add_me&uin=" . $icq . "&action=add\"><img style=\"border: 0;\" src=\"modules/Forum/images/icq.gif\" title=\"" . $icq . "\" alt=\"\" /></a>";
                  }

                  if ($msn != "" && $auteur_id != "")
                  {
                  echo "<a href=\"mailto:" . $msn . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/msn.gif\" title=\"" . $msn . "\" alt=\"\" /></a>";
                  }

                  if ($aim != "" && $auteur_id != "")
                  {
                  echo "<a href=\"aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there+?\" onclick=\"window.open(this.href); return false;\"><img style=\"border: 0;\" src=\"modules/Forum/images/aol.gif\" title=\"" . $aim . "\" alt=\"\" /></a>";
                  }

                  if ($yim != "" && $auteur_id != "")
                  {
                  echo "<a href=\"https://fr.yahoo.com/?p=us" . $yim . "&src=pg\"><img style=\"border: 0;\" src=\"modules/Forum/images/yim.gif\" title=\"" . $yim . "\" alt=\"\" /></a>";
                  }

                  echo "</td></tr>\n";
                  }

                  echo "</table><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td valign=\"top\">";

                  if ($highlight != "")
                  {
                  $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                  }
                  else
                  {
                  $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                  }

                  if ($count > $nb_mess_for_mess)
                  {
                  number($count, $nb_mess_for_mess, $url_page);
                  }

                  echo "</td><td align=\"right\" valign=\"top\">";

                  if ($user[0] != "")
                  {
                  $sql_notify = mysql_query("SELECT emailnotify FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' AND auteur_id = '" . $user[0] . "'");
                  $user_notify = mysql_num_rows($sql_notify);

                  if ($user_notify > 0)
                  {
                  $inotify = 0;
                  while(list($notify) = mysql_fetch_array($sql_notify))
                  {
                  if ($notify == 1)
                  {
                  $inotify++;
                  }

                  }

                  if ($inotify > 0)
                  {
                  echo "<a href=\"index.php?file=Forum&op=notify&do=off&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYOFF . "</a><br />\n";
                  }
                  else
                  {
                  echo "<a href=\"index.php?file=Forum&op=notify&do=on&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYON . "</a><br />\n";
                  }

                  }

                  }

                  if ($level == 0 || $visiteur >= $level || $administrator == 1)
                  {
                  echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                  if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                  {
                  echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                  }

                  }

                  echo "</td></tr></table>\n";

                  if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                  {
                  echo "<br /><a href=\"index.php?file=Forum&op=del_topic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_delete.gif\" alt=\"\" title=\"" . _TOPICDEL . "\" /></a>"
                  . " <a href=\"index.php?file=Forum&op=move&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_move.gif\" alt=\"\" title=\"" . _TOPICMOVE . "\" /></a>";

                  if ($closed == 1)
                  {
                  echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=open\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_unlock.gif\" alt=\"\" title=\"" . _TOPICUNLOCK . "\" /></a>";
                  }
                  else
                  {
                  echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=close\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_lock.gif\" alt=\"\" title=\"" . _TOPICLOCK . "\" /></a>";
                  }

                  if ($annonce == 1)
                  {
                  echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=down\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_down.gif\" alt=\"\" title=\"" . _TOPICDOWN . "\" /></a>";
                  }
                  else
                  {
                  echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=up\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_up.gif\" alt=\"\" title=\"" . _TOPICUP . "\" /></a>";
                  }
                  }

                  if ($user)
                  {
                  $visit = mysql_query("SELECT id FROM " . FORUM_READ_TABLE . " WHERE thread_id = '" . $thread_id . "' AND forum_id = '" . $forum_id . "' AND user_id = '" . $user[0] . "'");
                  $user_visit = mysql_num_rows($visit);

                  if ($user_visit == 0)
                  {
                  $sql_visit = mysql_query("INSERT INTO " . FORUM_READ_TABLE . " ( `id` , `user_id` , `thread_id` , `forum_id` ) VALUES ( '' , '" . $user[0] . "' , '" . $thread_id . "' , '" . $forum_id . "' )");
                  }
                  }
                  }
                  }
                  else if ($level_access == -1)
                  {
                  echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                  }
                  else if ($level_access == 1 && $visiteur == 0)
                  {
                  echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b></div><br /><br />";
                  }
                  else
                  {
                  echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                  }

                  function resize_signature($img_sign)
                  {
                  global $sign_width;

                  $img_sign = checkimg($img_sign);
                  $ext = strrchr($img_sign, '.');
                  $ext = strtolower(substr($ext, 1));

                  if ($ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png") $test = 1;
                  else $test = 0;

                  if (!eregi("%20", $img_sign) && $test == 1) list($w_sign, $h_sign, $t_sign, $at_sign) = @getimagesize($img_sign);

                  if ($w_sign != "" && $w_sign <= $sign_width) $s_width = "width=\"" . $w_sign . "\" ";
                  else if ($w_sign != "") $s_width = "width=\"" . $sign_width . "\" ";
                  else $s_width = "";

                  $image_signature = "<img src=\"" . $img_sign . "\" " . $s_width . "alt=\"\" />";
                  return($image_signature);
                  }

                  closetable();

                  ?>
                  1. premier code

                    <?php
                    // -------------------------------------------------------------------------//
                    // Nuked-KlaN - 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. //
                    // -------------------------------------------------------------------------//
                    if (!defined("INDEX_CHECK"))
                    {
                    die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
                    }

                    global $nuked, $user, $language, $theme, $thread_id, $forum_id, $p, $vote, $highlight;

                    translate("modules/Forum/lang/" . $language . ".lang.php");
                    include("modules/Forum/template.php");

                    opentable();

                    if (!$user)
                    {
                    $visiteur = 0;
                    }
                    else
                    {
                    $visiteur = $user[1];
                    }
                    $ModName = basename(dirname(__FILE__));
                    $level_access = nivo_mod($ModName);
                    if ($visiteur >= $level_access && $level_access > -1)
                    {
                    $nb_mess_for_mess = $nuked[mess_forum_page];

                    $sql = mysql_query("SELECT nom, moderateurs, cat, level FROM " . FORUM_TABLE . " WHERE " . $visiteur . " >= niveau AND id = '" . $forum_id . "'");
                    $level_ok = mysql_num_rows($sql);

                    $sql2 = mysql_query("SELECT titre, view, closed, annonce, last_post, auteur_id, sondage FROM " . FORUM_THREADS_TABLE . " WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");
                    $topic_ok = mysql_num_rows($sql2);

                    if ($level_ok == 0)
                    {
                    echo "<br /><br /><div style=\"text-align: center;\">" . _NOACCESSFORUM . "</div><br /><br />";
                    }
                    else if ($topic_ok == 0)
                    {
                    echo "<br /><br /><div style=\"text-align: center;\">" . _NOTOPICEXIST . "</div><br /><br />";
                    }
                    else
                    {
                    list($nom, $modos, $cat, $level) = mysql_fetch_array($sql);
                    $nom = stripslashes($nom);
                    $nom = htmlentities($nom);

                    $sql_cat = mysql_query("SELECT nom FROM " . FORUM_CAT_TABLE . " WHERE id = '" . $cat . "'");
                    list($cat_name) = mysql_fetch_array($sql_cat);
                    $cat_name = stripslashes($cat_name);
                    $cat_name = htmlentities($cat_name);

                    if ($user && $modos != "" && ereg($user[0], $modos))
                    {
                    $administrator = 1;
                    }
                    else
                    {
                    $administrator = 0;
                    }

                    list($titre, $read, $closed, $annonce, $lastpost, $topic_aid, $sondage) = mysql_fetch_array($sql2);
                    $titre = stripslashes($titre);
                    $titre = htmlentities($titre);
                    $titre = nk_CSS($titre);

                    $upd = mysql_query("UPDATE " . FORUM_THREADS_TABLE . " SET view = view + 1 WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");

                    $sql_next = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post > " . $lastpost. " AND forum_id = '" . $forum_id . "' ORDER BY last_post LIMIT 0, 1");
                    list($nextid) = mysql_fetch_array($sql_next);

                    if ($nextid != "")
                    {
                    $next = "<small><a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $nextid . "\">" . _NEXTTHREAD . "</a> ></small>";
                    }

                    $sql_last = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post < " . $lastpost . " AND forum_id = '" . $forum_id . "' ORDER BY last_post DESC LIMIT 0, 1");
                    list($lastid) = mysql_fetch_array($sql_last);

                    if ($lastid != "")
                    {
                    $prev = "<small>< <a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $lastid . "\">" . _LASTTHREAD . "</a> </small>";
                    }

                    echo "<br /><a name=\"top\"></a><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\">\n"
                    . "<tr><td><big><b>" . $titre . "</b></big></td><td align=\"right\">" . $prev . " " . $next . "</td></tr>\n"
                    . "<tr><td valign=\"bottom\"><a href=\"index.php?file=Forum\"><b>" . _INDEXFORUM . "</b></a> -> <a href=\"index.php?file=Forum&cat=" . $cat . "\"><b>" . $cat_name . "</b></a> -> <a href=\"index.php?file=Forum&page=viewforum&forum_id=" . $forum_id . "\"><b>" . $nom . "</b></a>\n";

                    $sql3 = mysql_query("SELECT thread_id FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                    $count = mysql_num_rows($sql3);

                    if (!$p) $p = 1;
                    $start = $p * $nb_mess_for_mess - $nb_mess_for_mess;

                    if ($highlight != "")
                    {
                    $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                    }
                    else
                    {
                    $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                    }

                    if ($count > $nb_mess_for_mess)
                    {
                    echo "<br /><br />\n";
                    number($count, $nb_mess_for_mess, $url_page);
                    }

                    echo "</td><td align=\"right\" valign=\"bottom\">";

                    if ($level == 0 || $visiteur >= $level || $administrator == 1)
                    {
                    echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                    if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                    {
                    echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                    }
                    }

                    echo "</td></tr></table>\n"
                    . "<table style=\"background: " . $color3 . ";\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">\n";

                    if ($sondage == 1)
                    {
                    echo "<tr style=\"background: " . $color2 . ";\"><td colspan=\"2\" align=\"center\">";

                    $sql_poll = mysql_query("SELECT id, titre FROM " . FORUM_POLL_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                    list($poll_id, $question) = mysql_fetch_array($sql_poll);
                    $question = stripslashes($question);
                    $question = htmlentities($question);

                    if ($user && $topic_aid == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Forum&op=edit_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" alt=\"\" title=\"" . _EDITPOLL . "\" /></a> <a href=\"index.php?file=Forum&op=del_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELPOLL . "\" /></a> </div>\n";
                    }

                    $check = mysql_query("SELECT auteur_ip FROM " . FORUM_VOTE_TABLE . " WHERE poll_id = '" . $poll_id . "' AND auteur_id = '" . $user[0] . "'");
                    $test = mysql_num_rows($check);

                    if ($user && $test > 0 || $vote == "view")
                    {
                    echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"2\" cellpadding=\"4\" border=\"0\">\n"
                    . "<tr><td colspan=\"2\" align=\"center\"><b>" . $question . "</b></td></tr>\n";

                    $sql_options = mysql_query("SELECT option_vote FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                    $nbcount = 0;

                    while (list($option_vote) = mysql_fetch_array($sql_options))
                    {
                    $nbcount = $nbcount + $option_vote;
                    }

                    $sql_res = mysql_query("SELECT option_vote, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                    while (list($optioncount, $option_text) = mysql_fetch_array($sql_res))
                    {
                    $optiontext = stripslashes($option_text);
                    $optiontext = htmlentities($option_text);

                    if ($nbcount <> 0)
                    {
                    $etat = ($optioncount * 100) / $nbcount ;
                    }
                    else
                    {
                    $etat = 0;
                    }

                    $pourcent_arrondi = round($etat);

                    echo "<tr><td>" . $optiontext . "</td><td>";

                    if ($etat < 1)
                    {
                    $width = 2;
                    }
                    else
                    {
                    $width = $etat * 2;
                    }

                    if (is_file("themes/" . $theme . "/images/bar.gif"))
                    {
                    $img = "themes/" . $theme . "/images/bar.gif";
                    }
                    else
                    {
                    $img = "modules/Forum/images/bar.gif";
                    }

                    echo "<img src=\"" . $img . "\" width=\"" . $width . "\" height=\"10\" alt=\"\" title=\"" . $pourcent_arrondi . "%\" /> " . $pourcent_arrondi . "% (" . $optioncount . ")</td></tr>\n";
                    }
                    echo "<tr></tr><td align=\"center\" colspan=\"2\"><b>" . _TOTALVOTE . " : </b>" . $nbcount . "</td></tr></table>\n";
                    }
                    else
                    {
                    echo "<form method=\"post\" action=\"index.php?file=Forum&op=vote&poll_id=" . $poll_id . "\">\n"
                    . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n"
                    . "<tr><td align=\"center\"><b>" . $question . "</b></td></tr>\n";

                    $sql_options = mysql_query("SELECT id, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                    while (list($voteid, $optiontext) = mysql_fetch_array($sql_options))
                    {
                    $optiontext = stripslashes($optiontext);
                    $optiontext = htmlentities($optiontext);

                    echo "<tr><td><input type=\"radio\" class=\"checkbox\" name=\"voteid\" value=\"" . $voteid . "\" /> " . $optiontext . "</td></tr>\n";
                    }

                    echo "<tr><td> <input type=\"hidden\" name=\"forum_id\" value=\"" . $forum_id . "\" /><input type=\"hidden\" name=\"thread_id\" value=\"" . $thread_id . "\" /></td></tr>\n"
                    . "<tr><td align=\"center\"><input type=\"submit\" value=\"" . _TOVOTE . "\" /> <input type=\"button\" value=\"" . _RESULT . "\" onclick=\"document.location='index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&vote=view'\" /></td></tr></table></form>\n";
                    }

                    echo "</td></tr>\n";
                    }

                    echo "<tr " . $background . "><td style=\"width: 25%;\" align=\"center\"><b>" . _AUTHOR . "</b></td><td style=\"width: 75%;\" align=\"center\"><b>" . _MESSAGE . "</b></td></tr>\n";

                    $sql4 = mysql_query("SELECT id, titre, auteur, auteur_id, auteur_ip, txt, date, edition, bbcodeoff, smileyoff, cssoff, usersig, file FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' ORDER BY date ASC limit " . $start . ", " . $nb_mess_for_mess);
                    while (list($mess_id, $title, $auteur, $auteur_id, $auteur_ip, $txt, $date, $edition, $bbcodeoff, $smileyoff, $cssoff, $usersig, $fichier) = mysql_fetch_row($sql4))
                    {
                    $txt = stripslashes($txt);
                    $title = stripslashes($title);
                    $auteur = stripslashes($auteur);

                    if ($highlight != "")
                    {
                    $string = trim($highlight);
                    $search = explode(" ", $string);

                    for($i = 0; $i < count($search); $i++)
                    {
                    $words = preg_quote($search[$i]);
                    $title = eregi_replace($words, "<span style=\"color: #FF0000;\">" . $words . "</span>", $title);

                    if ($bbcodeoff == 0)
                    {
                    $txt = eregi_replace($words, "[color= #FF0000][b]" . $words . "/b/color", $txt);
                    }
                    else
                    {
                    $txt = eregi_replace($words, "<span style=\"color: #FF0000;\"><b>" . $words . "</b></span>", $txt);
                    }
                    }

                    }

                    $title = htmlentities($title, ENT_NOQUOTES);
                    $title = eregi_replace("<", "<", $title);
                    $title = eregi_replace(">", ">", $title);

                    if ($bbcodeoff == 0)
                    {
                    $txt = htmlentities($txt);
                    }
                    else
                    {
                    $txt = htmlentities($txt, ENT_NOQUOTES);

                    $txt = eregi_replace("<", "<", $txt);
                    $txt = eregi_replace(">", ">", $txt);
                    }

                    if ($cssoff == 0)
                    {
                    $title = nk_CSS($title);
                    $txt = nk_CSS($txt);
                    $auteur = nk_CSS($auteur);
                    }

                    if ($bbcodeoff == 0) $txt = BBcode($txt);
                    if ($smileyoff == 0) $txt = icon($txt);

                    if (strftime("%d %m %Y", time()) == strftime("%d %m %Y", $date)) $date = _FTODAY . " " . strftime("%H:%M", $date);
                    else if (strftime("%d", $date) == (strftime("%d", time()) - 1) && strftime("%m %Y", time()) == strftime("%m %Y", $date)) $date = _FYESTERDAY . " " . strftime("%H:%M", $date);
                    else $date = _THE . " " . strftime("%x %H:%M", $date);

                    $tmpcnt++ % 2 == 1 ? $color = $color1 : $color = $color2;

                    echo "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"top\"><a name=\"" . $mess_id . "\"></a>";

                    if ($auteur_id != "")
                    {
                    $sq_user = mysql_query("SELECT pseudo, niveau, rang, avatar, signature, date, email, icq, msn, aim, yim, url, count FROM " . USER_TABLE . " WHERE id = '" . $auteur_id . "'");
                    $test = mysql_num_rows($sq_user);
                    list($autor, $user_level, $rang, $avatar, $signature, $date_member, $email, $icq, $msn, $aim, $yim, $homepage, $nb_post) = mysql_fetch_array($sq_user);

                    if ($test > 0 && $autor != "")
                    {
                    $date_member = strftime("%x", $date_member);

                    if ($signature != "")
                    {
                    $signature = stripslashes($signature);
                    $signature = nk_CSS($signature);
                    if ($signature_resize == "on") $signature = preg_replace("/\[img\](.*?)\[\/img\]/e", "resize_signature('\\1')", $signature);
                    $signature = BBcode($signature);
                    }

                    if ($fichier != "" && is_file("upload/Forum/" . $fichier))
                    {
                    $url_file = "upload/Forum/" . $fichier;
                    $filesize = filesize($url_file) / 1024;
                    $arrondi_size = ceil($filesize);
                    $file = explode(".", $fichier);
                    $ext = count($file)-1;

                    if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    $del = " <a href=\"index.php?file=Forum&op=del_file&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/del.gif\" alt=\"\" title=\"" . _DELFILE . "\" /></a>";
                    }
                    else
                    {
                    $del = "";
                    }

                    $attach_file = "<br /><img src=\"modules/Forum/images/file.gif\" alt=\"\" title=\"" . _ATTACHFILE . "\" /><a href=\"" . $url_file . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _DOWNLOADFILE . "\">" . $fichier . "</a> (" . $arrondi_size . " Ko)" . $del;
                    }
                    else
                    {
                    $attach_file = "";
                    }

                    if ($modos != "" && ereg($auteur_id, $modos))
                    {
                    $auteur_modo = 1;
                    }
                    else
                    {
                    $auteur_modo = 0;
                    }

                    if ($rang > 0 && $nuked['forum_rank_team'] == "on")
                    {
                    $sql_rank_team = mysql_query("SELECT titre FROM " . TEAM_RANK_TABLE . " WHERE id = '" . $rang . "'");
                    list($rank_name) = mysql_fetch_array($sql_rank_team);
                    $rank_name = stripslashes($rank_name);
                    $rank_name = htmlentities($rank_name);
                    $rank_image = "";
                    }
                    else
                    {
                    if ($user_level >= admin_mod("Forum"))
                    {
                    $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 2");
                    }
                    else if ($auteur_modo == 1)
                    {
                    $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 1");
                    }
                    else
                    {
                    $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE " . $nb_post . " >= post AND type = 0 ORDER BY post DESC LIMIT 0, 1");
                    }

                    list($rank_name, $rank_image) = mysql_fetch_array($user_rank);
                    $rank_name = stripslashes($rank_name);
                    $rank_name = htmlentities($rank_name);
                    }

                    echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\"><b>" . $autor . "</b></a><br />\n";

                    if ($rank_name != "")
                    {
                    echo $rank_name . "<br />\n";
                    }

                    if ($rank_image != "")
                    {
                    echo "<img src=\"" . $rank_image . "\" alt=\"\" /><br /><br />\n";
                    }

                    if ($avatar != "")
                    {
                    if ($avatar_resize == "off") $ar_ok = 0;
                    else if (eregi("http://", $avatar) && $avatar_resize == "local") $ar_ok = 0;
                    else $ar_ok = 1;

                    if (!eregi("%20", $avatar) && $ar_ok == 1) list($w, $h, $type, $attr) = @getimagesize($avatar);
                    if ($w != "" && $w <= $avatar_width) $width = "width=\"" . $w . "\" ";
                    else if ($w != "") $width = "width=\"" . $avatar_width . "\" ";
                    else $width = "";
                    echo "<img src=\"" . $avatar . "\" " . $width . "alt=\"\" /><br />\n";
                    }

                    $online_connect = mysql_query("SELECT user_id FROM " . NBCONNECTE_TABLE . " WHERE user_id = '" . $auteur_id . "'");
                    list($connect_id) = mysql_fetch_array($online_connect);

                    if($auteur_id == $connect_id)
                    {
                    $online = _STATUT . " : <span style=\"color: limegreen;\"><b>" . _ONLINE2 . "</b></span>\n";
                    }
                    else
                    {
                    $online = _STATUT . " : <span style=\"color: red;\"><b>" . _OFFLINE . "</b></span>\n";
                    }

                    echo _MESSAGES . " : " . $nb_post . "<br />" . _REGISTERED . ": " . $date_member . "<br />" . $online . "<br />\n";

                    if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo _IP . " : " . $auteur_ip;
                    }
                    }
                    else
                    {
                    echo "<b>" . $auteur . "</b><br />\n";

                    if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo _IP . " : " . $auteur_ip;
                    }
                    }
                    }
                    else
                    {
                    echo "<b>" . $auteur . "</b><br />\n";

                    if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo _IP . " : " . $auteur_ip;
                    }
                    }

                    echo "</td><td style=\"width: 75%;\" valign=\"top\">\n"
                    . "<table width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n"
                    . "<tr><td><img src=\"images/posticon.gif\" alt=\"\" />" . _POSTEDON . " " . $date . "  " . $attach_file . "</td><td align=\"right\">";

                    if ($closed == 0 && $administrator == 1 || $visiteur >= admin_mod("Forum") || $visiteur >= $level)
                    {
                    echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "&do=quote\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/quote.gif\" alt=\"\" title=\"" . _REPLYQUOTE . "\" /></a>";
                    }

                    if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo " <a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&mess_id=" . $mess_id . "&do=edit\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" title=\"" . _EDITMESSAGE . "\" alt=\"\" /></a>";
                    }

                    if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo " <a href=\"index.php?file=Forum&op=del&mess_id=" . $mess_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELMESSAGE . "\" /></a>";
                    }

                    echo "</td></tr><tr style=\"background: " . $color . ";\"><td colspan=\"2\"><b>" . $title . "</b></td></tr>\n"
                    . "<tr style=\"background: " . $color . ";\"><td colspan=\"2\">" . $txt . "<br /><br /></td></tr>\n";

                    if ($edition != "")
                    {
                    echo "<tr style=\"background: " . $color . ";\"><td colspan=\"2\"><small><i>" . $edition . "</i></small></td></tr>\n";
                    }

                    if ($auteur_id != "" && $signature != "" && $usersig == 1)
                    {
                    echo "<tr style=\"background: " . $color . ";\"><td style=\"border-top: 1px dashed " . $color3 . ";\" colspan=\"2\">" . $signature . "</td></tr>\n";
                    }

                    echo "</table></td></tr>\n"
                    . "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"middle\"><a href=\"#top\"><b>" . _BACKTOTOP . "</b></a></td><td style=\"width: 75%;\" valign=\"bottom\">";

                    if ($auteur_id != "")
                    {
                    echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\" title=\"" . _SEEPROFIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/profile.gif\" alt=\"\" /></a>";
                    }

                    if ($user && $auteur_id != "")
                    {
                    echo "<a href=\"index.php?file=Userbox&op=post_message&for=" . $auteur_id . "\" title=\"" . _SENDPM . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/message.gif\" alt=\"\" /></a>";
                    }

                    if ($email != "" && $auteur_id != "")
                    {
                    echo "<a href=\"mailto:" . $email . "\" title=\"" . _SENDEMAIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/email.gif\" alt=\"\" /></a>";
                    }

                    if ($homepage != "" && $auteur_id != "")
                    {
                    echo "<a href=\"" . $homepage . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _SEEHOMEPAGE . " " . $autor . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/website.gif\" alt=\"\" /></a>";
                    }

                    if ($icq != "" && $auteur_id != "")
                    {
                    echo "<a href=\"https://web.icq.com?from=/whitepages/add_me&uin=" . $icq . "&action=add\"><img style=\"border: 0;\" src=\"modules/Forum/images/icq.gif\" title=\"" . $icq . "\" alt=\"\" /></a>";
                    }

                    if ($msn != "" && $auteur_id != "")
                    {
                    echo "<a href=\"mailto:" . $msn . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/msn.gif\" title=\"" . $msn . "\" alt=\"\" /></a>";
                    }

                    if ($aim != "" && $auteur_id != "")
                    {
                    echo "<a href=\"aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there+?\" onclick=\"window.open(this.href); return false;\"><img style=\"border: 0;\" src=\"modules/Forum/images/aol.gif\" title=\"" . $aim . "\" alt=\"\" /></a>";
                    }

                    if ($yim != "" && $auteur_id != "")
                    {
                    echo "<a href=\"https://fr.yahoo.com/?p=us" . $yim . "&src=pg\"><img style=\"border: 0;\" src=\"modules/Forum/images/yim.gif\" title=\"" . $yim . "\" alt=\"\" /></a>";
                    }

                    echo "</td></tr>\n";
                    }

                    echo "</table><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td valign=\"top\">";

                    if ($highlight != "")
                    {
                    $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                    }
                    else
                    {
                    $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                    }

                    if ($count > $nb_mess_for_mess)
                    {
                    number($count, $nb_mess_for_mess, $url_page);
                    }

                    echo "</td><td align=\"right\" valign=\"top\">";

                    if ($user[0] != "")
                    {
                    $sql_notify = mysql_query("SELECT emailnotify FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' AND auteur_id = '" . $user[0] . "'");
                    $user_notify = mysql_num_rows($sql_notify);

                    if ($user_notify > 0)
                    {
                    $inotify = 0;
                    while(list($notify) = mysql_fetch_array($sql_notify))
                    {
                    if ($notify == 1)
                    {
                    $inotify++;
                    }

                    }

                    if ($inotify > 0)
                    {
                    echo "<a href=\"index.php?file=Forum&op=notify&do=off&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYOFF . "</a><br />\n";
                    }
                    else
                    {
                    echo "<a href=\"index.php?file=Forum&op=notify&do=on&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYON . "</a><br />\n";
                    }

                    }

                    }

                    if ($level == 0 || $visiteur >= $level || $administrator == 1)
                    {
                    echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                    if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                    {
                    echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                    }

                    }

                    echo "</td></tr></table>\n";

                    if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                    {
                    echo "<br /><a href=\"index.php?file=Forum&op=del_topic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_delete.gif\" alt=\"\" title=\"" . _TOPICDEL . "\" /></a>"
                    . " <a href=\"index.php?file=Forum&op=move&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_move.gif\" alt=\"\" title=\"" . _TOPICMOVE . "\" /></a>";

                    if ($closed == 1)
                    {
                    echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=open\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_unlock.gif\" alt=\"\" title=\"" . _TOPICUNLOCK . "\" /></a>";
                    }
                    else
                    {
                    echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=close\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_lock.gif\" alt=\"\" title=\"" . _TOPICLOCK . "\" /></a>";
                    }

                    if ($annonce == 1)
                    {
                    echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=down\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_down.gif\" alt=\"\" title=\"" . _TOPICDOWN . "\" /></a>";
                    }
                    else
                    {
                    echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=up\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_up.gif\" alt=\"\" title=\"" . _TOPICUP . "\" /></a>";
                    }
                    }

                    if ($user)
                    {
                    $visit = mysql_query("SELECT id FROM " . FORUM_READ_TABLE . " WHERE thread_id = '" . $thread_id . "' AND forum_id = '" . $forum_id . "' AND user_id = '" . $user[0] . "'");
                    $user_visit = mysql_num_rows($visit);

                    if ($user_visit == 0)
                    {
                    $sql_visit = mysql_query("INSERT INTO " . FORUM_READ_TABLE . " ( `id` , `user_id` , `thread_id` , `forum_id` ) VALUES ( '' , '" . $user[0] . "' , '" . $thread_id . "' , '" . $forum_id . "' )");
                    }
                    }
                    }
                    }
                    else if ($level_access == -1)
                    {
                    echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                    }
                    else if ($level_access == 1 && $visiteur == 0)
                    {
                    echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b></div><br /><br />";
                    }
                    else
                    {
                    echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                    }

                    function resize_signature($img_sign)
                    {
                    global $sign_width;

                    $img_sign = checkimg($img_sign);
                    $ext = strrchr($img_sign, '.');
                    $ext = strtolower(substr($ext, 1));

                    if ($ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png") $test = 1;
                    else $test = 0;

                    if (!eregi("%20", $img_sign) && $test == 1) list($w_sign, $h_sign, $t_sign, $at_sign) = @getimagesize($img_sign);

                    if ($w_sign != "" && $w_sign <= $sign_width) $s_width = "width=\"" . $w_sign . "\" ";
                    else if ($w_sign != "") $s_width = "width=\"" . $sign_width . "\" ";
                    else $s_width = "";

                    $image_signature = "<img src=\"" . $img_sign . "\" " . $s_width . "alt=\"\" />";
                    return($image_signature);
                    }

                    closetable();

                    ?>
                    1. premier code

                      <?php
                      // -------------------------------------------------------------------------//
                      // Nuked-KlaN - 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. //
                      // -------------------------------------------------------------------------//
                      if (!defined("INDEX_CHECK"))
                      {
                      die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
                      }

                      global $nuked, $user, $language, $theme, $thread_id, $forum_id, $p, $vote, $highlight;

                      translate("modules/Forum/lang/" . $language . ".lang.php");
                      include("modules/Forum/template.php");

                      opentable();

                      if (!$user)
                      {
                      $visiteur = 0;
                      }
                      else
                      {
                      $visiteur = $user[1];
                      }
                      $ModName = basename(dirname(__FILE__));
                      $level_access = nivo_mod($ModName);
                      if ($visiteur >= $level_access && $level_access > -1)
                      {
                      $nb_mess_for_mess = $nuked[mess_forum_page];

                      $sql = mysql_query("SELECT nom, moderateurs, cat, level FROM " . FORUM_TABLE . " WHERE " . $visiteur . " >= niveau AND id = '" . $forum_id . "'");
                      $level_ok = mysql_num_rows($sql);

                      $sql2 = mysql_query("SELECT titre, view, closed, annonce, last_post, auteur_id, sondage FROM " . FORUM_THREADS_TABLE . " WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");
                      $topic_ok = mysql_num_rows($sql2);

                      if ($level_ok == 0)
                      {
                      echo "<br /><br /><div style=\"text-align: center;\">" . _NOACCESSFORUM . "</div><br /><br />";
                      }
                      else if ($topic_ok == 0)
                      {
                      echo "<br /><br /><div style=\"text-align: center;\">" . _NOTOPICEXIST . "</div><br /><br />";
                      }
                      else
                      {
                      list($nom, $modos, $cat, $level) = mysql_fetch_array($sql);
                      $nom = stripslashes($nom);
                      $nom = htmlentities($nom);

                      $sql_cat = mysql_query("SELECT nom FROM " . FORUM_CAT_TABLE . " WHERE id = '" . $cat . "'");
                      list($cat_name) = mysql_fetch_array($sql_cat);
                      $cat_name = stripslashes($cat_name);
                      $cat_name = htmlentities($cat_name);

                      if ($user && $modos != "" && ereg($user[0], $modos))
                      {
                      $administrator = 1;
                      }
                      else
                      {
                      $administrator = 0;
                      }

                      list($titre, $read, $closed, $annonce, $lastpost, $topic_aid, $sondage) = mysql_fetch_array($sql2);
                      $titre = stripslashes($titre);
                      $titre = htmlentities($titre);
                      $titre = nk_CSS($titre);

                      $upd = mysql_query("UPDATE " . FORUM_THREADS_TABLE . " SET view = view + 1 WHERE forum_id = '" . $forum_id . "' AND id = '" . $thread_id . "'");

                      $sql_next = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post > " . $lastpost. " AND forum_id = '" . $forum_id . "' ORDER BY last_post LIMIT 0, 1");
                      list($nextid) = mysql_fetch_array($sql_next);

                      if ($nextid != "")
                      {
                      $next = "<small><a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $nextid . "\">" . _NEXTTHREAD . "</a> ></small>";
                      }

                      $sql_last = mysql_query("SELECT id FROM " . FORUM_THREADS_TABLE . " WHERE last_post < " . $lastpost . " AND forum_id = '" . $forum_id . "' ORDER BY last_post DESC LIMIT 0, 1");
                      list($lastid) = mysql_fetch_array($sql_last);

                      if ($lastid != "")
                      {
                      $prev = "<small>< <a href=\"index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $lastid . "\">" . _LASTTHREAD . "</a> </small>";
                      }

                      echo "<br /><a name=\"top\"></a><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\">\n"
                      . "<tr><td><big><b>" . $titre . "</b></big></td><td align=\"right\">" . $prev . " " . $next . "</td></tr>\n"
                      . "<tr><td valign=\"bottom\"><a href=\"index.php?file=Forum\"><b>" . _INDEXFORUM . "</b></a> -> <a href=\"index.php?file=Forum&cat=" . $cat . "\"><b>" . $cat_name . "</b></a> -> <a href=\"index.php?file=Forum&page=viewforum&forum_id=" . $forum_id . "\"><b>" . $nom . "</b></a>\n";

                      $sql3 = mysql_query("SELECT thread_id FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                      $count = mysql_num_rows($sql3);

                      if (!$p) $p = 1;
                      $start = $p * $nb_mess_for_mess - $nb_mess_for_mess;

                      if ($highlight != "")
                      {
                      $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                      }
                      else
                      {
                      $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                      }

                      if ($count > $nb_mess_for_mess)
                      {
                      echo "<br /><br />\n";
                      number($count, $nb_mess_for_mess, $url_page);
                      }

                      echo "</td><td align=\"right\" valign=\"bottom\">";

                      if ($level == 0 || $visiteur >= $level || $administrator == 1)
                      {
                      echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                      if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                      {
                      echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                      }
                      }

                      echo "</td></tr></table>\n"
                      . "<table style=\"background: " . $color3 . ";\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">\n";

                      if ($sondage == 1)
                      {
                      echo "<tr style=\"background: " . $color2 . ";\"><td colspan=\"2\" align=\"center\">";

                      $sql_poll = mysql_query("SELECT id, titre FROM " . FORUM_POLL_TABLE . " WHERE thread_id = '" . $thread_id . "'");
                      list($poll_id, $question) = mysql_fetch_array($sql_poll);
                      $question = stripslashes($question);
                      $question = htmlentities($question);

                      if ($user && $topic_aid == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Forum&op=edit_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" alt=\"\" title=\"" . _EDITPOLL . "\" /></a> <a href=\"index.php?file=Forum&op=del_poll&poll_id=" . $poll_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELPOLL . "\" /></a> </div>\n";
                      }

                      $check = mysql_query("SELECT auteur_ip FROM " . FORUM_VOTE_TABLE . " WHERE poll_id = '" . $poll_id . "' AND auteur_id = '" . $user[0] . "'");
                      $test = mysql_num_rows($check);

                      if ($user && $test > 0 || $vote == "view")
                      {
                      echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"2\" cellpadding=\"4\" border=\"0\">\n"
                      . "<tr><td colspan=\"2\" align=\"center\"><b>" . $question . "</b></td></tr>\n";

                      $sql_options = mysql_query("SELECT option_vote FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                      $nbcount = 0;

                      while (list($option_vote) = mysql_fetch_array($sql_options))
                      {
                      $nbcount = $nbcount + $option_vote;
                      }

                      $sql_res = mysql_query("SELECT option_vote, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                      while (list($optioncount, $option_text) = mysql_fetch_array($sql_res))
                      {
                      $optiontext = stripslashes($option_text);
                      $optiontext = htmlentities($option_text);

                      if ($nbcount <> 0)
                      {
                      $etat = ($optioncount * 100) / $nbcount ;
                      }
                      else
                      {
                      $etat = 0;
                      }

                      $pourcent_arrondi = round($etat);

                      echo "<tr><td>" . $optiontext . "</td><td>";

                      if ($etat < 1)
                      {
                      $width = 2;
                      }
                      else
                      {
                      $width = $etat * 2;
                      }

                      if (is_file("themes/" . $theme . "/images/bar.gif"))
                      {
                      $img = "themes/" . $theme . "/images/bar.gif";
                      }
                      else
                      {
                      $img = "modules/Forum/images/bar.gif";
                      }

                      echo "<img src=\"" . $img . "\" width=\"" . $width . "\" height=\"10\" alt=\"\" title=\"" . $pourcent_arrondi . "%\" /> " . $pourcent_arrondi . "% (" . $optioncount . ")</td></tr>\n";
                      }
                      echo "<tr></tr><td align=\"center\" colspan=\"2\"><b>" . _TOTALVOTE . " : </b>" . $nbcount . "</td></tr></table>\n";
                      }
                      else
                      {
                      echo "<form method=\"post\" action=\"index.php?file=Forum&op=vote&poll_id=" . $poll_id . "\">\n"
                      . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n"
                      . "<tr><td align=\"center\"><b>" . $question . "</b></td></tr>\n";

                      $sql_options = mysql_query("SELECT id, option_text FROM " . FORUM_OPTIONS_TABLE . " WHERE poll_id = '" . $poll_id . "' ORDER BY id ASC");
                      while (list($voteid, $optiontext) = mysql_fetch_array($sql_options))
                      {
                      $optiontext = stripslashes($optiontext);
                      $optiontext = htmlentities($optiontext);

                      echo "<tr><td><input type=\"radio\" class=\"checkbox\" name=\"voteid\" value=\"" . $voteid . "\" /> " . $optiontext . "</td></tr>\n";
                      }

                      echo "<tr><td> <input type=\"hidden\" name=\"forum_id\" value=\"" . $forum_id . "\" /><input type=\"hidden\" name=\"thread_id\" value=\"" . $thread_id . "\" /></td></tr>\n"
                      . "<tr><td align=\"center\"><input type=\"submit\" value=\"" . _TOVOTE . "\" /> <input type=\"button\" value=\"" . _RESULT . "\" onclick=\"document.location='index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&vote=view'\" /></td></tr></table></form>\n";
                      }

                      echo "</td></tr>\n";
                      }

                      echo "<tr " . $background . "><td style=\"width: 25%;\" align=\"center\"><b>" . _AUTHOR . "</b></td><td style=\"width: 75%;\" align=\"center\"><b>" . _MESSAGE . "</b></td></tr>\n";

                      $sql4 = mysql_query("SELECT id, titre, auteur, auteur_id, auteur_ip, txt, date, edition, bbcodeoff, smileyoff, cssoff, usersig, file FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' ORDER BY date ASC limit " . $start . ", " . $nb_mess_for_mess);
                      while (list($mess_id, $title, $auteur, $auteur_id, $auteur_ip, $txt, $date, $edition, $bbcodeoff, $smileyoff, $cssoff, $usersig, $fichier) = mysql_fetch_row($sql4))
                      {
                      $txt = stripslashes($txt);
                      $title = stripslashes($title);
                      $auteur = stripslashes($auteur);

                      if ($highlight != "")
                      {
                      $string = trim($highlight);
                      $search = explode(" ", $string);

                      for($i = 0; $i < count($search); $i++)
                      {
                      $words = preg_quote($search[$i]);
                      $title = eregi_replace($words, "<span style=\"color: #FF0000;\">" . $words . "</span>", $title);

                      if ($bbcodeoff == 0)
                      {
                      $txt = eregi_replace($words, "[color= #FF0000][b]" . $words . "/b/color", $txt);
                      }
                      else
                      {
                      $txt = eregi_replace($words, "<span style=\"color: #FF0000;\"><b>" . $words . "</b></span>", $txt);
                      }
                      }

                      }

                      $title = htmlentities($title, ENT_NOQUOTES);
                      $title = eregi_replace("<", "<", $title);
                      $title = eregi_replace(">", ">", $title);

                      if ($bbcodeoff == 0)
                      {
                      $txt = htmlentities($txt);
                      }
                      else
                      {
                      $txt = htmlentities($txt, ENT_NOQUOTES);

                      $txt = eregi_replace("<", "<", $txt);
                      $txt = eregi_replace(">", ">", $txt);
                      }

                      if ($cssoff == 0)
                      {
                      $title = nk_CSS($title);
                      $txt = nk_CSS($txt);
                      $auteur = nk_CSS($auteur);
                      }

                      if ($bbcodeoff == 0) $txt = BBcode($txt);
                      if ($smileyoff == 0) $txt = icon($txt);

                      if (strftime("%d %m %Y", time()) == strftime("%d %m %Y", $date)) $date = _FTODAY . " " . strftime("%H:%M", $date);
                      else if (strftime("%d", $date) == (strftime("%d", time()) - 1) && strftime("%m %Y", time()) == strftime("%m %Y", $date)) $date = _FYESTERDAY . " " . strftime("%H:%M", $date);
                      else $date = _THE . " " . strftime("%x %H:%M", $date);

                      $tmpcnt++ % 2 == 1 ? $color = $color1 : $color = $color2;

                      echo "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"top\"><a name=\"" . $mess_id . "\"></a>";

                      if ($auteur_id != "")
                      {
                      $sq_user = mysql_query("SELECT pseudo, niveau, rang, avatar, signature, date, email, icq, msn, aim, yim, url, count FROM " . USER_TABLE . " WHERE id = '" . $auteur_id . "'");
                      $test = mysql_num_rows($sq_user);
                      list($autor, $user_level, $rang, $avatar, $signature, $date_member, $email, $icq, $msn, $aim, $yim, $homepage, $nb_post) = mysql_fetch_array($sq_user);

                      if ($test > 0 && $autor != "")
                      {
                      $date_member = strftime("%x", $date_member);

                      if ($signature != "")
                      {
                      $signature = stripslashes($signature);
                      $signature = nk_CSS($signature);
                      if ($signature_resize == "on") $signature = preg_replace("/\[img\](.*?)\[\/img\]/e", "resize_signature('\\1')", $signature);
                      $signature = BBcode($signature);
                      }

                      if ($fichier != "" && is_file("upload/Forum/" . $fichier))
                      {
                      $url_file = "upload/Forum/" . $fichier;
                      $filesize = filesize($url_file) / 1024;
                      $arrondi_size = ceil($filesize);
                      $file = explode(".", $fichier);
                      $ext = count($file)-1;

                      if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      $del = " <a href=\"index.php?file=Forum&op=del_file&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/del.gif\" alt=\"\" title=\"" . _DELFILE . "\" /></a>";
                      }
                      else
                      {
                      $del = "";
                      }

                      $attach_file = "<br /><img src=\"modules/Forum/images/file.gif\" alt=\"\" title=\"" . _ATTACHFILE . "\" /><a href=\"" . $url_file . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _DOWNLOADFILE . "\">" . $fichier . "</a> (" . $arrondi_size . " Ko)" . $del;
                      }
                      else
                      {
                      $attach_file = "";
                      }

                      if ($modos != "" && ereg($auteur_id, $modos))
                      {
                      $auteur_modo = 1;
                      }
                      else
                      {
                      $auteur_modo = 0;
                      }

                      if ($rang > 0 && $nuked['forum_rank_team'] == "on")
                      {
                      $sql_rank_team = mysql_query("SELECT titre FROM " . TEAM_RANK_TABLE . " WHERE id = '" . $rang . "'");
                      list($rank_name) = mysql_fetch_array($sql_rank_team);
                      $rank_name = stripslashes($rank_name);
                      $rank_name = htmlentities($rank_name);
                      $rank_image = "";
                      }
                      else
                      {
                      if ($user_level >= admin_mod("Forum"))
                      {
                      $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 2");
                      }
                      else if ($auteur_modo == 1)
                      {
                      $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE type = 1");
                      }
                      else
                      {
                      $user_rank = mysql_query("SELECT nom, image FROM " . FORUM_RANK_TABLE . " WHERE " . $nb_post . " >= post AND type = 0 ORDER BY post DESC LIMIT 0, 1");
                      }

                      list($rank_name, $rank_image) = mysql_fetch_array($user_rank);
                      $rank_name = stripslashes($rank_name);
                      $rank_name = htmlentities($rank_name);
                      }

                      echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\"><b>" . $autor . "</b></a><br />\n";

                      if ($rank_name != "")
                      {
                      echo $rank_name . "<br />\n";
                      }

                      if ($rank_image != "")
                      {
                      echo "<img src=\"" . $rank_image . "\" alt=\"\" /><br /><br />\n";
                      }

                      if ($avatar != "")
                      {
                      if ($avatar_resize == "off") $ar_ok = 0;
                      else if (eregi("http://", $avatar) && $avatar_resize == "local") $ar_ok = 0;
                      else $ar_ok = 1;

                      if (!eregi("%20", $avatar) && $ar_ok == 1) list($w, $h, $type, $attr) = @getimagesize($avatar);
                      if ($w != "" && $w <= $avatar_width) $width = "width=\"" . $w . "\" ";
                      else if ($w != "") $width = "width=\"" . $avatar_width . "\" ";
                      else $width = "";
                      echo "<img src=\"" . $avatar . "\" " . $width . "alt=\"\" /><br />\n";
                      }

                      $online_connect = mysql_query("SELECT user_id FROM " . NBCONNECTE_TABLE . " WHERE user_id = '" . $auteur_id . "'");
                      list($connect_id) = mysql_fetch_array($online_connect);

                      if($auteur_id == $connect_id)
                      {
                      $online = _STATUT . " : <span style=\"color: limegreen;\"><b>" . _ONLINE2 . "</b></span>\n";
                      }
                      else
                      {
                      $online = _STATUT . " : <span style=\"color: red;\"><b>" . _OFFLINE . "</b></span>\n";
                      }

                      echo _MESSAGES . " : " . $nb_post . "<br />" . _REGISTERED . ": " . $date_member . "<br />" . $online . "<br />\n";

                      if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo _IP . " : " . $auteur_ip;
                      }
                      }
                      else
                      {
                      echo "<b>" . $auteur . "</b><br />\n";

                      if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo _IP . " : " . $auteur_ip;
                      }
                      }
                      }
                      else
                      {
                      echo "<b>" . $auteur . "</b><br />\n";

                      if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo _IP . " : " . $auteur_ip;
                      }
                      }

                      echo "</td><td style=\"width: 75%;\" valign=\"top\">\n"
                      . "<table width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" border=\"0\">\n"
                      . "<tr><td><img src=\"images/posticon.gif\" alt=\"\" />" . _POSTEDON . " " . $date . "  " . $attach_file . "</td><td align=\"right\">";

                      if ($closed == 0 && $administrator == 1 || $visiteur >= admin_mod("Forum") || $visiteur >= $level)
                      {
                      echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&mess_id=" . $mess_id . "&do=quote\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/quote.gif\" alt=\"\" title=\"" . _REPLYQUOTE . "\" /></a>";
                      }

                      if ($user && $auteur_id == $user[0] || $visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo " <a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&mess_id=" . $mess_id . "&do=edit\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/edit.gif\" title=\"" . _EDITMESSAGE . "\" alt=\"\" /></a>";
                      }

                      if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo " <a href=\"index.php?file=Forum&op=del&mess_id=" . $mess_id . "&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/delete.gif\" alt=\"\" title=\"" . _DELMESSAGE . "\" /></a>";
                      }

                      echo "</td></tr><tr style=\"background: " . $color . ";\"><td colspan=\"2\"><b>" . $title . "</b></td></tr>\n"
                      . "<tr style=\"background: " . $color . ";\"><td colspan=\"2\">" . $txt . "<br /><br /></td></tr>\n";

                      if ($edition != "")
                      {
                      echo "<tr style=\"background: " . $color . ";\"><td colspan=\"2\"><small><i>" . $edition . "</i></small></td></tr>\n";
                      }

                      if ($auteur_id != "" && $signature != "" && $usersig == 1)
                      {
                      echo "<tr style=\"background: " . $color . ";\"><td style=\"border-top: 1px dashed " . $color3 . ";\" colspan=\"2\">" . $signature . "</td></tr>\n";
                      }

                      echo "</table></td></tr>\n"
                      . "<tr style=\"background: " . $color . ";\"><td style=\"width: 25%;\" valign=\"middle\"><a href=\"#top\"><b>" . _BACKTOTOP . "</b></a></td><td style=\"width: 75%;\" valign=\"bottom\">";

                      if ($auteur_id != "")
                      {
                      echo "<a href=\"index.php?file=Members&op=detail&autor=" . urlencode($autor) . "\" title=\"" . _SEEPROFIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/profile.gif\" alt=\"\" /></a>";
                      }

                      if ($user && $auteur_id != "")
                      {
                      echo "<a href=\"index.php?file=Userbox&op=post_message&for=" . $auteur_id . "\" title=\"" . _SENDPM . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/message.gif\" alt=\"\" /></a>";
                      }

                      if ($email != "" && $auteur_id != "")
                      {
                      echo "<a href=\"mailto:" . $email . "\" title=\"" . _SENDEMAIL . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/email.gif\" alt=\"\" /></a>";
                      }

                      if ($homepage != "" && $auteur_id != "")
                      {
                      echo "<a href=\"" . $homepage . "\" onclick=\"window.open(this.href); return false;\" title=\"" . _SEEHOMEPAGE . " " . $autor . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/website.gif\" alt=\"\" /></a>";
                      }

                      if ($icq != "" && $auteur_id != "")
                      {
                      echo "<a href=\"https://web.icq.com?from=/whitepages/add_me&uin=" . $icq . "&action=add\"><img style=\"border: 0;\" src=\"modules/Forum/images/icq.gif\" title=\"" . $icq . "\" alt=\"\" /></a>";
                      }

                      if ($msn != "" && $auteur_id != "")
                      {
                      echo "<a href=\"mailto:" . $msn . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/msn.gif\" title=\"" . $msn . "\" alt=\"\" /></a>";
                      }

                      if ($aim != "" && $auteur_id != "")
                      {
                      echo "<a href=\"aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there+?\" onclick=\"window.open(this.href); return false;\"><img style=\"border: 0;\" src=\"modules/Forum/images/aol.gif\" title=\"" . $aim . "\" alt=\"\" /></a>";
                      }

                      if ($yim != "" && $auteur_id != "")
                      {
                      echo "<a href=\"https://fr.yahoo.com/?p=us" . $yim . "&src=pg\"><img style=\"border: 0;\" src=\"modules/Forum/images/yim.gif\" title=\"" . $yim . "\" alt=\"\" /></a>";
                      }

                      echo "</td></tr>\n";
                      }

                      echo "</table><table width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\"><tr><td valign=\"top\">";

                      if ($highlight != "")
                      {
                      $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&highlight=" . urlencode($highlight);
                      }
                      else
                      {
                      $url_page = "index.php?file=Forum&page=viewtopic&forum_id=" . $forum_id . "&thread_id=" . $thread_id;
                      }

                      if ($count > $nb_mess_for_mess)
                      {
                      number($count, $nb_mess_for_mess, $url_page);
                      }

                      echo "</td><td align=\"right\" valign=\"top\">";

                      if ($user[0] != "")
                      {
                      $sql_notify = mysql_query("SELECT emailnotify FROM " . FORUM_MESSAGES_TABLE . " WHERE thread_id = '" . $thread_id . "' AND auteur_id = '" . $user[0] . "'");
                      $user_notify = mysql_num_rows($sql_notify);

                      if ($user_notify > 0)
                      {
                      $inotify = 0;
                      while(list($notify) = mysql_fetch_array($sql_notify))
                      {
                      if ($notify == 1)
                      {
                      $inotify++;
                      }

                      }

                      if ($inotify > 0)
                      {
                      echo "<a href=\"index.php?file=Forum&op=notify&do=off&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYOFF . "</a><br />\n";
                      }
                      else
                      {
                      echo "<a href=\"index.php?file=Forum&op=notify&do=on&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\">" . _NOTIFYON . "</a><br />\n";
                      }

                      }

                      }

                      if ($level == 0 || $visiteur >= $level || $administrator == 1)
                      {
                      echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/newthread.gif\" alt=\"\" title=\"" . _NEWSTOPIC . "\" /></a>";

                      if ($closed == 0 || $administrator == 1 || $visiteur >= admin_mod("Forum"))
                      {
                      echo "<a href=\"index.php?file=Forum&page=post&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/buttons/" . $language . "/reply.gif\" alt=\"\" title=\"" . _REPLY . "\" /></a>";
                      }

                      }

                      echo "</td></tr></table>\n";

                      if ($visiteur >= admin_mod("Forum") || $administrator == 1)
                      {
                      echo "<br /><a href=\"index.php?file=Forum&op=del_topic&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_delete.gif\" alt=\"\" title=\"" . _TOPICDEL . "\" /></a>"
                      . " <a href=\"index.php?file=Forum&op=move&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_move.gif\" alt=\"\" title=\"" . _TOPICMOVE . "\" /></a>";

                      if ($closed == 1)
                      {
                      echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=open\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_unlock.gif\" alt=\"\" title=\"" . _TOPICUNLOCK . "\" /></a>";
                      }
                      else
                      {
                      echo " <a href=\"index.php?file=Forum&op=lock&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=close\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_lock.gif\" alt=\"\" title=\"" . _TOPICLOCK . "\" /></a>";
                      }

                      if ($annonce == 1)
                      {
                      echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=down\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_down.gif\" alt=\"\" title=\"" . _TOPICDOWN . "\" /></a>";
                      }
                      else
                      {
                      echo " <a href=\"index.php?file=Forum&op=announce&forum_id=" . $forum_id . "&thread_id=" . $thread_id . "&do=up\"><img style=\"border: 0;\" src=\"modules/Forum/images/topic_up.gif\" alt=\"\" title=\"" . _TOPICUP . "\" /></a>";
                      }
                      }

                      if ($user)
                      {
                      $visit = mysql_query("SELECT id FROM " . FORUM_READ_TABLE . " WHERE thread_id = '" . $thread_id . "' AND forum_id = '" . $forum_id . "' AND user_id = '" . $user[0] . "'");
                      $user_visit = mysql_num_rows($visit);

                      if ($user_visit == 0)
                      {
                      $sql_visit = mysql_query("INSERT INTO " . FORUM_READ_TABLE . " ( `id` , `user_id` , `thread_id` , `forum_id` ) VALUES ( '' , '" . $user[0] . "' , '" . $thread_id . "' , '" . $forum_id . "' )");
                      }
                      }
                      }
                      }
                      else if ($level_access == -1)
                      {
                      echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                      }
                      else if ($level_access == 1 && $visiteur == 0)
                      {
                      echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b></div><br /><br />";
                      }
                      else
                      {
                      echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _BACK . "</b></a></div><br /><br />";
                      }

                      function resize_signature($img_sign)
                      {
                      global $sign_width;

                      $img_sign = checkimg($img_sign);
                      $ext = strrchr($img_sign, '.');
                      $ext = strtolower(substr($ext, 1));

                      if ($ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png") $test = 1;
                      else $test = 0;

                      if (!eregi("%20", $img_sign) && $test == 1) list($w_sign, $h_sign, $t_sign, $at_sign) = @getimagesize($img_sign);

                      if ($w_sign != "" && $w_sign <= $sign_width) $s_width = "width=\"" . $w_sign . "\" ";
                      else if ($w_sign != "") $s_width = "width=\"" . $sign_width . "\" ";
                      else $s_width = "";

                      $image_signature = "<img src=\"" . $img_sign . "\" " . $s_width . "alt=\"\" />";
                      return($image_signature);
                      }

                      closetable();

                      ?>
                      1. Et bah, si tu veux faire ta fusion, tu mets ce code la dans l'autre fichier pis point !