Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 01-24-2008, 08:36 AM
joerg Offline
forum loafer
 
Join Date: Jan 2008
Posts: 5
Captcha addon fpr PP1.71

Hi,

I can't get the captcha addon to work with PP1.71. I tried it in the simple template and the delicious template, copied the _captcha folder to the addons folder and inserted the <CAPTCHA> tag in the comments form. It shows the input box and the picture in the comments form, but it doesn't check the result - and I don't see why it should either. Where is the call of the audit function?

Any suggestions how to make it work?

I don't like akismet and defensio. I just don't trust them so I browse through the spam comments and often find normal comments that were filtered. And doing that with 100+ spam comments a day is a pain in the a**.
__________________
my pp-blog
Reply With Quote
  #2  
Old 01-24-2008, 09:04 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Open the and addons/_captcha/libraries/captcha.php file add:

Code:
$captcha_fontcolor = '';
$captcha_linecolor = '';
$captcha_bgcolor = '';
before:

Code:
$testbild = imagecreate(120, 30);
So the end result looks like:

Code:
$captcha_fontcolor = '';
$captcha_linecolor = '';
$captcha_bgcolor = '';

$testbild = imagecreate(120, 30);
Enjoy!
Reply With Quote
  #3  
Old 01-24-2008, 10:51 AM
joerg Offline
forum loafer
 
Join Date: Jan 2008
Posts: 5
Thanks for the quick reply but it's not about the testbild. It works.
I have enabled captcha on my blog now so you can test it. You can input any number you want, captcha won't complain...so it doesn't filter anything.
__________________
my pp-blog
Reply With Quote
  #4  
Old 01-24-2008, 10:54 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
I sent a comment, and i do not see it. are they moderated?
Reply With Quote
  #5  
Old 01-24-2008, 10:56 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
Captcha seems to work for me. I sent 3 test comments. two with a bogus captcha and one with the correct captcha. the correct captcha comment was posted, the others were not.
Reply With Quote
  #6  
Old 01-24-2008, 11:35 AM
joerg Offline
forum loafer
 
Join Date: Jan 2008
Posts: 5
The two wrong captchas and one more of your comments were caught by defensio...I don't think captcha has something to do with it, since it should block them completely, right?
__________________
my pp-blog
Reply With Quote
  #7  
Old 01-24-2008, 11:51 AM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
OK. I took a look at the code and you're right. It should block them completely.

Open addons/_captcha/front_captcha.php and replace all the code inside with the following:

PHP Code:
<?php
/**************************
SVN file version:
$Id: admin_editexif.php 57 2007-10-28 19:10:34Z schonhose $
**************************/

/*

Captcha version 1.0
Written for Pixelpost by Dennis Mooibroek, http://foto.schonhose.nl

License: http://www.gnu.org/copyleft/gpl.html

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, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

// Same info as non admin addons
$addon_name "CAPTCHA addon (frontpage functions)";
$addon_description "This file contains the frontpage functions for the CAPTCHA addon. This addon tries to prevent spam by using so called CAPTCHAS (graphical numbers in this case). Add the  &lt;CAPTCHA&gt; tag below the email-form-line in your image or comments template (depends where your comments-form is)";
$addon_version "1.0";

// The workspace stuff
add_front_functions("check_captcha""comment_passed""""");

function 
audit() {
        
//session_start();

        
if(!isset($_SESSION['digit']) || !is_numeric($_SESSION['digit'])) {
                return 
false;
        }

        
$digit $_SESSION['digit'];
           
//error_log("CAPTCHA session value" . $_SESSION['digit'] ,0);
        
$userinput $_POST['userinput'];
        
//error_log("CAPTCHA sent value" . $_POST['userinput'] , 0 );
        
session_destroy();

        if ((
$digit == $userinput) && ($digit 1) ) {
                return 
true;
        } else {
                return 
false;
        }
        die(
"woot");

}


function 
check_captcha(){
    
$wrong_captcha_title="wrong code entered";
    
$wrong_captcha_body="looks like you are a robot, if not please try again and enter the correct code<p /><a href=" $_SERVER['HTTP_REFERER'] . ">try again</a><p />";
     if(!
audit()) {
        echo 
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html><head>
            <meta http-equiv="refresh" content="8; URL=' 
$_SERVER['HTTP_REFERER'] . '" />
            <title>' 
$wrong_captcha_title '</title>
            <link rel="stylesheet" href="admin/admin_index.css" type="text/css" />
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            </head>
            <body> '
.
            
$wrong_captcha_body
            
.'
            </body></html>'
;
        exit;
    }
}
?>
Also, do as I said in post #2, http://www.pixelpost.org/forum/showp...44&postcount=2

Does this help?
Reply With Quote
  #8  
Old 01-24-2008, 12:43 PM
joerg Offline
forum loafer
 
Join Date: Jan 2008
Posts: 5
No, no change at all. I really get the impression that I am doing something fundamentally wrong here.
It _should_ be as easy as this, right?:

# Extract the zip and upload the folder _captcha to the addons folder. Do NOT change the name of the folder.
# Add the <CAPTCHA> tag below the email-form-line in your image or comments template (depends where your comments-form is)

Are you sure the function audit is really called? I haven't yet understood where the addon code is used.
__________________
my pp-blog
Reply With Quote
  #9  
Old 01-24-2008, 12:45 PM
Dkozikowski's Avatar
Dkozikowski+ Offline
Team Pixelpost
 
Join Date: Oct 2005
Posts: 1,855
Send a message via AIM to Dkozikowski
That should be all. Just make sure BOTH addon files are turned on.

And I don't know what is "wrong" with your blog but this addon works without error on my local blog.
Reply With Quote
  #10  
Old 01-24-2008, 01:40 PM
austriaka's Avatar
austriaka+ Offline
Team Pixelpost
 
Join Date: Nov 2006
Location: Germany
Posts: 1,175
Send a message via ICQ to austriaka Send a message via AIM to austriaka
1) the <CAPTCHA> Tag is not replaced in your page right now. This is usually a sign that you didn't turn on the Addon (or did you give it up?)

2) Perhaps I didn't understand you correct, but you should not use Defension AND Akismet together. Either the one or the other.

3) Try turn off Defensio and test the Captcha again. Could be that they won't work together.
__________________
Uh!log Photoblog
My Addons
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:16 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs