Page 1 of 3
Spam Protector Issue: Captchas not showing!!
Posted: Tue Mar 22, 2005 3:47 am
by dorian2727
The plugin is showing in the comment section, but the Captchas are not showing. See link
http://www.redstaterant.com/archives/24 ... l#comments
Please help
Re: Spam Protector Issue: Captchas not showing!!
Posted: Wed Mar 23, 2005 12:37 pm
by garvinhicking
Please look at your spam protector config. By default captchas are only shown for articles older than 7 days.
Please post a screnshot (or 2 screenshots) how your spam protector config looks like!
Regards,
Garvin
CAPTCHAS
Posted: Tue Mar 29, 2005 7:26 am
by dorian2727
I had set the setting to "0" so the captchas would show all the ime, but it still did the same thing. It shows the empty boxes where to images should be.
Re: CAPTCHAS
Posted: Tue Mar 29, 2005 9:17 am
by garvinhicking
"Please post a screnshot (or 2 screenshots) how your spam protector config looks like! "
Regards,
Garvin
Screenshots
Posted: Thu Mar 31, 2005 8:57 pm
by dorian2727
Re: Screenshots
Posted: Fri Apr 01, 2005 11:00 am
by garvinhicking
Hm, okay. Your plugin configuration really looks good.
However I don't know why the plugin is not fetched. This may be a serendipity 0.7.1 issue, but I sadly don't have a 0.7.1 installation at hand or the time to create one. Would you maybe have the time to try a 0.8 installation or give me FTP access to your machine so that I can check?
Regards,
Garvin
Upgrade
Posted: Fri Apr 01, 2005 10:46 pm
by dorian2727
Will upgrading overwrite any of what I have designed on the site?
Re: Upgrade
Posted: Sun Apr 03, 2005 2:08 am
by garvinhicking
It shouldn't - please read the 0.8 migration doc at
http://www.s9y.org/63.html
Regards,Garvin
No captchas
Posted: Mon Apr 04, 2005 9:00 pm
by pano
I made a fresh installing of 0.8 beta 5, and my captchas does not show.
The route of image points to index.php?/plugin/captcha.... and there is no such directory.
I looked for this bug in forum, but i did not find any solution. Is this a not fixed bug? Or something is wrong with my captchas?
I had to disable captchas while they do not show.
thanks
Re: No captchas
Posted: Mon Apr 04, 2005 11:26 pm
by garvinhicking
Can you please activate it again and post the full URL to your blog? Then I'll have another look at it. It may be that some other plugins are interfering and sending output.
This can especially be if you once modified a plugin or copy+pasted code somewhere and introduced extra spaces at the top or end of the file.
Regards,
Garvin
Posted: Tue Apr 05, 2005 8:02 am
by pano
I activated it again.
You can see it in action in
www.casarusia.com
Thanks
Posted: Tue Apr 05, 2005 10:45 am
by garvinhicking
Pano, thanks a lot for reactivating it again. I think we're near to finding the error.
Please open your file plugins/serendipity_event_spamblock/serendipity_event_spamblock.php
There go to line 758 and find this piece of code:
Code: Select all
header('Content-Type: image/png');
$output_char = strtolower($_SESSION['spamblock']['captcha']{$parts[1] - 1});
$cap = $serendipity['serendipityPath'] . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
if (!file_exists($cap)) {
$cap = S9Y_INCLUDE_PATH . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
}
if (file_exists($cap)) {
echo file_get_contents($cap);
}
please modify this to that:
Code: Select all
header('Content-Type: image/png');
$output_char = strtolower($_SESSION['spamblock']['captcha']{$parts[1] - 1});
header('X-Spamblock-Char: ' . $output_char);
$cap = $serendipity['serendipityPath'] . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
header('X-Spamblock-File: ' . $cap);
if (!file_exists($cap)) {
$cap = S9Y_INCLUDE_PATH . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
header('X-Spamblock-File2: ' . $cap);
}
if (file_exists($cap)) {
header('X-Spamblock-Readable: true');
echo file_get_contents($cap);
} else {
header('X-Spamblock-Readable: false');
}
I added some debugging code there which will help me to analyze the problem. Once you have implemented that into the file, please report back. Then I will analyze the HTTP headers using the mozdev LiveHTTPHeaders tool when calling this url:
http://www.casarusia.com/index.php?/plu ... c8fd464cc1
regards,
Garvin
Posted: Tue Apr 05, 2005 11:17 am
by pano
I already replaced the code you wrote in the spamblock file.
-
pano
Posted: Tue Apr 05, 2005 11:21 am
by garvinhicking
Pano, okay.
These are the headers I get:
Code: Select all
X-Spamblock-Char: 7
X-Spamblock-File: /home/casaru/public_html/plugins/serendipity_event_spamblock/captcha_7.png
X-Spamblock-Readable: true
That means, serendipity can read the file "/home/casaru/public_html/plugins/serendipity_event_spamblock/captcha_7.png", and it should get displayed because of this code:
inside the spamblock plugin. But strangely, this function does not return a thing!
So there are two possible causes: First, the file captcha_7.png inside your plugin directory is empty or is not readable.
Second, a PHP function or safemode features fails on your host. To check this, please insert those lines after the line
Code: Select all
header('X-Spamblock-Readable: true');
// Insert those lines:
ini_set('display_errors', 'on');
error_reporting(E_ALL);
With this you should hopefully get an error message why the file cannot be opened!
Regards,
Garvin
Posted: Tue Apr 05, 2005 11:33 am
by pano
Really strange... i added the new code and i do not get any error.
Only captchas are still hidden.
The png files are ok, i can see them if i write the full path in a browser.
Maybe something wrong with gdlib? But it works with other scripts i have in the same server...
Best,