forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Joe Carver on July 15, 2009, 06:43:37 pm

Title: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on July 15, 2009, 06:43:37 pm
reCAPTCHA for Coppermine v2.6 - Stop gallery spam.

reCAPTCHA is a popular and powerful system to stop spam bots. Visitors must type two words before they can submit input like Comments or Registration. Large websites like Facebook, Twitter and AVG use reCAPTCHA.
It is a free service for personal and commercial use.

Abbas Ali (http://forum.coppermine-gallery.net/index.php?action=profile;u=11737) and B. Mossavari (http://forum.coppermine-gallery.net/index.php?action=profile;u=14716) deserve many thanks and credit here. Their good work on the Captcha Mod. (http://forum.coppermine-gallery.net/index.php/topic,29564.0.htm) and Plugin (http://forum.coppermine-gallery.net/index.php/topic,36319.0.html) is what this plugin is based on. SaWey (http://forum.coppermine-gallery.net/index.php?action=profile;u=40798) gets credit here for the installation code. Recaptcha in Coppermine is based on my mods. posted earlier this year.

        ====================================================

Ver 2.5 features

        ====================================================

   To install:

   1) Download  cpg1.4.x_plugin_recaptcha_v2.6.zip  to your computer

   2) Login go to plugin manager and uninstall Captcha 3.0 if you have it

   3) Use plugin manager to Browse - Upload - Install    cpg1.4.x_plugin_recaptcha_v2.5.zip

   4) Get your keys if you don't have the recaptcha keys yet click "Sign Up" to open a new window
   where you can sign up/register your domain. Your domain name is passed to recaptcha for easy
   signup. If you have the keys skip to 5)

   5) Copy and Paste your keys into the form (no extra spaces allowed) - press Go!

    Important note: If you have made a mistake entering your keys use Plugin manager to uninstall then reinstall with the correct keys.

   v2.6 is compatible with cpg version 1.4.26

        ====================================================

Customize For Users  - Style - Language by editing configuration file recaptcha_config.php.

Options for users include all standard Coppermine groups - Admin, Registered, Guests and groups you define.

Options to use reCAPTCHA on pages with user input: Comments, Registration, Ecards, Report and Login

        ====================================================

   To uninstall - Use Plugin Manager.   BUT if you can't log in*

   1) Use your ftp program to delete the file recaptcha_config.php. The plugin will now not run.

   2) Log in and use plugin manager to uninstall/delete the plugin (*note: recaptcha has never failed me)

        ====================================================


Examples of reCAPTCHA in Coppermine can be found on my two sites  Users Gallery (http://i-imagine.net/artists/index.php) | Personal Gallery (http://gallery.josephcarver.com/natural/)

Tested with Slider, Scroller, SEF URL's, LightBox Slideshow, Brainfeeder, Facebook and my Live Hyperlinks and Comment Edit Disable plugins. (Also EnlargeIt! can use this for Registration page)

Tested with Firefox, Chrome, IE8, Opera and Safari. Reports are kindly requested.

Translations for the language files are needed. The files are now 95% populated in English with all of the fields in place. Please post any translations to this thread for addition to a next release. Thanks in advance.

This plugin uses the reCAPTCHA api to load the visual challenge. It uses a public/private key pair for security. To see how it works click here: reCAPTCHA API (http://recaptcha.net/apidocs/captcha/client.html)

Contact Us Form that uses reCAPTCHA is in the package, see readme.txt or Reply #15 below to install.

Tested to function with cpg version 1.4.26


[Edit GauGau 2010-03-05]
This plugin has been added to the subversion repository: http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.4.x/plugins/

It has been updated as well to reflect the version checking routines in the plugin manager that are meant to make sure that galleries don't break because of plugins installed that aren't meant for that particular version of the gallery.

Download: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_recaptcha_v2.7.zip/download
[/Edit]
[/list]
Title: Re: reCAPTCHA - Spam protection for Comments, Registration, ecards, etc.
Post by: Joachim Müller on July 16, 2009, 07:48:29 am
Please reply to this thread with announcements for new releases instead of constantly overwriting the initial posting!
Title: Re: reCAPTCHA - Spam protection for Comments, Registration, ecards, etc.
Post by: Joe Carver on July 16, 2009, 11:50:51 am
This is a new release - apologies for the clutter!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: kyber on July 31, 2009, 05:49:49 pm
Many thanks for this plugin, works like a dream. I am fed up of having to delete fake account requests and this wil reduce such requests a lot.

I used captcha for a while but found that many users had problems recognising what they were being shown and often got the entry code wrong. This included me! I have used recaptcha on other sites but had not been able to make it work myself. I tried making changes to the coppermine code more than once, but just could not crack it.

I was a little confused at first as I thought it was not working. Did not understand that I needed to click the button before the recaptcha box was displayed (it does not work for me like this on my other sites) but I eventually "clicked" - I changed the description of the button to make it, for me, a little more clear. What it the rational for not displaying the recaptcha box without a click?

Stuart
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on July 31, 2009, 07:40:41 pm
You are very welcome. Thanks for the feedback too. If your site is available to post a link here it would be interesting to see what you have done.

As far as why is the hidden style being used, I made only short mention in the announcement so to expand a bit...


It could be changed by (extensive) editing to codebase.php. Be careful if you do so.

Good luck with the spam bots - I'm sure you will see a difference
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 04, 2009, 01:44:07 pm
New revision released.   v2.0   3  August, 2009.

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joachim Müller on August 04, 2009, 04:32:44 pm
@Joe:
Yes. There are no pre-requsistes for being listed on that page though - your plugin would have been added anyway. The plugins page just get's updated from time to time, that's why your plugin isn't there yet. It will be there as soon as we have performed the next update of the plugin page.

Good work on making all settings configurable.

One suggestion though: there is a naming scheme for plugins (http://documentation.coppermine-gallery.net/en/dev_plugins.htm#plugin_writing_naming_conventions_archives) available. Your current plugin file subsequently should be named cpg1.4.x_plugin_recaptcha_v2.0.zip

Cheers
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 04, 2009, 04:45:18 pm
Renamed, reinstalled and retested.

Thanks for the fast reply.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 16, 2009, 03:06:24 pm
Release of version 2.1   Bug fixes

Bugs fixed
Both were caused by reCAPTCHA restrictions of only one captcha per page.

New version attached to first post in thread. v2.1.

To upgrade existing installations (v2.0) of this plugin:
  1) Download and unzip the new version on your computer.
  2) Replace file /plugins/recaptcha/codebase.php with the newer version
Or
 1) Uninstall - Remove - Reinstall with the new version. You will need to re-enter your keys.

Users of v1.0 will also need to remove and reinstall v2.1 to upgrade.

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: knight01 on August 27, 2009, 06:36:10 pm
Not sure if I should ask François Keller or i-imagine about this.

