Index du Forum » » Sécurité

Auteur

[Résolu] - Correctif AntiSpamBots
xgonin
709      
 

  Posté : 07-07-2006 01:12

Et la suite...



   if ($topic_status!=0)

      $allow_to_reply=false;



   if ($allow_to_reply) {

     if ($submitP) {

// ##### ==> AntiSpamBots

      global $question, $anti_spam_bots, $redir;

      AntiSpamBots::reponse($question, $anti_spam_bots);

// ##### ==> AntiSpamBots

        $acc = "reply";

        $message=stripslashes($messag e);

        echo "<tr><td colspan=\"2\">";

        !include! ("preview.php");

        echo "</td></tr>";

     } else {

        $message='';

     }

     echo "<tr align=\"left\">";

     echo "<td class=\"LIGNB\" width=\"25%\"><b>".translate("Nickname: ")."<b></td>";

     echo "<td class=\"LIGNB\">";

     echo $userdata[1];

     echo "</td></tr>";

     if ($smilies) {

        echo "<tr align=\"left\" valign=\"top\">

        <td class=\"LIGNB\" width=\"25%\"><b>".translate("Message Icon: ")."<b></td>

        <td class=\"LIGNB\">";

        echo emotion_add($image_subject);

        echo "</td></tr>";

     }

     echo "<tr align=\"left\" valign=\"top\">";

     echo "<td class=\"LIGNB\" width=\"25%\"><b>".translate("Message: ")."</b><br /><br />";

     echo "<span style=\"font-size: 10px;\">";

     echo "HTML : ";

     if ($allow_html==1) {

        echo translate("On")."<br />";

        echo HTML_Add($allow_forum_hide);

     } else

        echo translate("Off")."<br />";

     if ($citation && !$submitP) {

        $sql = "SELECT p.post_text, p.post_time, u.uname FROM posts p, users u WHERE post_id = '$post' AND p.poster_id = u.uid";

        if ($r = mysql_query($sql)) {

           $m = mysql_fetch_array($r);

           $text = $m[post_text];

           if (($forum_type!="6") and ($forum_type!="5")) {

              ; $text = smile($text);

              ; $text = str_replace("<br />", "\n", $text);

           } else {

              ; $text = htmlspecialchars($text);

           }

           $text = stripslashes($text);

           if ($m[post_time]!="" && $m[uname]!="") {

              ; $reply = "<div class=\"QUOTE\">".translate("Quote")." : <b>$m[uname]</b>&nbsp;\n\n$text&nbsp;\n</div>";

           } else {

              ; $reply = $text."\n";

           }

           $reply = preg_replace("#\[hide\](.*?)\[\/hide\]#si","",$reply);

        } else {

           $reply = translate("Error Connecting to DB")."\n";

        }

     }

     if (!$reply) {$reply=$message;}

     echo "</span></td>";

     if ($allow_bbcode==1)

        $xJava = 'name="message" onSelect="storeCaret(this);" !onclick!="storeCaret(this);" !onkey!up="storeCaret(this);" !onfocus!="storeForm(this)"';

     echo "<td class=\"LIGNB\"><textarea class=\"textbox\" $xJava name=\"message\" rows=\"10\" cols=\"80\" wrap=\"virtual\">$reply</textarea><br />";

     if ($allow_bbcode == 1)

        putitems();

     echo "</td></tr><tr align=\"left\">";

     echo "<td class=\"LIGNB\" width=\"25%\"><b>".translate("Options: ")."</b></td>";

     echo "<td class=\"LIGNB\">";

     if (($allow_html == 1) and ($forum_type!="6") and ($forum_type!="5")) {

        if ($html == "on") {

           $sethtml = "checked";

        }

        echo "<input type=\"checkbox\" name=\"html\" ".$sethtml.">".translate("Disable HTML on this Post")."<br />";

     }

     if ($user) {

        if ($allow_sig == 1||$sig == "on") {

           $asig = mysql_query("select attachsig from users_status where uid='$cookie[0]'");

           list($attac hsig) = mysql_fetch_row($asig);

           if ($attachsig == 1) {

              ; $s = "checked";

           }

           if (($forum_type!="6") and ($forum_type!="5")) {

              ; echo "<input type=\"checkbox\" name=\"sig\" $s>".translate("Show signature")." <span style=\"font-size: 10px;\">(".translate("This can be altered or added in your profile").")</span><br />";

           }

        }

        if ($allow_upload_forum) {

           if ($upload == "on") {

              ; $up = "checked";

           } &nbs p;              ; 

           echo "<input type=\"checkbox\" name=\"upload\" $up>".translate("Upload file after send accepted")."<br />";

        }

     }

     echo "</td></tr><tr>";

     echo "<td class=\"LIGNA\" colspan=\"2\" align=\"center\">";

     echo "<input type=\"hidden\" name=\"forum\" value=$forum>";

     echo "<input type=\"hidden\" name=\"topic\" value=\"$topic\">";

// ##### ==> AntiSpamBots

     AntiSpamBots::question();

     AntiSpamBots::field();

// ##### ==> AntiSpamBots

     echo "<br /><input class=\"BOUTON_STANDARD\" type=\"submit\" name=\"submitS\" value=\"".translate("Submit")."\">&nbsp;";

     echo "&nbsp;<input class=\"BOUTON_STANDARD\" type=\"submit\" name=\"submitP\" value=\"".translate("Preview")."\">&nbsp;";

     echo "&nbsp;<input class=\"BOUTON_STANDARD\" type=\"reset\" value=\"".translate("Clear")."\">&nbsp;";

     echo "&nbsp;<input class=\"BOUTON_STANDARD\" type=\"submit\" name=\"cancel\" value=\"".translate("Cancel Post")."\"><br /><br />";

     echo "</td></tr>";

   } else {

     echo "<tr>";

     echo "<td class=\"LIGNA\" colspan=\"2\" align=\"center\">".translate("You are not allowed to reply in this forum")."</td>";

     echo "</tr>";

   }

   echo "</table></form>";

   if ($allow_to_reply) {

      echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">";

      echo "<tr><td class=\"HEADER\" colspan=\"2\" class=\"ONGL\" align=\"center\">".translate("Topic Review")."</td></tr>";

      if ($Mmod) {

         $post_aff="";

      } else {

         $post_aff=" and post_aff='1' ";

      }

      $sql = "SELECT * FROM posts WHERE topic_id='$topic'".$post_aff."ORDER BY post_id DESC limit 0,10";

      if (!$result = mysql_query($sql))

         forumerror('0001');

      $myrow = mysql_fetch_array($result);

      $count=0;

      do {

         $rowcolor=tablos();

         $posterdata = get_userdata_from_id($myrow[poster_id]);

         echo "<tr $rowcolor align=\"left\">";

         echo "<td valign=\"top\" width=\"15%\">";

         if ($posterdata[uname]!=$anonymous) {

            echo "<a href=\"powerpack.php?op=instant_message&amp;to_userid=$posterdata[uname]\" class=\"NOIR\">$posterdata[uname]</a>";

         } else {

            echo $posterdata[uname];

         }

         echo "<br />";

         $posts = $posterdata[posts];

         echo member_qualif($posterdata[uname], $posts, $posterdata[rank]);

         echo "<br /><br />";

         if ($smilies) {

            if ($posterdata[user_avatar] != '') {

              ;  if (stristr($posterdata[user_avatar],"users_private")) {

              ;     $imgtmp=$posterdata[user_avatar];

              ;  } else {

              ;     if ($ibid=theme_image("forum/avatar/$posterdata[user_avatar]")) {$imgtmp=$ibid;} else {$imgtmp="images/forum/avatar/$posterdata[user_avatar]";}

              ;  }

              ;  echo "<div class=\"avatar_cadre\"><img src=\"".$imgtmp."\" alt=\"".$posterdata[uname]."\" border=\"0\" /></div>";

            }

         }



         echo "</td><td wrap valign=\"top\">";

         echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">";

         echo "<tr><td wrap valign=\"top\" width=\"100%\" height=\"100%\">";



         if ($myrow[image] != "") {

            if ($ibid=theme_image("forum/subject/$myrow[image]")) {$imgtmp=$ibid;} else {$imgtmp="images/forum/subject/$myrow[image]";}

            echo "<img src=\"$imgtmp\" alt=\"\">";

         } else {

            if ($ibid=theme_image("forum/subject/icons/posticon.gif")) {$imgtmp=$ibid;} else {$imgtmp="images/forum/icons/posticon.gif";}

            echo "<img src=\"$imgtmp\" border=\"0\" alt=\"\" />";

         }

         echo "&nbsp;".translate("Posted: ").convertdate($myrow[post_time]);

         echo "<hr noshade size=\"1\" class=\"ONGL\">";

         $message = stripslashes($myrow[post_text]);

         if ($allow_bbcode==1) {

            $mess age = Smilie($message);

         }

         if ($allow_forum_hide) {

            $show _hide = false;

            if ($Mmod!=true) {

              ;  $sqlH = "Select count(*) from posts where topic_id = $topic and poster_id = $userdata[0]";

              ;  $resultH = @mysql_result(@mysql_query($sqlH),0,0);

              ;  if ($resultH>0) {

              ;     $show_hide = true;

              ;  }

            } else {

              ;  $show_hide = true;

            }

            $mess age = control_hide_post($message,$show_hide);

         }

         // <A href in the message

         if (stristr($message,"<a href")) {

            $mess age=eregi_replace("_blank\"", "_blank\" class=\"NOIR\"", $message);

         }

         $message=split_string_w ithout_space($message, 80);

         if (($forum_type=="6") or ($forum_type=="5")) {

            highl ight_string(stripslashes($myrow[post_text]))."<br /><br />";

         } else {

            $mess age = str_replace("

Xav
www.xgonin.ch", "<br /><br />" . nl2br($posterdata[user_sig]), $message);

            echo $message."<br />";

         }

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

         echo "</td></tr>";

         $count++;

      } while($myrow = mysql_fetch_array($result));

      echo "</table>";

   }

}

!include!('footer.php');

?>




Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=20839&forum=12