Ich habe mit vor ein paar tagen Serendipity heruntergeladen und "aufgespielt". Da ich die Shoutbox
nutzen möchte, aber keine Lust habe täglich bzw. stündlich Spam zu löschen, habe ich kurzer Hand
das Plugin modifiziert und ein Captcha eingebaut. Obwohl ich kein PHP Profi bin, war dies nicht allzu
schwer.
Im Grunde habe ich nur den original- Quellcode folgendermaßen modifiziert (serendipity_plugin_shoutbox.php):
Code: Select all
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'fillshoutbox' && $_REQUEST['serendipity']['shouttext'] != '' && $passedCaptchaValidation != false) {
//schreibs rein...
}Code: Select all
if(isset($_SESSION['cpta_bk_spam']) AND $_POST["bk_cpta"] == $_SESSION['cpta_bk_spam']) {
$passedCaptchaValidation = true;
unset($_SESSION['cpta_bk_spam']);
} else {
$passedCaptchaValidation = false;
unset($_SESSION['cpta_bk_spam']);
}Im "Form- Bereich" wurde folgendes hinzugefügt:
Code: Select all
<div style="width: 90%; display: inline; text-align: center;">
<div style="float: left;"><img src="plugins/serendipity_plugin_shoutbox/captcha.php" border="0" alt="" title="" width="84" height="24" /> </div>
<div style="float: left; text-align: center;">
<input name="bk_cpta" type="text" style=" width: 70px; font-weight:bold;" alt="" title="" />
</div>
<div style="clear: both;"></div>
</div>Jetzt zu meinem Problem. Alles funktioniert einwandfrei! Sobald ich mich allerdings auslogge
ist kein Captcha mehr gültig. "$_SESSION['cpta_bk_spam']" ist leer. Also Besucher können
keine Erinträge machen. Woran liegt das? Wie schon erwähnt sind meine PHP skills nicht so prall.