Forums / All Other Contributions/Addons / CAPTCHA Anti-Robot Mod

CAPTCHA Anti-Robot Mod

Views: 37,328

Results 81 to 100 of 186
3 May 2011, 10:12 PM
#81
eric47905 avatar

eric47905

New Zenner

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

CAPTCHA Anti-Robot Mod

Ok, I tried searching all of these forums and cannot find an answer specific to my issue, and I think this is the right thread to reply in.

I am trying to use the standard CAPTCHA Anti-Robot Registration
by JT of GTI Custom ver 1.3, zencart ver 1.3.9h

Installed, and the Captcha works on the contact us (except that it erases your message if you type the wrong captcha phrase, any way to keep this from happening?), and the tell a friend, but on the create account page there is nothing there until you hit submit, then it says you didnt enter the proper phrase, then it shows up at the bottom.

So, the first time you go into the create account page it is just normal until you try to submit, then it errors and shows up.

I can go into the configuration and disable it on the create account page and then you can create an account fine, but no captcha, so it kind of defeats half the purpose of having it.

Earlier in this thread, JT is telling people to make sure that they have renamed the folders to your template name (Labeled Your_template), but in the add on download under modules there is no template folder at all, and the template folder places them under template_default. Am I supposed to chage the template_default to my skin name?

Any ideas?

Thanks a bunch for the mod though, if I can get it working fully it will be great.

18 May 2011, 11:08 AM
#82
anbt avatar

anbt

New Zenner

Join Date:
May 2011
Posts:
4
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Hi JTheed,

This module is working well. But i want to put a button beside this capcha to refresh it. Please help me how to do it.

Thanks and best regards

5 Jun 2011, 7:40 AM
#83
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Can this mod work with Ask a Question mod? How?

Steve
prommart.com

6 Jun 2011, 8:36 PM
#84
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Nevermind, I got the other captcha working with Ask a Question mod.

Steve
prommart.com

7 Jun 2011, 12:49 PM
#85
ginar avatar

ginar

New Zenner

Join Date:
Feb 2006
Posts:
83
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

I have installed the mod to work with the contact_us page. Everything appears to be installed correctly and have doubled checked that everything went into the correct folders. I set it as TRUE for tell a friend for now to test it and I get the following:

  1. It shows on the page but no images instead there are the words "Enable this picture" with a "redraw" tab next to the words.
  2. Box underneath this with words next to it "verification code".

When I type in a dummy code it says that I have entered the wrong code... all good. But, how can I get the images to show up.

This is from the source code:
<img id="captcha-img" src="https://www.website.com.au/captcha_img.php?zenid=a415850a70e41b43d68907faedc2f4c8&rand=0.322064001307450238" alt="Enable this picture" title=" Enable this picture " width="240" height="50" /><input type="image" src="includes/templates/my_template/buttons/english/button_redraw.gif" alt="Redraw Capture Image" title=" Redraw Capture Image " onclick="document.getElementById('captcha-img').src='https://www.website.com.au/captcha_img.php?zenid=a415850a70e41b43d68907faedc2f4c8&rand='+Math.random();return false;" /><br class="clearBoth" />
<label for="captcha">Verification code:</label>
<input type="text" name="captcha" id="captcha" /> <span class="alert">* (case insensitive)</span><br class="clearBoth" />

What should the CHMOD be for images/verification folder?
When I call us the captcha_img.php file in the browser I get the following:

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

*   Please contact the web site owners to inform them of this problem.

Could it be the https in the code that is causing the images not to show?

30 Jun 2011, 2:31 AM
#86
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

JTheed:

Oxxyfx and fontaholic,

Did you rename the folders under includes/modules/YOUR_TEMPLATE and includes/templates/YOUR_TEMPLATE to the actual name of your template that you are using?
Did you verify that the SQL installed correctly?

JT

Work fine on tell a friend and contact us. But I don't see on registration. I believe installed correct includes/.

How to verify SQL correct?

10 Jul 2011, 9:15 PM
#87
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