Is it possible to add the contact form, cpg1.4.x_plugin_contact_v1.3, to the available pages recaptcha is displayed on? The contact form currently has standard captcha.


www.bestcostumecontest.com
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 27, 2009, 06:39:32 pm
You have now moved this one up higher on my to do list!
 To be honest I have not yet taken a look, but will and let you know.


[edit] I already have a form with reCAPTCHA that does the same thing, send an email to the admin. It could take a few days (if I'm lucky) to add it as a plugin with the time I have now. In the worst case I could release the form with reCAPTC?HA as a mod that could be added as a custom menu link At the moment it functions well enough, but format and code wise it is a mess...give me a bit of time. Otherwise I will take another look at the contact_v1.3 plugin.[/edit]

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (Ne
Post by: uvgoth on August 28, 2009, 03:18:36 pm
I have been having spam even through Captcha so have installed this reCaptcha plugin. I'm pleased there's one though as I wanted to use reCaptcha anyway!

Wanted to say thankyou.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on August 29, 2009, 11:10:03 am
Hello.

I have tried several times to get the plugin to work without success. I manage to install the plugin and to copy and paste public and private key. I do not get any error messages on screen and everything seems to work ok under installation.

Earlier I had CAPTCHA installed. Have uninstalled this plugin and even checked the database with phpmyadmin and cheked that this plugin has got correctly uninstalled. Everything seems ok. I have also tried to uninstall other plugins and only running with reCAPTCHA without success.

When a guest visited the gallery he / she does not get up the visual image with the letters he / she shall copy / write to post a comment. You don’t even get the field where the information should have been written. The comment part seems to be like standard CPG installation without any captcha software installed. If you try to post a comment you get the following error: “Sorry, captcha error. Please try again. Click Here to Go Back Or Use Your Back Button.”

Any help would be appreciated!

Bjørn Roger Rasmussen

Technical information:
- Version: Coppermine Photo Gallery 1.4.25 (stable)
- Web server: XAMPP for Windows 1.7.2 (Apache 2.2.12, MySQL 5.1.37, PHP 5.3.0).
- OS: Windows Vista
- Gallery: http://web.brr.no/cpg-galleri/
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 29, 2009, 01:00:15 pm
The immediate suspicion is that this is related to your other postings about having plugin installation issues.....

I have tried to replicate your settings on a test gallery (theme/lang/plugins/smileys/votes, etc) and don't see the problem.

It seems that 1/2 of the codebase.php action is working (checking the db input), the 1/2 that should "see" and replace the html expressions in displayimage.php are not.

Enable Registration, ecards and Report to Moderator - do you see the reCAPTCHA on those pages?

Did you remove captcha.php from the gallery root when you uninstalled Captcha 3.0? Did you try removing Captcha 3.0 completely? If you remove reCAPTCHA and reinstall Captcha 3.0 does it function OK? Is the structure of the reCAPTCHA folder the same as the original .zip? Is the file recaptcha_config.php the same as the original?




Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: knight01 on August 30, 2009, 06:11:01 am

[edit] I already have a form with reCAPTCHA that does the same thing, send an email to the admin. [/edit]



i-imagine I should email the admin here? I don't think I'm supposed to contact Mr. Müller per his profile. I don't think private messages are active here due to past spammers, but perhaps you could contact me through the contact form on my site to pass the file along to me.

www.BestCostumeContest.com

Thanks!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 31, 2009, 12:49:53 am
Add a Contact Form with reCAPTCHA (patch version 0.9)

This patch for the reCAPTCHA plugin gives you a form where your users can send you a message. It sends the message to your Administrator email address. The form uses the reCAPTCHA and settings you have installed with the plugin. This might be included in a future release of the plugin.

   ===================================

   To Install:
   
   1) Download, then unzip    recaptcha_contact_form_patch.zip on your computer

   2) Copy file echo.php to gallery folder   plugins/recaptcha
   
   3) Log in, go to Admin - Config - Themes settings and enter the following
   
         Custom menu link name =   Contact
         
         Custom menu link URL =    index.php?file=recaptcha/echo
         
   4) Save the new settings, you now have a menu link leading to the new Contact Form

   5) (Optional), add the menu link to your theme/template instead. Use the url as above

   ===================================

         Notes:
   
   - This version is rough around the edges. It is an early release. Don't expect too much.

   - Form was orginally made for narrow theme (600px).
   Change/edit the table and td sizes as you like to fit your theme.
   
   - Text entered into form is filtered before the mail is sent. This will change and remove links / http commands
   and some text formatting when you receive the mail.  
   
   For example:   <1> me       will be      &ampltl&ampgt me
   
   apostrophe's and stuff"s        will be      apostrophe&#39s and stuff&ampquots

   ===================================


You must be running the reCAPTCHA plugin to use this Contact form. It won't stir your martini, bake your bread or brew your coffee and beer, but will give you a "spam resistant" contact form. Feel free to edit and style to your wishes.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on August 31, 2009, 06:05:43 pm
The immediate suspicion is that this is related to your other postings about having plugin installation issues.....

I have tried to replicate your settings on a test gallery (theme/lang/plugins/smileys/votes, etc) and don't see the problem.

It seems that 1/2 of the codebase.php action is working (checking the db input), the 1/2 that should "see" and replace the html expressions in displayimage.php are not.

Enable Registration, ecards and Report to Moderator - do you see the reCAPTCHA on those pages?

Did you remove captcha.php from the gallery root when you uninstalled Captcha 3.0? Did you try removing Captcha 3.0 completely? If you remove reCAPTCHA and reinstall Captcha 3.0 does it function OK? Is the structure of the reCAPTCHA folder the same as the original .zip? Is the file recaptcha_config.php the same as the original?

Hello.

Tested the things you mentioned. I removed reCAPTCHA and installed, activated and tested Captcha 3.0. No problems found.

Uninstalled Captcha 3.0 completely including removing captcha.php from the gallery root.

Tried again to install reCAPTCHA v2.1. Did a new download of cpg1.4.x_plugin_recaptcha_v2.1.zip and checked the file structure. Did not manage to find any missing files or other errors. Installation ok, but the same problem as earlier that you do not get up the captcha choices as a guest when you try to publish a comment. But reCAPTCHA worked as expected when ecards and self registration was activated.

When I tested I had all other plugins deactivated. Normally I only have BrainFeeder plugin and LightBox installed / activated.

For me it is a little bit strange that reCAPTCHA worked with self registration and ecards, but not with comments....

Bjørn Roger Rasmussen
http://foto.brr.no/

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 31, 2009, 06:22:54 pm
Try it with the Classic theme. I see that you still have it installed. (but no comments just now)

