Zen Cart Logo
Forums / All Other Contributions/Addons / Support Thread for Google reCAPTCHA plugin

Support Thread for Google reCAPTCHA plugin

Views: 176,310

Results 101 to 120 of 694
22 Oct 2013, 13:38
#101
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Support Thread for Google reCAPTCHA plugin

Jeez, I figured it out- there's a mod I stopped using and didn't fully remove, Extra Fields On Customer Sign-Up. What I forgot were changes in includes/templates/create_account.php. :oops:

Re-uploaded the original file and Recap works! Sorry for the hassle and thanks for your time.

27 Oct 2013, 18:40
#102
bergernovelties avatar

bergernovelties

New Zenner

Join Date:
Apr 2008
Location:
Lindenwood, Illinois
Posts:
27
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Does not work when used with EXTRA FIELD IN CUSTOMER ACCOUNT.
I'm using 1.5.1 and a fresh install with only this one added mod. Since I added the reCAPTCH I now get a BLANK PAGE on the create account. www (dot) bergernovelties-awards (dot) com

27 Oct 2013, 21:19
#103
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

I guess it is because the EXTRA FIELD IN CUSTOMER ACCOUNT mod appears not to have been updated for 1.5.1. That mod replaces the create account module with it's own version.
I can see two ways to go.

  1. Because the extra field mod is using a 1.5 version of the create account module (/includes/modules/YOUR_TEMPLATE/create_account.php), you could try using the 1.5 instructions for my reCAPTCHA mod. or
  2. Use the 1.5.1 version of the file and incorporate the changes necessary for the extra fields mod into it..

I think option 1 is probably easier.
Regards

27 Oct 2013, 22:47
#104
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

David Allen:

I guess it is because the EXTRA FIELD IN CUSTOMER ACCOUNT mod appears not to have been updated for 1.5.1. That mod replaces the create account module with it's own version.
I can see two ways to go.

  1. Because the extra field mod is using a 1.5 version of the create account module (/includes/modules/YOUR_TEMPLATE/create_account.php), you could try using the 1.5 instructions for my reCAPTCHA mod. or
  2. Use the 1.5.1 version of the file and incorporate the changes necessary for the extra fields mod into it..

I think option 1 is probably easier.
Regards

Yes would be easier, but I would recommend doing it right. It's unfortunate that the other mod is not properly documented/updated for 1.5.1, but if not mistaken that means that a notifier is not incorporated which could have an effect on incorporation of future mods if it is assumed that all of the code is really up to 1.5.1.

Bergernovelties, I am not sure what the EXTRA FIELD IN CUSTOMER ACCOUNT mod is, but would recommend that the author of it be notified or a summary of what David posted be added to the applicable forum for that mod.

Ideally when incorporating a new mod even to a fresh install, a comparison should be made between the existing and the new mod to ensure that only those changes intended will be made and that the changes make sense. Each mod author tries their best to document and prevent things like whatu have experienced; however, mistakes happen or sometimes the code (and documentation) gets published in a hurry before a comprehensive review.

It's good that David stepped up to address the conflict of another mod with this one, and the instructions written still support the older ZC so it is much easier to follow the instructions for incorporating reCaptcha under the current coding, but I recommend restoring your create_account file and incorporating the other mod into it. (My luck, both methods will give the same final file. :) )

17 Nov 2013, 16:27
#105
eric47905 avatar

eric47905

New Zenner

Join Date:
Sep 2009
Posts:
24
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

First, Thank you for the reCaptcha mod. Great, and much needed item to have.

This is going to be a question that I didn't know where to ask since it is a crossover between your mod and the template.
I am setting up a new site based off the Sheffield Blue template. When I install the recaptcha, it works perfect where it should. But in Sheffield Blue there is a file called mega menu that controls the top nav bar. In this bar is a contact us dropdown. Once recaptcha is installed and you try to use this form it errors and goes to the wrong recaptcha entered. So I added the code you include in the readme to the mega menu. Now the recaptcha shows in the dropdown and works correctly there.