dont see on registration page either ?

anything worth checking

thanks
bryan

11 Jul 2011, 8:01 AM
#88
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

just an update for anyone using ceon url mapping add no,

i was getting no captcha showing at all

in /includes/templates/YOURTEMPLTE/ tpl_modules_create_account.php

at line 189

change to

<?php
if (strstr($_SERVER['REQUEST_URI'],'create-account') && CREATE_ACCOUNT_VALIDATION == 'true' || strstr($_SERVER['REQUEST_URI'],'login') && CREATE_ACCOUNT_VALIDATION == 'true' || strstr($_SERVER['REQUEST_URI'],'create_account') && CREATE_ACCOUNT_VALIDATION == 'true') { 
?>

<?php
  if ($is_read_only == false || (strstr($_SERVER['REQUEST_URI'],'create-account')) || (strstr($_SERVER['REQUEST_URI'],'login')) || (strstr($_SERVER['REQUEST_URI'],'create_account'))) {
	$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
	if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
	$reg_key = generate_captcha_code();
	$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
	if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?>

this works for me and lets you use captcha if ceon is on or off

and in includes/templates/YOURTEMPLATE/tpl_contact_us_default.php at line 83 change to

<?php
if (strstr($_SERVER['REQUEST_URI'],'contact-us') && CONTACT_US_VALIDATION == 'true' || strstr($_SERVER['REQUEST_URI'],'contact_us') && CONTACT_US_VALIDATION == 'true' || strstr($_SERVER['REQUEST_URI'],'login') && LOGIN_VALIDATION == 'true') { 
?>

<?php
  if ($is_read_only == false || (strstr($_SERVER['REQUEST_URI'],'contact-us')) || (strstr($_SERVER['REQUEST_URI'],'contact_us')) || (strstr($_SERVER['REQUEST_URI'],'login'))) {
    $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
    if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
    $reg_key = generate_captcha_code();
    $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
    if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?>

again this should let you use captcha with ceon offf or on.

hope this helps someone

bryan

16 Jul 2011, 2:19 AM
#89
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Why no captcha showing on Ask a question about this product?

Why no CAPTCHA showing once an item enabled CEON url mapping? But without CEON.

How to fix them? Thank you!

16 Jul 2011, 8:42 PM
#90
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

hi,
after a bit of help over a ceon support thread from conor i ended up changing code slightly from above

in tpl_modules_create_account.php

use code

<?php
if ($_GET['main_page'] == 'create_account' && CREATE_ACCOUNT_VALIDATION == 'true' || $_GET['main_page'] == 'login' && LOGIN_VALIDATION == 'true') { 
?>

<?php
  if ($is_read_only == false || $_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login') {
	$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
	if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
	$reg_key = generate_captcha_code();
	$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
	if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?>

and in tpl_contact_us_default.php

<?php
if ($_GET['main_page'] == 'contact_us' && CONTACT_US_VALIDATION == 'true') { 
?>

<?php
  if ($is_read_only == false || $_GET['main_page'] == 'contact_us' || $_GET['main_page'] == 'login') {
    $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
    if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
    $reg_key = generate_captcha_code();
    $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
    if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?> 

and in tpl_tell_a_friend_default.php

<?php
if ($_GET['main_page'] == 'tell_a_friend') { 
?>


<?php
  if ($is_read_only == false || $_GET['main_page'] == 'tell_a_friend') {
    $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
    if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
    $reg_key = generate_captcha_code();
    $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
    if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?>

i have placed these in my includes/templates/TEMPLATE_NAME/templates folder

they can be seen working over at https://www.onyourbike.co.uk. i dont use the tell a friend but it definitely works, i have included the 3 files im using,

thanks bryan

16 Jul 2011, 11:21 PM
#91
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Hi Bryan,

Downloaded your template.zip

fixed on tell a friend.

But other two files seem like missing some code. Causes right sideboxes dispear and still no CAPTcha.

16 Jul 2011, 11:50 PM
#92
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

bn17311:

hi,
after a bit of help over a ceon support thread from conor i ended up changing code slightly from above

in tpl_modules_create_account.php

use code

<?php if ($_GET['main_page'] == 'create_account' && CREATE_ACCOUNT_VALIDATION == 'true' || $_GET['main_page'] == 'login' && LOGIN_VALIDATION == 'true') { ?> <?php if ($is_read_only == false || $_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login') { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'"; if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); } $reg_key = generate_captcha_code(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); } ?>
> 
> thanks bryan

Hi Bryan,

Your zip/This file causes missing right sidebox and still no CATPChA.

tpl_modules_create_account.php
why ending with <? echo tep_crafty_country_handler(1); ?> ?
I skip this still not working.

Other two are working fine.
17 Jul 2011, 8:58 AM
#93
bn17311 avatar

bn17311

Zen Follower

Join Date:
Apr 2010
Posts:
319
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

hi,
i really only included my files so you could compare where the captcha code changed as i have postcode look up in mine

here is the file that came with package but modified with new code

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=create_account.<br />
 * Displays Create Account form.
 *
 * @package templateSystem
 * @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: tpl_modules_create_account.php 4822 2006-10-23 11:11:36Z drbyte $
 */
?>

<?php if ($messageStack->size('create_account') > 0) echo $messageStack->output('create_account'); ?>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />

<?php
  if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
?>
<fieldset>
<legend><?php echo TABLE_HEADING_PRIVACY_CONDITIONS; ?></legend>
<div class="information"><?php echo TEXT_PRIVACY_CONDITIONS_DESCRIPTION;?></div>
<?php echo zen_draw_checkbox_field('privacy_conditions', '1', false, 'id="privacy"');?>
<label class="checkboxLabel" for="privacy"><?php echo TEXT_PRIVACY_CONDITIONS_CONFIRM;?></label>
</fieldset>
<?php
  }
?>

<?php
  if (ACCOUNT_COMPANY == 'true') {
?>
<fieldset>
<legend><?php echo CATEGORY_COMPANY; ?></legend>
<label class="inputLabel" for="company"><?php echo ENTRY_COMPANY; ?></label>
<?php echo zen_draw_input_field('company', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' id="company"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?>
</fieldset>
<?php
  }
?>

<fieldset>
<legend><?php echo TABLE_HEADING_ADDRESS_DETAILS; ?></legend>
<?php
  if (ACCOUNT_GENDER == 'true') {
?>
<?php echo zen_draw_radio_field('gender', 'm', '', 'id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' . MALE . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE . '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' . ENTRY_GENDER_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php
  }
?>

<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>
<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME; ?></label>
<?php echo zen_draw_input_field('lastname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', '40') . ' id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<label class="inputLabel" for="street-address"><?php echo ENTRY_STREET_ADDRESS; ?></label>
  <?php echo zen_draw_input_field('street_address', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' id="street-address"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<?php
  if (ACCOUNT_SUBURB == 'true') {
?>
<label class="inputLabel" for="suburb"><?php echo ENTRY_SUBURB; ?></label>
<?php echo zen_draw_input_field('suburb', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', '40') . ' id="suburb"') . (zen_not_null(ENTRY_SUBURB_TEXT) ? '<span class="alert">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php
  }
?>

<label class="inputLabel" for="city"><?php echo ENTRY_CITY; ?></label>
<?php echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<?php
  if (ACCOUNT_STATE == 'true') {
    if ($flag_show_pulldown_states == true) {
?>
<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
<?php
      echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"');
      if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert">' . ENTRY_STATE_TEXT . '</span>'; 
    }
?>

<?php if ($flag_show_pulldown_states == true) { ?>
<br class="clearBoth" id="stBreak" />
<?php } ?>
<label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
<?php
    echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"');
    if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert" id="stText">' . ENTRY_STATE_TEXT . '</span>';
    if ($flag_show_pulldown_states == false) {
      echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
    }
?>
<br class="clearBoth" />
<?php
  }
?>

<label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE; ?></label>
<?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
</fieldset>

<fieldset>
<legend><?php echo TABLE_HEADING_PHONE_FAX_DETAILS; ?></legend>
<label class="inputLabel" for="telephone"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
<?php echo zen_draw_input_field('telephone', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', '40') . ' id="telephone"') . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?>

<?php
  if (ACCOUNT_FAX_NUMBER == 'true') {
?>
<br class="clearBoth" />
<label class="inputLabel" for="fax"><?php echo ENTRY_FAX_NUMBER; ?></label>
<?php echo zen_draw_input_field('fax', '', 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?>
<?php
  }
?>
</fieldset>

<?php
  if (ACCOUNT_DOB == 'true') {
?>
<fieldset>
<legend><?php echo TABLE_HEADING_DATE_OF_BIRTH; ?></legend>
<label class="inputLabel" for="dob"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
<?php echo zen_draw_input_field('dob','', 'id="dob"') . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="alert">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
</fieldset>
<?php
  }
?>

<fieldset>
<legend><?php echo TABLE_HEADING_LOGIN_DETAILS; ?></legend>
<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
<?php echo zen_draw_input_field('email_address', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="email-address"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<?php
  if ($phpBB->phpBB['installed'] == true) {
?>
<label class="inputLabel" for="nickname"><?php echo ENTRY_NICK; ?></label>
<?php echo zen_draw_input_field('nick','','id="nickname"') . (zen_not_null(ENTRY_NICK_TEXT) ? '<span class="alert">' . ENTRY_NICK_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php
  }
?>

<label class="inputLabel" for="password-new"><?php echo ENTRY_PASSWORD; ?></label>
<?php echo zen_draw_password_field('password', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-new"') . (zen_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<label class="inputLabel" for="password-confirm"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></label>
<?php echo zen_draw_password_field('confirmation', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-confirm"') . (zen_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
</fieldset>

<fieldset>
<legend><?php echo ENTRY_EMAIL_PREFERENCE; ?></legend>
<?php
  if (ACCOUNT_NEWSLETTER_STATUS != 0) {
?>
<?php echo zen_draw_checkbox_field('newsletter', '1', $newsletter, 'id="newsletter-checkbox"') . '<label class="checkboxLabel" for="newsletter-checkbox">' . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
<?php } ?>

<?php echo zen_draw_radio_field('email_format', 'HTML', ($email_format == 'HTML' ? true : false),'id="email-format-html"') . '<label class="radioButtonLabel" for="email-format-html">' . ENTRY_EMAIL_HTML_DISPLAY . '</label>' .  zen_draw_radio_field('email_format', 'TEXT', ($email_format == 'TEXT' ? true : false), 'id="email-format-text"') . '<label class="radioButtonLabel" for="email-format-text">' . ENTRY_EMAIL_TEXT_DISPLAY . '</label>'; ?>
<br class="clearBoth" />
</fieldset>

<?php
if (ACCOUNT_VALIDATION == 'true') {
?>

<?php
if ($_GET['main_page'] == 'create_account' && CREATE_ACCOUNT_VALIDATION == 'true' || $_GET['main_page'] == 'login' && LOGIN_VALIDATION == 'true') { 
?>

<?php
  if ($is_read_only == false || $_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login') {
    $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'";
    if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); }
    $reg_key = generate_captcha_code();
    $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')";
    if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); }
?> 

<fieldset>
<legend><?php echo CATEGORY_ANTIROBOTREG; ?></legend>
<label class="inputLabel" for="antirobotreg"><?php echo ENTRY_ANTIROBOTREG ?></label>

<?php
$validation_images = '';
for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++)
    {
    $parse_image = 'validation/validation_' . $reg_key{$i} . '.gif';
    $parse_image_alt = $reg_key{$i};
    $validation_images .= zen_image(DIR_WS_IMAGES . $parse_image, $parse_image_alt);
    }
    echo '<div class="centered">';
    echo $validation_images . '<br />';
    echo '</div>';
?>

<?php echo zen_draw_input_field('antirobotreg','', 'id="antirobotreg"') . (zen_not_null(ENTRY_ANTIROBOTREG) ? '<span class="alert">' . ENTRY_ANTIROBOTREG_TEXT . '</span>': ''); ?>
<br class="clearBoth" />

<?php
    }
?>

<?php
    }
?>

<?php
    }
?>


<?php
  if (CUSTOMERS_REFERRAL_STATUS == 2) {
?>
<fieldset>

<legend><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></legend>
<label class="inputLabel" for="customers_referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>
<?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '15') . ' id="customers_referral"'); ?>
<br class="clearBoth" />
</fieldset>
<?php } ?>

hope this helps i have tried this on mine and it works and i have right hand boxes without problem

thanks

17 Jul 2011, 4:27 PM
#94
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

bn17311:

hi,
i really only included my files so you could compare where the captcha code changed as i have postcode look up in mine

here is the file that came with package but modified with new code

<?php /** * Page Template * * Loaded automatically by index.php?main_page=create_account.<br /> * Displays Create Account form. * * @package templateSystem * @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: tpl_modules_create_account.php 4822 2006-10-23 11:11:36Z drbyte $ */ ?> <?php if ($messageStack->size('create_account') > 0) echo $messageStack->output('create_account'); ?> <div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div> <br class="clearBoth" /> <?php if (DISPLAY_PRIVACY_CONDITIONS == 'true') { ?> <fieldset> <legend><?php echo TABLE_HEADING_PRIVACY_CONDITIONS; ?></legend> <div class="information"><?php echo TEXT_PRIVACY_CONDITIONS_DESCRIPTION;?></div> <?php echo zen_draw_checkbox_field('privacy_conditions', '1', false, 'id="privacy"');?> <label class="checkboxLabel" for="privacy"><?php echo TEXT_PRIVACY_CONDITIONS_CONFIRM;?></label> </fieldset> <?php } ?> <?php if (ACCOUNT_COMPANY == 'true') { ?> <fieldset> <legend><?php echo CATEGORY_COMPANY; ?></legend> <label class="inputLabel" for="company"><?php echo ENTRY_COMPANY; ?></label> <?php echo zen_draw_input_field('company', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' id="company"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?> </fieldset> <?php } ?> <fieldset> <legend><?php echo TABLE_HEADING_ADDRESS_DETAILS; ?></legend> <?php if (ACCOUNT_GENDER == 'true') { ?> <?php echo zen_draw_radio_field('gender', 'm', '', 'id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' . MALE . '</label>' . zen_draw_radio_field('gender', 'f', '', 'id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' . FEMALE . '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' . ENTRY_GENDER_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?>

<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>

<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?> <br class="clearBoth" />

<label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME; ?></label>

<?php echo zen_draw_input_field('lastname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', '40') . ' id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?> <br class="clearBoth" />

<label class="inputLabel" for="street-address"><?php echo ENTRY_STREET_ADDRESS; ?></label>

<?php echo zen_draw_input_field('street_address', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' id="street-address"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php if (ACCOUNT_SUBURB == 'true') { ?>

<label class="inputLabel" for="suburb"><?php echo ENTRY_SUBURB; ?></label>

<?php echo zen_draw_input_field('suburb', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', '40') . ' id="suburb"') . (zen_not_null(ENTRY_SUBURB_TEXT) ? '<span class="alert">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?>

<label class="inputLabel" for="city"><?php echo ENTRY_CITY; ?></label>

<?php echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php if (ACCOUNT_STATE == 'true') { if ($flag_show_pulldown_states == true) { ?>

<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>

<?php echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"'); if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert">' . ENTRY_STATE_TEXT . '</span>'; } ?> <?php if ($flag_show_pulldown_states == true) { ?> <br class="clearBoth" id="stBreak" /> <?php } ?> <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label> <?php echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"'); if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert" id="stText">' . ENTRY_STATE_TEXT . '</span>'; if ($flag_show_pulldown_states == false) { echo zen_draw_hidden_field('zone_id', $zone_name, ' '); } ?> <br class="clearBoth" /> <?php } ?>

<label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE; ?></label>

<?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?> <br class="clearBoth" />

<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>

<?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?> <br class="clearBoth" /> </fieldset> <fieldset> <legend><?php echo TABLE_HEADING_PHONE_FAX_DETAILS; ?></legend> <label class="inputLabel" for="telephone"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label> <?php echo zen_draw_input_field('telephone', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', '40') . ' id="telephone"') . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?> <?php if (ACCOUNT_FAX_NUMBER == 'true') { ?> <br class="clearBoth" /> <label class="inputLabel" for="fax"><?php echo ENTRY_FAX_NUMBER; ?></label> <?php echo zen_draw_input_field('fax', '', 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?> <?php } ?> </fieldset> <?php if (ACCOUNT_DOB == 'true') { ?> <fieldset> <legend><?php echo TABLE_HEADING_DATE_OF_BIRTH; ?></legend> <label class="inputLabel" for="dob"><?php echo ENTRY_DATE_OF_BIRTH; ?></label> <?php echo zen_draw_input_field('dob','', 'id="dob"') . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="alert">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?> <br class="clearBoth" /> </fieldset> <?php } ?> <fieldset> <legend><?php echo TABLE_HEADING_LOGIN_DETAILS; ?></legend> <label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL_ADDRESS; ?></label> <?php echo zen_draw_input_field('email_address', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="email-address"') . (zen_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php if ($phpBB->phpBB['installed'] == true) { ?>

<label class="inputLabel" for="nickname"><?php echo ENTRY_NICK; ?></label>

<?php echo zen_draw_input_field('nick','','id="nickname"') . (zen_not_null(ENTRY_NICK_TEXT) ? '<span class="alert">' . ENTRY_NICK_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?>

<label class="inputLabel" for="password-new"><?php echo ENTRY_PASSWORD; ?></label>

<?php echo zen_draw_password_field('password', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-new"') . (zen_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?> <br class="clearBoth" />

<label class="inputLabel" for="password-confirm"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></label>

<?php echo zen_draw_password_field('confirmation', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-confirm"') . (zen_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="alert">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?> <br class="clearBoth" /> </fieldset> <fieldset> <legend><?php echo ENTRY_EMAIL_PREFERENCE; ?></legend> <?php if (ACCOUNT_NEWSLETTER_STATUS != 0) { ?> <?php echo zen_draw_checkbox_field('newsletter', '1', $newsletter, 'id="newsletter-checkbox"') . '<label class="checkboxLabel" for="newsletter-checkbox">' . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?> <?php echo zen_draw_radio_field('email_format', 'HTML', ($email_format == 'HTML' ? true : false),'id="email-format-html"') . '<label class="radioButtonLabel" for="email-format-html">' . ENTRY_EMAIL_HTML_DISPLAY . '</label>' . zen_draw_radio_field('email_format', 'TEXT', ($email_format == 'TEXT' ? true : false), 'id="email-format-text"') . '<label class="radioButtonLabel" for="email-format-text">' . ENTRY_EMAIL_TEXT_DISPLAY . '</label>'; ?> <br class="clearBoth" /> </fieldset> <?php if (ACCOUNT_VALIDATION == 'true') { ?> <?php if ($_GET['main_page'] == 'create_account' && CREATE_ACCOUNT_VALIDATION == 'true' || $_GET['main_page'] == 'login' && LOGIN_VALIDATION == 'true') { ?> <?php if ($is_read_only == false || $_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login') { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'"; if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); } $reg_key = generate_captcha_code(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); } ?> <fieldset> <legend><?php echo CATEGORY_ANTIROBOTREG; ?></legend> <label class="inputLabel" for="antirobotreg"><?php echo ENTRY_ANTIROBOTREG ?></label> <?php $validation_images = ''; for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++) { $parse_image = 'validation/validation_' . $reg_key{$i} . '.gif'; $parse_image_alt = $reg_key{$i}; $validation_images .= zen_image(DIR_WS_IMAGES . $parse_image, $parse_image_alt); } echo '<div class="centered">'; echo $validation_images . '<br />'; echo '</div>'; ?> <?php echo zen_draw_input_field('antirobotreg','', 'id="antirobotreg"') . (zen_not_null(ENTRY_ANTIROBOTREG) ? '<span class="alert">' . ENTRY_ANTIROBOTREG_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?> <?php } ?> <?php } ?> <?php if (CUSTOMERS_REFERRAL_STATUS == 2) { ?> <fieldset> <legend><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></legend> <label class="inputLabel" for="customers_referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label> <?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', '15') . ' id="customers_referral"'); ?> <br class="clearBoth" /> </fieldset> <?php } ?> ``` > > hope this helps i have tried this on mine and it works and i have right hand boxes without problem > > thanks

The CAPTCHA still not showing on Register, Product review and Ask a question by using your whole codes. But sidebox is normal now. I found following 3 lines you changed for the original:

($_GET['main_page'] == 'create_account'
$_GET['main_page'] == 'login'
$_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login')

Thank you for your time anyway.

17 Jul 2011, 5:28 PM
#95
hara avatar

hara

Zen Follower

Join Date:
Sep 2008
Posts:
397
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

hara:

The CAPTCHA still not showing on Register, Product review and Ask a question by using your whole codes. But sidebox is normal now. I found following 3 lines you changed for the original:

($_GET['main_page'] == 'create_account'
$_GET['main_page'] == 'login'
$_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login')

Thank you for your time anyway.

Hello bn17311,

It means your codes are inter-changeable but no help in my case.
I forgot to tell one thing:
CATPCHA not showing on the first page of Register form. But shows after filling and clicking the SUBMIT button. It is same no fix so far.

17 Jul 2011, 10:54 PM
#96
sybertemplates avatar

sybertemplates

New Zenner

Join Date:
Mar 2010
Posts:
24
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

SPH:

Nevermind, I got the other captcha working with Ask a Question mod.

Can you tell me which module you used? Thanks

9 Aug 2011, 10:19 AM
#97
shaneblanc avatar

shaneblanc

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Hi there,I have follow all the instruction in the readme files,I have applied the install_sql files,i have renamed"your_template"file to my template names,both module and template,but the capcha refuse to show up,but it do show in admin page and I select true in the option menu.What mistake do i have?Any help is much appreciated.Thanks!

9 Aug 2011, 11:02 AM
#98
shaneblanc avatar

shaneblanc

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

problem fixed.just copy the files in \includes\templates\your_template to \includes\templates\your_template\templates\ and it will works

31 Aug 2011, 3:32 PM
#99
jillcripps avatar

jillcripps

New Zenner

Join Date:
Apr 2011
Posts:
60
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

Hi, Can anyone help, this is a great mod but I am fairly new to adding mods, I have followed all instructions and have the mod working on the contact us page but not on the log-in page

https://www.ew-trading.com

I inherited the site so maybe need to adapt something?

Any ideas welcome please as having multiple users signing up with same address but many diff emails...so think this mod will help!

Tested the mod vai contact page and works, comes up in admin panel etc, just not showing on that log-in page.

Thanks!

31 Aug 2011, 5:33 PM
#100
jillcripps avatar

jillcripps

New Zenner

Join Date:
Apr 2011
Posts:
60
Plugin Contributions:
0

Re: CAPTCHA Anti-Robot Mod

I think I see an issue - my 'create_account' page is titled 'login' for some reason (when you go to log-in from nav bar). I have tried replicating and changing info in files to login (adding another set of files) and placing them but still not working, now I also see the login page is https and the create_account http...

Not sure what I can do here, not being a zen cart whiz...If I do a test on the login page and click submit, then it takes me to create_account and tells me I have entered code incorrectly and then I can input it, all the info is on that page...

So, I need to get the info on the login page or change the log-in page to direct to the create_account page (but then do I lose the SSL)....? Curioser...

https://www.ew-trading.com