The plugin will look for an html expression in displayimage.php and replace it with the reCAPTCHA html. If by chance your theme has a difference in the html expression it will not be replaced. This plugin looks for a slightly different expression than Captcha 3.0. Maybe that is why Captcha 3.0 works for you and this does not.

Any theme that is part of the standard Coppermine should also be OK for a test, I have tried all of them.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on August 31, 2009, 07:26:55 pm
Try it with the Classic theme. I see that you still have it installed. (but no comments just now)

Hello.

Tried with the classic theme, but I got the same problem.

At the moment I have e-cards enables. As you can see here - http://web.brr.no/cpg-galleri/ecard.php?album=1&pid=681&pos=1 - the reCAPTCHA works for e-cards.

Normal view, not possible to comment as you get captcha error and the reCAPTCHA does not show up: http://web.brr.no/cpg-galleri/displayimage.php?pos=-681

Strange! Maybe I have to give up comments in my gallery. With Captcha 3.0 or without anything I get all to much spam mail.

Bjørn Roger Rasmussen, Norway.

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 31, 2009, 07:42:18 pm
Have you made any language file changes?

And if you want to turn on Comments - at least for a while - I can also take a look at what your server sends for an output.


[edit] To be always sure when testing, use Firefox, Chrome, or make sure you clear cookies/cache in IE [/edit]
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 31, 2009, 09:09:59 pm
@ brr, Sorry to say, I am fresh out of suggestions and/or answers.

The output of displayimage.php looks exactly to be what the plugin should find and replace. It's obvious that this is specific to that page since the reCAPTCHA works with ecard and also with the db_input part of the plugin.

So unless you have made any changes that I cannot see from here - recaptcha_config.php Groups - to something in themes.inc.php or somewhere else, these are the variables that you have that I can't replicate.
- The page wrapper/background  - the server - Brainfeeder plugin (I might try/test from here)

If I come up with an answer it will be posted!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on August 31, 2009, 09:48:31 pm
Have you made any language file changes?

Checked. No changes done in the files in \plugins\recaptcha\lang\ - files or \lang\ catalogue. The main language for my gallery is Norwegian, but I have the same problems if I choose English. And as far as I have managed to understand the reCAPTCHA plugin will use English as language as it will not find any Norwegian language file(?).

And if you want to turn on Comments - at least for a while - I can also take a look at what your server sends for an output.

Comments activated, but reCAPTCHA is also activated. If you visit this album it should have been possible to post comments: http://web.brr.no/cpg-galleri/thumbnails.php?album=14
But the result you get is as mentioned: "Sorry, captcha error. Please try again Click Here to Go Back Or Use Your Back Button"

Tried to activate display_errors in php.ini (display_errors = On), but I did not get any errors at all.

access.log logs:

My IP - - [31/Aug/2009:21:44:54 +0200] "POST /cpg-galleri/db_input.php HTTP/1.1" 200 19840 "http://web.brr.no/cpg-galleri/displayimage.php?album=14&pos=1" "Mozilla/5.0 (Windows; U; Windows NT 6.0; nb-NO; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)"

[edit] To be always sure when testing, use Firefox, Chrome, or make sure you clear cookies/cache in IE [/edit]

Tested with Firefox, Internet Explorer 8 and Google Chrome.

Bjørn Roger Rasmussen
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on August 31, 2009, 10:12:36 pm
I did try it and made my last reply after doing so. The things I mentioned in my last post still could be looked at. Maybe you could try uninstalling Brainfeeder for a test, I looked at it but won't be installing it only for testing just yet (Brainfeeder).

Like I said in my last post - the output from your server looks exactly right - leaving me with no answer (yet).

       =============
[Edit] Have now installed Brainfeeder plugin (wow) and see no ill effect on reCAPTCHA. This leaves you with variables - server type and/or setup - cpg installation - page wrapper - etc. that I cannot easily replicate [/edit]
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on September 01, 2009, 07:39:25 pm

[Edit] Have now installed Brainfeeder plugin (wow) and see no ill effect on reCAPTCHA. This leaves you with variables - server type and/or setup - cpg installation - page wrapper - etc. that I cannot easily replicate [/edit]

I agree! It must have something to do with server type, setup or something like that. A mysterious problem!

Today I tried a clean and totally new installation of cpg 1.4.25 at another Windows computer. Windows 7 computer with XAMPP 1.7.2 (Apache 2.2.12, MySQL 5.1.37 and PHP 5.3.0). Standard XAMPP configuration and no other plugins installed in Coppermine. The same result. No reCAPTCHA when I tried to make a guest comment, but I got reCAPTCHA to work with e-cards.

At the moment I must live with comments off in Coppermine. Maybe everything will be solved when Coppermine 1.5.1 is released....

Thanks i-magine for all the suggestions and test you have done!

Bjørn Roger Rasmussen
http://web.brr.no/cpg-galleri/
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on September 01, 2009, 08:05:58 pm
Since you really seem to want to have comments and reCAPTCHA I will suggest something I would not normally advise. But the problem does seem to be an exception (I was actually expecting more issues even with just a few downloads so far).