However, when I pasted the code into the dropdown, it removes the recaptcha from the main contact form. The only way to get it to show back up was to remove that code you say to add in where you want it to appear, and drop the recaptcha from the dropdown all together. I removed the contact us dropdown due to this issue but I do like it, and would like to use it.

The only thing I can think of is that the Sheffield blue uses the core zen cart contact us files for the form functionality, just not the layout for the dropdown. Maybe when I paste the new code in it sees it as a conflict somehow?

I would paste a link to show you, but unfortunately I disabled the dropdown for now due to the error because I have a lot to finish on the site before it goes live so I cant leave it not functioning. So you would not be able to see the error I am speaking of.

Thanks for your help.

18 Nov 2013, 12:22
#106
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

Hi eric
I think the problem comes with having the two reCAPTCHAs on the same page.
Could you try re-naming the form in mega-menu, so in tpl_mega_menu.php at line 238, change

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

to

<?php echo zen_draw_form('another_contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

Then try with the ```

<?php echo recaptcha_get_html($publickey, $resp->error, $request_type == 'SSL'); ?>

I haven't tried it so let me know how you get on, and good luck with the rest of the site :)

Regards
18 Nov 2013, 13:29
#107
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

David Allen:

Hi eric
I think the problem comes with having the two reCAPTCHAs on the same page.
Could you try re-naming the form in mega-menu, so in tpl_mega_menu.php at line 238, change

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>
> to
> ```
<?php echo zen_draw_form('another_contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

Then try with the ```

<?php echo recaptcha_get_html($publickey, $resp->error, $request_type == 'SSL'); ?>
> 
> I haven't tried it so let me know how you get on, and good luck with the rest of the site :)
> 
> Regards

Here's my thought on it, based on David's response and thinking about this through the weekend:

The process for reCaptcha I think is basically this: Assign an error checking value so that it defaults to an error, load/show the reCaptcha, enter the data, submit, and reset the error check if all of the data was entered and is correct. So, when the menu loads, the contact_us error checking is initiated (again, if not quite right, I think the process I am describing will work itself out) resetting any value that identified a satisfactory entry. As for being on the contact us page, there probably is something associated with what David is describing above; however, there may be some other affects of changing the form action...

Based on the report of the OP, that removing the contact_us from the menu bar allows the reCaptcha to be seen on the contact_us page, and the fact that after submission of the reCaptcha from the menu_bar that it appears that the user entered the wrong reCaptcha information, my recommendation would be in the tpl_mega_menu (or wherever the contact_us section is loaded by the template/menu system) to compare the current page's main_page value to either the contact_us page or (and I forget if a successful result goes to another page) the successful contact_us page and if the main_page equals either of those, to not display the contact_us section in the menu... 

Make sense?  Afterall, if on the contact_us page, why have a second contact_us option that mimics the current page?
25 Nov 2013, 14:20
#108
discoverytdi avatar

discoverytdi

Totally Zenned

Join Date:
May 2011
Location:
Sunny Rossendale (not)
Posts:
562
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

David Allen:

Hi eric
I think the problem comes with having the two reCAPTCHAs on the same page.
Could you try re-naming the form in mega-menu, so in tpl_mega_menu.php at line 238, change

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>
> to
> ```
<?php echo zen_draw_form('another_contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

Then try with the ```

<?php echo recaptcha_get_html($publickey, $resp->error, $request_type == 'SSL'); ?>
> 
> I haven't tried it so let me know how you get on, and good luck with the rest of the site :)
> 
> Regards
Just implemented this fix will report back in a few days with my findings.
28 Nov 2013, 01:18
#109
violetlinnie avatar

violetlinnie

New Zenner

Join Date:
Aug 2012
Posts:
30
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hello, very basic question here. After changing the files etc, it says to upload them but which directory do I upload the includes folder? lol this just isn't obvious to me. Thanks

28 Nov 2013, 01:23
#110
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

violetlinnie:

Hello, very basic question here. After changing the files etc, it says to upload them but which directory do I upload the includes folder? lol this just isn't obvious to me. Thanks

Crash course: if it's just an includes folder typically the folder is uploaded to your store's directory. (There are a few excetions to that statement). Or you may see direction like, upload the contents of the includes folder into your stores includees folder. Important thing is that your store should NOT have a structure like store/includes/includes

28 Nov 2013, 02:03
#111
violetlinnie avatar

violetlinnie

New Zenner

Join Date:
Aug 2012
Posts:
30
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Thanks, sounds obvious now you said it but better to find out for sure. I'm getting more spam into my store even as we speak.

28 Nov 2013, 02:45
#112
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

violetlinnie:

Thanks, sounds obvious now you said it but better to find out for sure. I'm getting more spam into my store even as we speak.

Well, quick fix. If it's coming from your contact us page, I recommend immediately installing google recaptcha (though there is some initial setup needed (some sort of key info from google.)). Don't know how your site is fairing otherwise, but may want to disable it. I was looking for a way to just turn off the contact us, I guess could temporarily rename both your template and the default contact us tplate file. Will cause some errors when one tries.

28 Nov 2013, 02:46
#113
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

mc12345678:

Well, quick fix. If it's coming from your contact us page, I recommend immediately installing google recaptcha (though there is some initial setup needed (some sort of key info from google.)). Don't know how your site is fairing otherwise, but may want to disable it. I was looking for a way to just turn off the contact us, I guess could temporarily rename both your template and the default contact us tplate file. Will cause some errors when one tries.

And sorry, should have done this before, this should be moved to a new thread instead of remaining here. Unless you are having trouble installing google recaptcha.

28 Nov 2013, 02:53
#114
violetlinnie avatar

violetlinnie

New Zenner

Join Date:
Aug 2012
Posts:
30
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Thanks all, after testing, the recaptcha is working on my contact page so that wasn't too bad setting that up, phew.

20 Dec 2013, 16:50
#115
carmelo avatar

carmelo

New Zenner

Join Date:
Dec 2013
Location:
Switzerland
Posts:
1
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hi David,
i'm use zencart 1.3.7.1 and i have add your plugin. Work all on viewing BUT if i insert one wrong captcha or nothing, the mail will send well without error or advices. I verify many time all the file and is all right but don't go. My website is https://www.my-rc.ch. I'm follow too the other post but any solution.
Thanks
Carmelo

08 Jan 2014, 18:44
#116
skullman avatar

skullman

New Zenner

Join Date:
Nov 2012
Posts:
33
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Where I enter the captcha, the back ground is black, and the letters are black. Any hint on how to change that? Thanks/
Also the google picture is cut off. You can view it here:
http://www.haymanchopper.com/index.php?main_page=contact_us

16 Jan 2014, 20:54
#117
coins2012 avatar

coins2012

New Zenner

Join Date:
Jan 2012
Posts:
89
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Could you please be more specific as to which files needs to be changed, I could add the code etc but would appreciate if you could tell me exactly which files need to be changed and their location, my website is https://www.aydincoins.com and lately been getting lot of spam emails via the ask question about this product feature.

thank you

David Allen:

I've not used the ask a question mod, but I've just d/loaded it and had a quick look.

I think that in the header.php you need to add in code in a similar way to the contact-us header.php (as per step 3 in the reCAPATCHA instructions, inserted at about line 42 in the ask a question header file)
So

    // add in reCaptcha check
    $resp = recaptcha_check_answer ($privatekey,
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);

    if (!$resp->is_valid) {
        // set the error code so that we can display it
        $messageStack->add('contact', $resp->error);
        $error = true;
    }
then change the line below from 
    if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
to
    if ($zc_validate_email and !empty($enquiry) and !empty($name) and $error == false) {
> Then in the template file add in the ```
<?php echo recaptcha_get_html($publickey, $resp->error); ?>
``` line at about line 80 in tpl_ask_a_question_default
17 Jan 2014, 19:20
#118
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Coins2012:

Could you please be more specific as to which files needs to be changed, I could add the code etc but would appreciate if you could tell me exactly which files need to be changed and their location, my website is https://www.aydincoins.com and lately been getting lot of spam emails via the ask question about this product feature.

thank you

that would be

/includes/modules/pages/ask_a_question/header_php.php

and

includes\templates\YOUR_TEMPLATE\templates\tpl_ask_a_question_default.php

17 Jan 2014, 21:11
#119
coins2012 avatar

coins2012

New Zenner

Join Date:
Jan 2012
Posts:
89
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

When I add the code and click on the 'Ask a question about this product' the website shows blank page, nothing on it, when I remove the code it works fine so not sure what's going on. Below is the code from line 1 to 59 so when you say insert it around line 40 I guess I am counting the blank lines also?

<?php /** * Ask a Question Page (based on Contact Us Page) * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $ */ $valid_product = false; if (isset($_GET['products_id'])) { $product_info_query = "select pd.products_name, p.products_image, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; $product_info = $db->Execute($product_info_query); if ($product_info->RecordCount() > 0) { $valid_product = true; } } if ($valid_product == false) { zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id'])); } require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); $error = false; if (isset($_GET['action']) && ($_GET['action'] == 'send')) { $name = zen_db_prepare_input($_POST['contactname']); $email_address = zen_db_prepare_input($_POST['email']); $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry'])); $zc_validate_email = zen_validate_email($email_address); if ($zc_validate_email and !empty($enquiry) and !empty($name)) { // auto complete when logged in if($_SESSION['customer_id']) { $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id FROM " . TABLE_CUSTOMERS . " WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $check_customer = $db->Execute($sql); $customer_email= $check_customer->fields['customers_email_address']; $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname']; } else { $customer_email='Not logged in'; $customer_name='Not logged in'; } // use contact us dropdown if defined > **buildingblocks:** > > that would be > > /includes/modules/pages/ask_a_question/header_php.php > > and > > includes\templates\YOUR_TEMPLATE\templates\tpl_ask_a_question_default.php
17 Jan 2014, 23:41
#120
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Support Thread for Google reCAPTCHA plugin

Coins2012:

When I add the code and click on the 'Ask a question about this product' the website shows blank page, nothing on it, when I remove the code it works fine so not sure what's going on. Below is the code from line 1 to 59 so when you say insert it around line 40 I guess I am counting the blank lines also?

<?php /** * Ask a Question Page (based on Contact Us Page) * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $ */ $valid_product = false; if (isset($_GET['products_id'])) { $product_info_query = "select pd.products_name, p.products_image, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; $product_info = $db->Execute($product_info_query); if ($product_info->RecordCount() > 0) { $valid_product = true; } } if ($valid_product == false) { zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id'])); } require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); $error = false; if (isset($_GET['action']) && ($_GET['action'] == 'send')) { $name = zen_db_prepare_input($_POST['contactname']); $email_address = zen_db_prepare_input($_POST['email']); $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry'])); $zc_validate_email = zen_validate_email($email_address); if ($zc_validate_email and !empty($enquiry) and !empty($name)) { // auto complete when logged in if($_SESSION['customer_id']) { $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id FROM " . TABLE_CUSTOMERS . " WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $check_customer = $db->Execute($sql); $customer_email= $check_customer->fields['customers_email_address']; $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname']; } else { $customer_email='Not logged in'; $customer_name='Not logged in'; } // use contact us dropdown if defined

Typically yes, when a line number is provided blank lines are included and the "second line" of code that wraps around the screen does not count. Considering that David downloaded a recent copy and that the line suggested to modify doesn't match a similar line in the code provided, are you sure that you have the most up-to-date? Also, when providing code, please place it between the appropriate code blocks like ['CODE'] and [/'CODE'] (with the apostrophe's removed).