So to give you "First Aid" for your specific problem see this post: reCAPTCHA Mod (http://forum.coppermine-gallery.net/index.php/topic,58757.msg293204.html#msg293204)

There is a text file attached. Copy the contents into your theme.php with your Public key. You will now have the reCAPTCHA on your comments/displayimage page. It will not affect the other aspects of the plugin. It will prevent the plugin from working on it's own within the comments because the html expression will be different. This is not a permanent or viable fix for the plugin itself.

If you do indeed find an actual solution for this problem, please reply - thanks. I will do the same, but am still out of ideas.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: brr on September 01, 2009, 09:53:47 pm
So to give you "First Aid" for your specific problem see this post: reCAPTCHA Mod (http://forum.coppermine-gallery.net/index.php/topic,58757.msg293204.html#msg293204)

Thanks! The "first aid" worked! Now I have comments activated in some albums with spam protection from the reCAPTCHA service!

Now I am a very satisfied "customer".

Bjørn Roger Rasmussen
http://foto.brr.no/
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: sharpo on September 02, 2009, 08:48:53 pm
I get "Sorry captcha error......" etc.

I've tried it on a test gallery which uses vertical film strip. As a last resort I set it to use the classic theme & it works, so the problem is within vertical film strip.

http://www.sharpos-world.co.uk/testing/cpg1424test/

Any ideas on what I need to modify to get it to work with vertical film strip please.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: Joe Carver on September 02, 2009, 08:57:46 pm
I have just tested and left a comment on a page with vertical filmstrip - it looks OK from here.

http://www.sharpos-world.co.uk/testing/cpg1424test/displayimage.php?pos=-1

If you are using Internet Explorer remember to clean your cache as you test.....
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login (New)
Post by: sharpo on September 02, 2009, 09:26:05 pm
I have just tested and left a comment on a page with vertical filmstrip - it looks OK from here.

http://www.sharpos-world.co.uk/testing/cpg1424test/displayimage.php?pos=-1

If you are using Internet Explorer remember to clean your cache as you test.....

Thanks, if all problems were solved that easily. I use Firefox and clearing the cache enabled me to add a comment.

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: Joe Carver on September 17, 2009, 12:53:24 pm
Google has now acquired reCAPTCHA. It was announced yesterday.

Thread announcement is located here:Official Google Blog (http://googleblog.blogspot.com/2009/09/teaching-computers-to-read-google.html)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: begl on September 20, 2009, 08:37:41 pm
I believe I may have found the solution regarding some of the comments about the 'strange behaviour' of the plugin with some things like eCards working, while comment protection doesn't work. I think the problem is caused by the regex.

The current code (codebase.php in recaptcha_main - line 145) is:
Code: [Select]
...
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') {
                $exper = '(/>*
                                .*<input type="submit" class="comment_button" name="submit" value="' . $lang_display_comments['OK'] . '" />)';
                if (preg_match($exper, $html)) {
                    $newcpch = <<<EOT
/>
<tr> <table  align="center" colspan="3" valign= "top"><tr>
...

I am no PHP expert, so I don't know how PHP handles whitespace / newline characters in variable assignments or whether or not the "preg_match" function is capable of a regex over multiple lines. However, I do know these problems have plagued other code I have seen.  So, I figured I'd drop the first part of the expression and only look for the "input" part of the expression.  That has resolved my problems. I don't know what other impact this may have for other themes (I use Rainy Day), but the fix works for me, so I figured I'd share. YMMV.

My update to "codebase.php":
Code: [Select]
...
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') {
                $exper = '(<input type="submit" class="comment_button" name="submit" value="' . $lang_display_comments['OK'] . '" />)';
                if (preg_match($exper, $html)) {
                    $newcpch = <<<EOT
<tr> <table  align="center" colspan="3" valign= "top"><tr>
...

Note the change to "$exper" - I have removed the closing tag, newline and wildcards.  Also, the closing tag is removed from "$newcpch".

I haven't made any other changes as my only concern was comments.  I haven't looked at any other parts of the code.

Hope this helps some people.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: Joe Carver on September 20, 2009, 10:41:02 pm
Can you post a link to your Coppermine? I am curious if your mod. works with multiple comments on the same page.....

The whitespace in that regular expression is intended.

As far as I know there has been only one other posting regarding real trouble with the reCAPTCHA (with more than 65 downloads) on the comments page. The user that posted with that issue also had trouble with captcha in cpg 1.5 and his troubles might have been caused by B.O.M. , lang. file and/or server issues.

It seems to work ok with an unmodified Rainy Day theme for me. It was tested with this version.
Code: [Select]
<!--
  SVN version info:
  Coppermine version: 1.4.25
  $Revision: 5997 $
  $LastChangedBy: gaugau $
  $Date: 2009-05-26 08:43:24 +0200 (Di, 26 Mai 2009) $
-->

Thanks in advance for your reply.

[edit]
try this - change
Code: [Select]
           if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') {
                $exper = '(/>*
                                .*<input type="submit" class="comment_button" name="submit" value="' . $lang_display_comments['OK'] . '" />)';

to
Code: [Select]
            if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') {
                $exper = '(/>.*
 .*<input type="submit" class="comment_button" name="submit" value="' . $lang_display_comments['OK'] . '" />)';

seems to work, perhaps to be in possible future release
[/edit]

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: begl on September 22, 2009, 08:24:24 am
My site is http://www.gzone.org/gallery/

My fix to codebase.php did not work well with multiple comments. I was able to post a new comment to an image with an existing comment and didn't test further. You will notice that I only have a single comment, so testing of multiple comments didn't cross my mind  ;).

I am not sure why the original codebase.php did not work as I am using the same (latest) version you used for test purposes.

I have now modified codebase.php with your suggested update and that works well for me.

BTW - Line 121 (recaptcha_header function) has a slight typo - an extra double quote.
Code: [Select]
$html = '<script type=""text/javascript"  ....
                       ^ Here

One other thought - would it make sense to move the 'common' text (like the various javascript functions) in to a single location which is then reference within your code - to make (future) updates to your plugin simpler?

Thanks for your assistance and thanks for putting the plugin together - I'm pleased not to be getting comment spam!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: Joe Carver on September 22, 2009, 04:12:24 pm
@ begl,

Thanks for your reply.

The reason for reCAPTCHA not working with that regular expression and multiple comments is that there is a limit of one reCAPTCHA per page. When you have a comment that can be edited that regular expression is repeated. The resulting two attempts at creating the reCAPTCHA then fail. I am hoping that there is a change in the way this works from reCAPTCHA.

I too am not sure why v2.1 didn't work for you and the other user who reported trouble with the Comments reCAPTCHA. The only theory is that it might be server/setup related.

Since both you and I have had success with the small change it will be incorporated into the next release (soon).

I was aware of the double quote typo. (thanks anyway) and had planned on fixing it in the next release. I had been holding back to make that minor fix until more user and trouble reports have been submitted.

Thanks for the suggestions and the reply.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: Joe Carver on September 25, 2009, 05:28:56 pm
Release of Version 2.2 

Plugins (http://coppermine-gallery.net/plugins.php) page. - thanks in advance)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: brr on September 27, 2009, 10:05:31 am
Hello!

Thanks for the new version! With this version I do not need anymore to "cheat" or use the "first aid" solution you helped me with for a while ago. The new version worked "out of the box" in my gallery.

I have not managed to get Norwegian translation to work. Tried with $recapt_lang = 'no'; and 'nb' in recaptcha_config.php and \lang\norwegian.php. In norwegian.php I translatet: $lang_plugin_captcha_submit_click =  'Klikk her, skriv de to ordene og klikk publiser kommentar'; // Comments and Registration  Did not work, got the English text. Maybe I have to read a litte bit more to understand how language files works.

Bjørn Roger Rasmussen
http://web.brr.no/cpg-galleri/



Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login - NEW!
Post by: Joachim Müller on September 27, 2009, 11:55:21 am
Thanks for the release.

Note to Moderators,  Please, if you can, add this to the Plugins (http://coppermine-gallery.net/plugins.php) page.
You don't have to explicitely ask for this - this is done anyway once in a while. Did so right now.

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on September 27, 2009, 02:49:00 pm
@ Joachim Müller,

Thanks for your time and reply.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on September 27, 2009, 04:16:45 pm
@ Brr,

Thanks for the information, it is good to hear the new revision works for you. Especially since I was not able to reproduce the same error.

For your language issues, there are two separate parts.

1) Variable $recapt_lang in recaptcha_config.php has only the limited set of 8 languages listed in the file. That language variable sets what the recaptcha will use - inside the recaptcha (Help, Get new, Audio). I hope that there will soon be more languages now that Google has acquired recaptcha.

2) The issue you are having with your custom language file is caused by a silly and stupid mistake by me. This will  of course need to be confirmed by further testing, but try this.

In codebase.php find:
Code: [Select]
include('plugins/recaptcha/recaptcha_config.php');
    global $lang_display_comments, $lang_register_php, $CAPTCHA_DISABLE, $key_public, $lang_ecard_php, $lang_report_php, $lang_login_php, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA;

Replace with:
Code: [Select]
   global $CONFIG, $lang_display_comments, $lang_register_php, $CAPTCHA_DISABLE, $key_public, $lang_ecard_php, $lang_report_php, $lang_login_php, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $lang_plugin_captcha;
    include('plugins/recaptcha/recaptcha_config.php');

 Apologies for this giving you so much trouble. (although I should ask you to test all of my work...)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on September 27, 2009, 06:34:48 pm
Release of Version 2.3

Changes made in this version

v2.3 now attached to first post in thread.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: brr on September 27, 2009, 10:40:15 pm
Hello i-imagine.

I can confirm that changing of language works great with reCAPTCHA Plugin ver 2.3. Thanks for fixing the bug!

Bjørn Roger Rasmussen - http://web.brr.no/cpg-galleri/
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on September 27, 2009, 11:09:05 pm
Thanks for the information.
I had tested the language change with the error messages only, leading to the false assumption that all was OK.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on September 29, 2009, 05:30:06 am
Release of Version 2.4

Changes made in this version

(  now > 98% bug free!   :)       )
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 04:45:26 am
Joe:
Thank you for this great plugin. The image is working on the contact page but is not displaying on the registration page or comments. I previously had CAPTCHA 3.0 installed which has since been uninstalled (not deleted) and the captcha.php file has been removed from root and not sure if this is causing the problem.

The site is the-nowaks <dot> com.

I've disabled 'admin requires approval' so I dont have to be involved with approval.

Thanks,
Steve
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 12:22:28 pm
You are welcome Steve.

It looks like you have made at least one edit to file recaptcha_config.php. The style
is now 'blackglass' on the Contact page (instead of the style 'white').

Note that the style does not relate to the plugin's functions nor will the admin approval setting.

I suggest uploading a clean copy of that file to test. If that works then be sure to use caution
when editing recaptcha_config.php before you upload a copy with your changes.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 02:50:43 pm
I had changed the style to blackglass assuming the color pattern would match my background but I figured it would not affect the functuality of the plugin.

I've uploaded an original copy of recaptcha_config.php back to the folder, cleared the cache and still no image in the registration page. Is a copy of any of the files within the recaptcha folder needed in the root like the captcha plugin had needed? I didnt see it in the instructions but figured I would ask.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 03:44:34 pm
Everything should be in the plugins/recaptcha folder.

From a quick test on my test gallery it looks like there is a .js conflict with
the Slider plugin that you have installed. (but have not enabled in your home page)

The way it interfered on my test gallery looks different than on yours, but I will suggest these things to try.

1) Uninstall Slider
2) Enable ecards for Guests - does it work there?
3) Uninstall, then reinstall recaptcha v2.4

I will try a few more tests as time will allow and reply back here.

If you do indeed want a moving thumb display on your home page you can try my plugin:
 Scroller - Based on iTunes - Slideshow for Main and Album List Pages (http://forum.coppermine-gallery.net/index.php/topic,61385.0.html)
it does not conflict with recaptcha.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 06:56:00 pm
The slider is there, it's at the bottom of the page but for testing, I've now uninstalled it. When you say to enable ecards for guests, is this another plugin or standard with CPG? Reason I ask is I dont see the setting to allow/disable. When I am logged in, the option to send an ecard is there but not logged in, it's gone so I'm assuming this option is turned off and not sure where to adjust it. I've also uninstalled and reinstalled recaptcha 2.4 and still dont have the image appear in the registration box.

Two other things that I've noticed is
A) If you attempt to comment on an image, it gives you an error for your name and words, but nowhere is there a spot for your name or words.
B) The only form I do see the image working on it on the contact form

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 06:57:52 pm
Something else that I should mention is that I needed to mod my themes.php page to allow FLV file types. Not sure if that may be causing a conflict or not.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 09:51:26 pm
Sorry about that, I didn't see the slider before posting....

      ++++++++++++++
Contact works differently than the other pages. Contact has the recaptcha .js built inside the form. The other pages get the recaptcha from the plugin. It uses a function similar to a "find and replace" to display the captcha. (find the submit button and replace it with the recaptcha submit).

The issue is in that function. You get a recaptcha error because the "check recaptcha" part of the plugin is working, but the "generate recaptcha" is not.
      ++++++++++++++
I have tried most everything I can think of so far from here. As far as the theme mod. for flv goes, I just don't know. However I have tried your site with a couple of themes including Classic. So unless you have applied the flv mod. to all of the themes it should not matter.

I also tried the Facebook plugin (v1.3) and that made no difference here.
      ++++++++++++++
Log in, go to Groups where you can enable Ecards, Comments and also Report for Guests. Each of those Coppermine pages should have a recaptcha for Guests in a default installation of this plugin. Please report back as to your result.
      ++++++++++++++
If you do get recaptcha on those pages then my assumption would be that there is something conflicting/wrong in register.php or possibly the lang. files (although I tried testing some of those too...)
      ++++++++++++++
There is one fix I might be able to have you try if any of the above does not work, but will need time to be made and pre-tested.

Good luck
p.s. Wow! You have a lot of themes.........

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 10:52:37 pm
Funny - I never checked the groups page before and have been using CPG for about 3 years! I just allowed guests to comment, send ecards and rate and bingo, the fields are now there for the ecard and comments. It's strange why its still not present for registration... below is a screenshot of what I am seeing for the registration page.

With the themes, I know, I need to get rid of most. When I originally installed CPG, I didnt know the themes could be viewed from the demo before I installed them. I happened to run across a theme pack and just installed them all, never going back to uninstall. The one that I have been using and is default for viewers is 2borno2b.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 10:55:25 pm
Screenshot attached. I did make a mod to the registration screen where fields 1, 2 and 5 are required. Could this be the problem?

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 11:07:59 pm
If you have made the field changes using admin tools, then I think it should not make a difference.
      ++++++++++++++
Since you have had success with the other recaptcha's then all might not be lost...
      ++++++++++++++
[edit] There is a file named codebase.txt attached to this post. file removed [/edit]
Download >> rename to codebase.php >> upload to /plugins/recaptcha/ folder. (replacing what you have now)
      ++++++++++++++

Please reply with your result - thanks
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 03, 2009, 11:23:08 pm
The change was not made in admin tools, it was made to the registry.php file. As found in this (http://forum.coppermine-gallery.net/index.php/topic,33757.0.html) thread.

I uploaded the file you sent after renaming the extension to PHP and now get a parse/syntax error:
Parse error: syntax error, unexpected $end in /home/stevenow/public_html/nowaks/cm/plugins/recaptcha/codebase.php on line 448
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 11:32:15 pm
Yes, I saw that error on your page. The file itself should be OK since I tried repeating my instructions with the same file and it worked OK. Make sure that you only rename it (don't open and 'save as') because you have to preserve the format of UTF 8 w/o BOM (byte order mark). If the BOM gets added strange things will happen.

You have now answered the original issue's cause. I am sure if you upload a clean copy of register.php then recaptcha v2.4 will work fine for you.

Maybe if you double check the BOM and editing of your modded file (reg) then maybe you can get it to work with v2.4 (or with the 'patch' I posted for you)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 03, 2009, 11:55:30 pm
I have now tried the mod. to register.php from the post you referenced above:
Making registration fields mandatory (http://forum.coppermine-gallery.net/index.php/topic,33757.0.html)
The mod. in the first post from that thread was applied.


ReCAPTCHA v2.4 and the mod. worked just fine.  " it's mandatry to fill in your xxxx"

Recheck your edits to register.php.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 04, 2009, 12:17:46 am
Should I replace codebase.php with the original or keep the one that you had provided? Order was preserved as I edit everything using Dreamweaver. With the codebase file, I simply saved as codebase.php instead of *.txt and the uploaded without opening it. Let me upload an original copy of register.php and see if it makes a difference.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 04, 2009, 12:25:28 am
For some reason, I didnt make a backup of the original register.php file so instead, I 'borrowed' an unmodded copy from a different site that I have CPG on, uploaded to this one and nothing. I then replaced the original codebase with the one you provided and again get the syntax/parse error.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 04, 2009, 12:34:54 am
One more thing that crossed my mind. You mentioned in a prior post that the .js file for slider was causing a conflict. I have two other .js files in my gallery root (scripts.js and swfobject.js). Could those have any conflict? One is related to allow the playing of .FLV files.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 04, 2009, 12:57:21 am
"When in doubt start from scratch"

Get clean copies of what might be "bad" from downloads at the top of the page. CPG 1.4.25 files are what this has been tested with. Get a clean version of the plugin too.

Since the .js is loaded on all of your pages (I assume) and the recaptcha works well for you on all pages except for register.php then the fault is most likely still with register.php. Scripts.js is part of Coppermine's core, the plugin is compatible. I am not sure about swfobject.js, but don't see it in the source of your pages.

I know nothing about Dreamweaver - currently I use Notepad++ where you can see and set BOM.

I don't know which is the mod. regarding FLV files you have not posted a reference. However I doubt it should make a difference on the reg. page only.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: troz on October 04, 2009, 01:21:48 am
That was my final thought. 1.4.25 is also the version that I am running. The swfobject.js references the FLV player and should only be needed when someone attempts to play a Flash video so I agree, there shouldnt be an effect with the register page.

I will work on updating new pages tonight and post the results this evening.

Thanks a million for your assistance Joe!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 05, 2009, 01:29:41 pm
Release of Version 2.5

Changes made in this version

Version 2.5 now attached to first post.

Users of v2.4 can replace codebase.php to upgrade.
Versions older than 2.4 need to replace codebase.php and recaptcha_config.php.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: aftab1003 on October 17, 2009, 10:40:39 am
i recently upgrade my gallery to 1.4.25

download the recaptch, try to upload via plugin manager, but nothing uploaded and nothing appear in plugin manager. but only sample plugin.
then i try to add unzipped via ftp on server, then it appears in plugin manager, and click on install. i add the both keys, and press GO.
every thing disappear from pluginmgr.php with out any errors. there is no effect on my gallery.

then i try to install sample plugin with user name and password, it also disappear.

plugin is still on plugin folder, but not in plugin manager.

is there any problem with my gallery, or i am doing something wrong.?
any clue?


thanks in advance.
here is my gallery link
http://picturerating.us/picture-gallery/index.php (adult content warning)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: aftab1003 on October 17, 2009, 10:48:10 am
i extremly sorry, my plugin controle was disable in my config. now all is working fine.


thanks for nice plugin.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: wanglese on October 31, 2009, 04:20:57 am
Thank you so much for this plugin.

I was looking around for solutions specifically for CPG, and this was so easy to install and setup.
5 minutes, and it's working as advertised.

Having looked at the solution, I now realise I can use reCAPTCHA in other settings.

http://illawarraastronomicalsociety.hostoi.com/photogallery.php
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: wanglese on October 31, 2009, 04:22:50 am
Thank you so much for this plugin.

I was looking around for solutions specifically for CPG, and this was so easy to install and setup.
5 minutes, and it's working as advertised.

Having looked at the solution, I now realise I can use reCAPTCHA in other settings.

http://illawarraastronomicalsociety.hostoi.com/Photogallery.php


fixed the link :-)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: foxbat on October 31, 2009, 01:01:43 pm
Hi Joe,

I installed the plugin but can't seem to get it to work on the comments page. The plugin modifies the html to give the "Click here - type the words - click submit" button and the click/hide options do something but the Captcha box never actually appears. Tried it with IE8 and Firefox with the same results and there are no errors in the Firefox errors console. Any ideas? (the website is http://www.stuartbrown.me.uk).

Regards,
- Andy
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on October 31, 2009, 01:09:57 pm
Double check your keys - uninstall the plugin and then reinstall with cut and paste (rather than typing) of your keys.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: foxbat on October 31, 2009, 02:01:32 pm
Double check your keys - uninstall the plugin and then reinstall with cut and paste (rather than typing) of your keys.
Hi Joe,

Yes that was it, thanks for the very fast reply. There was a trailing _ at the end of the public key that I managed to miss! It's all good now.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joachim Müller on November 01, 2009, 11:43:28 pm
fixed the link :-)
Actually, the link is http://www.illawarraastronomicalsociety.hostoi.com/Coppermine/index.php
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: wanglese on November 02, 2009, 10:00:09 pm
sigh. Thanks. I wonder how I got it wrong TWICE ??? ??? ??? ??? ??? ;D
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: CFR on November 13, 2009, 10:52:59 pm
Hi!

I have this same problem which had @brr, and i cant make this "first aid" because in my theme simplement i dont have "problematic" code to change.
I use: Coppermine Photo Gallery 1.4.25, Mesh theme and last version "recaptcha".

... any ideas please?

Tomek
tomushi.com
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on November 13, 2009, 11:21:26 pm
If your site is indeed http://tomushi.com/gallery/index.php then it looks like the plugin is not installed.

Please install it (or list a link to the gallery where you installed recaptcha) and reply.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: CFR on November 14, 2009, 08:43:20 am
Sorry for this, i was clean all and was little late. Morning give me now more energy :)
Ok, reCaptcha is installed and ... :/ really i dont know where is the problem :( Maybe some plugin make the problem? I have installed:
- CPG MiniCMS v1.6,
- Stats v1.1.1,
- Online Today v1.0,
- Onlinestats v1.8,
- CPG-HttpBL Plugin v0.1,
- Light Box v1.1,
- CPG-BadBehavior Plugin v0.4,
- File replacer v1.0,
- Filetypes editor v1.02,
- Keyboard Navigation v1.1,
- Keywords_add v1.1,
- Facebook Plugin v1.0,
- Thumb Rotate v0.4,

Thx for attention :)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on November 14, 2009, 01:29:24 pm
Wow! You have a lot of plugins installed. I think there is a plugin conflict somewhere because it does not work for comments using the Classic theme.
http://tomushi.com/gallery/index.php?theme=classic

It looks to be working for Registration - so the trouble might be with a visual plugin.

I have myself tried many plugins with the recaptcha and have even now tested the keyboard nav. plugin with no effect on comments recaptcha.

You can try turning on/off a few of your plugins to test. Here I will try a few more tests, but do have limitations of time and what I want to load my test gallery with.

[Edit]
Try this - in Plugin Manager use the up/down to move reCAPTCHA above Keyboard Navigation v1.1.

It works/fails on my test gallery depending on the position on the Installed Plugins List relative to Keyboard Navigation plugin.
[/Edit]

Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: CFR on November 14, 2009, 02:35:02 pm
This is strange ... i deinstalled all plugins and it works. One by one all install all and few more and ... still work. Maybe some plugin must be installed after not before :/ Which one, hard to say.
I have one more think, when i write the proposed text i dont see what i write - background and letters have this same color. It is possible to change this?


Thanks a lot for help :)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on November 14, 2009, 03:32:57 pm
If you see the edit in my previous post...the order/sequence of the Keyboard Nav. plugin makes the difference. Both plugins change the html output in displayimage.php.

For the color of the text inside the recaptcha you will have to make a change to your style.css. I suggest looking at/changing the value for body text to #ffffff or similar. This is another issue that I cannot speak from experience on, however your theme does seem to treat the recaptcha differently than a "standard" Coppermine theme. (example: Eyeball, another black theme)

[off topic] Since you look to be a "security and spam conscious webmaster" you should see the statement about  Thumb Rotate (http://forum.coppermine-gallery.net/index.php/topic,57469.html) (a interesting plugin!) [/off topic]

You are welcome.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: CFR on November 14, 2009, 03:42:27 pm
WOW! Thumb Rotate is turned off, THX again for all Your attention and suggestions :)


PZDR (regards)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: cimona on December 02, 2009, 10:14:07 pm
Hi, I installed reCAPTCHA yesterday and it seamed to work great, but today when I tried to log back in to my website I noticed that my login page form got messed up after the plugin installation.
I am using a cutom theme, modification of oranje and I would really like this plugin installed.
My website:

http://www.simonamar.com/gallery/index.php

If you have any idea of what happend please let me know and thank you for the plugin.


 
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on December 02, 2009, 10:58:03 pm
I noticed that my login page form got messed up after the plugin installation.

I am not very sure what exactly you mean, but to take a guess the "white page" background is what you don't like. It looks like your Contact page shows the same way.

There are a couple/few things you can look at.

1) The .css on the page showed a lot of errors in the Firefox error console. Fix as many as you can to start with.

2) The recaptcha is in a td with your .css of "graybox2" that has a table inside with the .css class of "maintable2". Look at those values too.

You also could use the much recommended Firebug tool to look at the page's.css in detail.
Normally the tables and tds have no changes when the recaptcha is added to Coppermine.  (At least with the standard themes I have tested with)

If the 1 and 2 steps don't help or if you are asking about the menu location then:
edit the file -> plugins/recaptcha/codebase.php [back it up first!]

Find around line 323:
Code: [Select]
      </tr></table>
EOT;
Replace with:
Code: [Select]
EOT;
Save with no extra spaces or changes to the file.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: cimona on December 03, 2009, 01:45:43 am

Find around line 323:
Code: [Select]
      </tr></table>
EOT;
Replace with:
Code: [Select]
EOT;
Hi Joe, that fixed my problem, thank you very much!
I am using internet explorer and my page looked great.. but after I opened it in firefox as you suggested I got a shock .. looks all bad and like you said lots of errors in css.
I only worked a bit on this theme and my css is very messy.
Thank you again for the plugin and everything.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joachim Müller on December 06, 2009, 08:49:01 pm
This reduces the number of validation errors from 501 to 498 on your page. Like I said in your other thread: make your theme validate in terms of HTML and CSS and you'll be good in nearly every aspect.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: jobbie007 on January 22, 2010, 08:34:28 am
I need a bit of help. I am trying to install the magnificent reCapture plugin to stop the hundreds of spam login requests I am getting and I have hit a brick wall. I think my SQL entries are screwed but not sure. This is the debug error I get:

Quote
While executing query "INSERT INTO cpg_config VALUES('new_recaptcha_pubkey', '[key removed]'), ('new_recaptcha_privkey', '[key removed] ')" on 0

mySQL error: Duplicate entry 'new_recaptcha_pubkey' for key 1

Anyone any ideas? Can some one walk me through fixing it?

Cheers,

Martin.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joachim Müller on January 22, 2010, 08:51:26 am
Make sure that the table column that the error message complains about is set to auto-increment, using a tool like phpMyAdmin to look at the database directly.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: jobbie007 on January 22, 2010, 09:20:02 am
Thanks for the pointer. Went into the SQL database table and the keys had been peft in from a previous install.

Removed them, clicked "i" on the "not installed plugin list", entered the keys again......

Now the plugin has disappeared!..not in the "installed list"......not in the "not installed list". A further look in the plugin table in the SQL and it is in there but not listed and not apparently working?

Any more thoughts?

Cheers,

Martin.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joachim Müller on January 22, 2010, 09:30:36 am
Don't look at the plugins table, but at the config table. Make sure that there is no leftover duplicate key there.

@Joe Carver: your pligin should not use "INSERT INTO", but "INSERT INTO IGNORE" to avoid such duplicate error messages.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on January 22, 2010, 01:52:52 pm
@ Martin, Please in the future post a link to your Coppermine when asking for support.

@ Anyone, Always use Plugin manager as your first method of removing any plugins.

@ Joachim, The perils of copy and paste (from a similar plugin) have caught up with me. I had just been trying to count how many 100's of downloads without support requests for this plugin.......so again I have taken your suggestions. Newer version is now attached.

     +++++

Release of version 2.6

Changelog
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: jobbie007 on January 22, 2010, 05:34:47 pm
Apologies for not linking to Coppermine: http://www.team-richmond.com/coppermine/login.php (http://www.team-richmond.com/coppermine/login.php)

Deleted the keys in the config table. deleted the files in the plugins directory. Browsed and uploaded from the zip file. Disappeared. Not even a option to put in the keys this time.

Hmmm any thoughts?

Many thanks,

Martin.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on January 22, 2010, 06:00:20 pm
1) Have you disabled plugins?  (Admin >> Config >> Enable plugins (set Yes))

2) Are you using the newer version 2.6?

3) Do you see the plugin as not installed after you upload the .zip?
        - is the plugin directory writeable (and also is it still there?)
        - can you install any other plugins? Perhaps even the Sample?


I have now just uninstalled and reinstalled v2.6 a couple of times on my cpg1.4.25 test gallery with no problems. At the moment I am stuck for a quick answer for you.

You should see the form to enter the keys as soon as you click "i" to install. (even if you already have the keys)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: jobbie007 on January 23, 2010, 04:48:00 pm
Problem solved. It was a combination of lack of write permissions and not enabling plugins in the config file. Sorry for being a newbie and missing the obvious!

Works like a charm now!

Many thanks to everyone for their help!

Martin.  :)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: ady1503 on February 09, 2010, 11:10:33 pm
Hello I am ady1503. Here Moldavian; Romanian translation.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: ady1503 on February 09, 2010, 11:12:19 pm
If a problem please inform me what should be changed.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on February 09, 2010, 11:46:47 pm
Thank you.
I am not sure when there will be a next release, but I will include your translation in the package.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: aj21 on March 13, 2010, 11:40:15 pm
In installed the reCaptcha app, but now my page is all skewed and the login button the right hand side (which is supposed to be under the name and password field) isn't linking.

What do I do?
www.allhabs.net/gallery

Thanks!
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on March 14, 2010, 01:30:07 am
It could be your custom theme - I had tested this only with the standard Coppermine themes.

You could try it with the classic theme (..../login.php?theme=classic) for function. But since you might have also edited login.php I am not sure if that will work completely. Try an unedited copy of login.php to be sure.

For appearances to fit into your custom theme you could edit plugins/recaptcha/codebase.php. (back it up first)

The section around lines 298-299 and 319-323 is where the html output for login is created.

Code: [Select]
<tr><td class="tableb_compact" align ="center" colspan="3">
<div></div>
JAVASCRIPT - JAVASCRIPT - JAVASCRIPT
  <form method="post" action="">
  <input type="button" class="comment_button"  value="$lang_plugin_captcha_login_click" {$lang_login_php['login']}" onclick="showRecaptcha('dynamic_recaptcha_1', 'submit_button_1',   'red');"></input>
  <div id="dynamic_recaptcha_1"></div> <input name="submitted"  style="visibility: hidden"  type="submit" class="button" value="{$lang_login_php['login']}" tabindex="4" id="submit_button_1" /></input>  <div></div>       <input type="button" class="comment_button" value="$lang_plugin_captcha_hide"  onclick="destroyRecaptchaWidget();"></input>
</form>
       </td>
       </tr></table>
EOT;

Edit (with caution) as you see fit. See this link. http://www.i-imagine.net/artists/login.php
 (http://www.i-imagine.net/artists/login.php) for an example of how it would look unedited. (although it was made differently)



Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joachim Müller on March 14, 2010, 01:22:16 pm
http://www.allhabs.net/gallery?theme=classic looks customized to me as well. Provide a non-admin test user account if you want supporters to look into login issues.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Criss on April 29, 2010, 08:49:08 pm
Hello,

I have installed your plugin but when I click on the 'Click here..' button, nothing happens. Any idea why? :(

http://joejonasphotos.org/register.php
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Phill Luckhurst on April 29, 2010, 08:52:05 pm
Start by upgrading CPG and Stramm to the latest release.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on April 29, 2010, 10:13:29 pm
It looks like the Public key is not correct for the site or the form.

Uninstall, then reinstall the plugin with the Public/Private keys for the domains in their respective fields. You can always log in to recaptcha to confirm the keys or get new ones if you think you might have the wrong ones.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Criss on April 29, 2010, 10:19:15 pm
I did that. Both keys are correct, registration recaptcha works fine with the classic theme  :(
http://joejonasphotos.org/index.php?theme=classic
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on April 29, 2010, 10:28:16 pm
I have now just confirmed your observation.

The token {META} is probably missing from the <head> of template.html in your custom theme. There should be a call to load the remote .js in the <head>. It is missing, along with the other Coppermine <head> meta fields.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Phill Luckhurst on April 29, 2010, 10:31:12 pm
Yep, loads of stuff is missing from the head of your theme. You need the following

Code: [Select]
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script></head>
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Criss on April 29, 2010, 10:36:03 pm
Thank you Joe and Phill :) Now everything works fine :)
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: edlentz on June 13, 2010, 04:05:24 pm
I have CP1.4.27 installed will this plugin work on my install?  the readme says it works with 1.4.25.  My site is http://www.angelkittygang.com/coppermine/login.php  Will this plugin stop bots from sending registration requests?

Thanks
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on June 13, 2010, 11:50:24 pm
It should work just fine with 1.4.27.

For your second question....
reCAPTCHA is a popular and powerful system to stop spam bots.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: edlentz on June 14, 2010, 03:23:20 am
Thanks Joe!  I am installing it now.
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: edlentz on June 14, 2010, 05:05:28 am
It appears to be working and for registrations, just as I needed, right out of the box!

Thanks
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: heavensportal on July 07, 2010, 12:49:00 am
I have reinstalled this due to upgrade to 14.27 and it works I just want to verify that I did this part right:

to not show the recaptcha for admins and registered users I edited the section you stated by removing Guests and writing in Administrators,Registered

did I do that right?

this way the only ones to see the required recaptcha are guests wishing to register...right?

http://pfdlives.com/forum/cpg14x/index.php
Title: Re: reCAPTCHA - Anti Spam - Comments, Registration, ecards, Report and Login
Post by: Joe Carver on July 07, 2010, 01:23:52 am
The instruction in recaptcha_config.php says it all......

Set which USER group should NOT see Captcha on each page

it looks like you have enabled it for login and also your theme might be interfering with the display.