Page 47 of 60 FirstFirst ... 37454647484957 ... LastLast
Results 461 to 470 of 593
  1. #461
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Captcha using TTF & GD

    Quote Originally Posted by nikki72 View Post
    Hello,
    I wanted to add this option to my return authorization form. I have search for link with instructions..but couldn't find any... does anyone know how to get this to work with return authorization form? I tired but to no avail .

    thanks nicole
    If it's the Return Authorization by Clyde, then for tpl_returns_default.php add the following, I placed mine just above the submit button..

    Code:
    <?php
    // BOF Captcha
    if(is_object($captcha) && (!$_SESSION['customer_id'])) {
    ?>
    <br class="clearBoth" />
    <?php echo $captcha->img(); ?>
    <?php echo $captcha->redraw_button(BUTTON_IMAGE_CAPTCHA_REDRAW, BUTTON_IMAGE_CAPTCHA_REDRAW_ALT); ?>
    <br class="clearBoth" />
    <label for="captcha"><?php echo TITLE_CAPTCHA; ?></label>
    <?php echo $captcha->input_field('captcha', 'id="captcha"') . '&nbsp;<span class="alert">' . TEXT_CAPTCHA . '</span>'; ?>
    <br class="clearBoth" />
    <?php
    }
    // BOF Captcha
    ?>
    Then for the header file in >modules/pages/retuns/header_php.php you need to add it in two places, first anywhere near the top this section of code..

    Code:
    //BOF Captcha
    if((CAPTCHA_RETURNS != 'false') && (!$_SESSION['customer_id'])) {
        require(DIR_WS_CLASSES . 'captcha.php');
        $captcha = new captcha();
    }
    // EOF Captcha
    
      $error = false;
    I did mine just above this line..
    if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
    Notice the CAPTCHA_RETURNS in the if statement, this turns it on or off through admin. if you don't do a SQL statement to add this, you'll need to change it to something else like CAPTCHA_CONTACT_US which has an admin control.

    Look for this line
    if ($zc_validate_email and !empty($reason) and !empty($name)) {
    replace it with the following code..
    Code:
    //BOF Captcha
      if (is_object($captcha) && !$captcha->validateCaptchaCode()) {
        $error = true;
        $messageStack->add('returns', ERROR_CAPTCHA);
      }
    //  if ($zc_validate_email and !empty($reason) and !empty($name)) {
      if ($zc_validate_email and !empty($reason) and !empty($name) and !$error) {
     //EOF Captcha
    To turn it on or off in admin.. add a sql statement using the Zen-Cart Sql Patches tool. Please backup your database before doing this... you never know when something will go wrong..
    Code:
    SET @configuration_group_id=0;
    SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'CAPTCHA' LIMIT 1;
    
    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
    (NULL, 'Return Authorization', 'CAPTCHA_RETURNS', 'true', 'Activate Validation on Return Authorization', @configuration_group_id, 23, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),');
    Again... BACKUP before running the SQL statement.. I do my testing on a testing server before making any changes to a live site!
    Dave
    Always forward thinking... Lost my mind!

  2. #462
    Join Date
    Dec 2008
    Posts
    97
    Plugin Contributions
    0

    Default Re: Captcha using TTF & GD

    worked like a charm! TY Nicole

  3. #463
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Captcha using TTF & GD

    I usually make my Return Authorization form available only to registered users, but I have a current client who is insisting on Captcha even with this option activated.. So this is SWEEEEEEEEET!!! Thanks a bunch.. (BOOKMARKING THIS!!!)

    Quote Originally Posted by davewest View Post
    If it's the Return Authorization by Clyde, then for tpl_returns_default.php add the following, I placed mine just above the submit button..

    Code:
    <?php
    // BOF Captcha
    if(is_object($captcha) && (!$_SESSION['customer_id'])) {
    ?>
    <br class="clearBoth" />
    <?php echo $captcha->img(); ?>
    <?php echo $captcha->redraw_button(BUTTON_IMAGE_CAPTCHA_REDRAW, BUTTON_IMAGE_CAPTCHA_REDRAW_ALT); ?>
    <br class="clearBoth" />
    <label for="captcha"><?php echo TITLE_CAPTCHA; ?></label>
    <?php echo $captcha->input_field('captcha', 'id="captcha"') . '&nbsp;<span class="alert">' . TEXT_CAPTCHA . '</span>'; ?>
    <br class="clearBoth" />
    <?php
    }
    // BOF Captcha
    ?>
    Then for the header file in >modules/pages/retuns/header_php.php you need to add it in two places, first anywhere near the top this section of code..

    Code:
    //BOF Captcha
    if((CAPTCHA_RETURNS != 'false') && (!$_SESSION['customer_id'])) {
        require(DIR_WS_CLASSES . 'captcha.php');
        $captcha = new captcha();
    }
    // EOF Captcha
     
      $error = false;
    I did mine just above this line..
    Notice the CAPTCHA_RETURNS in the if statement, this turns it on or off through admin. if you don't do a SQL statement to add this, you'll need to change it to something else like CAPTCHA_CONTACT_US which has an admin control.

    Look for this line
    replace it with the following code..
    Code:
    //BOF Captcha
      if (is_object($captcha) && !$captcha->validateCaptchaCode()) {
        $error = true;
        $messageStack->add('returns', ERROR_CAPTCHA);
      }
    //  if ($zc_validate_email and !empty($reason) and !empty($name)) {
      if ($zc_validate_email and !empty($reason) and !empty($name) and !$error) {
     //EOF Captcha
    To turn it on or off in admin.. add a sql statement using the Zen-Cart Sql Patches tool. Please backup your database before doing this... you never know when something will go wrong..
    Code:
    SET @configuration_group_id=0;
    SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'CAPTCHA' LIMIT 1;
     
    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
    (NULL, 'Return Authorization', 'CAPTCHA_RETURNS', 'true', 'Activate Validation on Return Authorization', @configuration_group_id, 23, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),');
    Again... BACKUP before running the SQL statement.. I do my testing on a testing server before making any changes to a live site!

  4. #464
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Captcha using TTF & GD

    Keep in mind that this line turns it off for log in customers.

    if((CAPTCHA_RETURNS != 'false') && (!$_SESSION['customer_id'])) {
    If you wish to run it for all customers even log in ones, change it to this..

    Code:
    if (CAPTCHA_RETURNS != 'false')  {
    Glade it helped!
    Dave
    Always forward thinking... Lost my mind!

  5. #465

    Default Re: Captcha using TTF & GD

    Hi,
    I was testing this on a clean install on my local server, and all was going well until I installed the "Display Inc/Ex Tax or VAT Prices" module. Now I get the "enable this picture" text instead of the image. I ran the captcha_debug.php, but it may as well be chinese.

    Code:
    captcha::__set_state(array(
       'captchaCode' => 'K97W',
       'captchaCode_length' => 4,
       'img_width' => 240,
       'img_height' => 50,
       'img_type' => 'jpeg',
       'chars_min_size' => 0.6,
       'chars_max_size' => 0.8,
       'chars_shadow' => true,
       'chars_rotation' => 23,
       'noise' => 30,
       'backgroundColor' => 
      array (
        0 => 
        array (
          0 => 220,
          1 => 220,
          2 => 220,
        ),
        1 => 
        array (
          0 => 255,
          1 => 255,
          2 => 255,
        ),
      ),
       'linesColor' => 
      array (
        0 => 
        array (
          0 => 150,
          1 => 150,
          2 => 150,
        ),
        1 => 
        array (
          0 => 185,
          1 => 185,
          2 => 185,
        ),
      ),
       'textColor' => 
      array (
        0 => 
        array (
          0 => 30,
          1 => 30,
          2 => 30,
        ),
        1 => 
        array (
          0 => 199,
          1 => 199,
          2 => 199,
        ),
      ),
       'dir_fs_fonts' => 'C:/wamp/www/CLEAN MODIFIED SITE/fonts/',
       'ttf_list' => 
      array (
        0 => 'C:/wamp/www/CLEAN MODIFIED SITE/fonts/VERDANA.TTF',
      ),
       'max_try' => 5,
       'failure_proc' => '',
       'quality' => 60,
       'chars' => 
      array (
        0 => '1',
        1 => '2',
        2 => '3',
        3 => '4',
        4 => '5',
        5 => '6',
        6 => '7',
        7 => '8',
        8 => '9',
        9 => 'A',
        10 => 'B',
        11 => 'C',
        12 => 'D',
        13 => 'E',
        14 => 'F',
        15 => 'G',
        16 => 'H',
        17 => 'I',
        18 => 'J',
        19 => 'K',
        20 => 'L',
        21 => 'M',
        22 => 'N',
        23 => 'O',
        24 => 'P',
        25 => 'Q',
        26 => 'R',
        27 => 'S',
        28 => 'T',
        29 => 'U',
        30 => 'V',
        31 => 'W',
        32 => 'X',
        33 => 'Y',
        34 => 'Z',
      ),
       '_background' => NULL,
       'img' => NULL,
       '_gd_version' => 
      array (
        'GD Version' => 'bundled (2.0.34 compatible)',
        'FreeType Support' => true,
        'FreeType Linkage' => 'with freetype',
        'T1Lib Support' => true,
        'GIF Read Support' => true,
        'GIF Create Support' => true,
        'JPG Support' => true,
        'PNG Support' => true,
        'WBMP Support' => true,
        'XPM Support' => false,
        'XBM Support' => true,
        'JIS-mapped Japanese Font Support' => false,
        'version' => '2',
      ),
       'debug' => true,
       'img_href' => 'http://localhost/CLEAN MODIFIED SITE/captcha_img.php?zenid=cjr7niaienpcclr2hb9hmqqdb0',
       'imageColorFunc' => 'imagecolorallocate',
    ))
    Any suggestions on what could be the problem?
    TIA

  6. #466
    Join Date
    Dec 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: Captcha using TTF & GD

    I'm also having the "enable this picture" issue. I've uninstalled and reinstalled multiple times. I've read all the pages. I've updated my .htaccess. I'm fairly confident it isn't a coding issue, as I've replaced the MYTEMPLATE/account code with my archived code after determining that I don't need it (just want the contact_us).

    When I run captcha_debug.php it bounces me to my home page. Does that mean there are no errors?

    When I look at the code in Firebug I see the image is secure (https). That is strange.

    Thanks in advance for the help.

  7. #467
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: Captcha using TTF & GD

    I also had the "enable this picture" problem, read the posts, tried different things and then realized- the captcha_img.php file needs to be uploaded to the root directory (or the same directory as /includes).

    That may be obvious to some, but not to a layman like me. The readme file doesn't mention it and I thought it was part of the other non-upload files like install.slq, update, etc.

    Robbie
    Last edited by giftmeister; 24 Mar 2009 at 04:05 AM.

  8. #468

    Default blank pages

    Hi all,
    I'm trying to install this module on the NEW site I'm building, and I seem to have buggered something up with the install. The contact us page and the tell-a-friend page both come up completely blank. I've tried to search through this thread to help solve the problem, but in all honesty I'm a bit lost.

    And I feel pretty silly saying this but I don't know how to run a debug file or whatever it is...

    I'm running several mods, FEC, COWOA, and a few others that I'd honestly have to go and look up to find. The test site is at w w w . t i f f s t r i n k e t s . c o m / f r d t e s t (sorry I don't want it indexed )

    Now, it doesn't break the account creation page, but the tell a friend and contact us pages come up completely blank. Oddly enough, there was ALREADY a 'captcha' edit in the tpl_modules_create_account.php file that I had in there... I'm not sure why. I am (almost) 100% sure that I have not tried to install ANY captcha module on this test site yet... I've only been working on it for a couple of months now. I do have a pretty bad memory, but not THAT bad.

    I have tested it on the create-account page, and I do have to input the characters to create an account, so I know that part of it, at least, is working. It's really the 'contact us' page that I'm most worried about; I get the most problems from that page.

    If anybody can help, I'd really appreciate it. Thanks all!
    Tiffany Rose
    Frozen Rose Design

  9. #469

    Default Re: Captcha using TTF & GD

    Nevermind, everyone. ...

    I had renamed the captcha files in a way that the page was still loading them, and it broke it.

    (more detailed explanation: I had made all of my edits but kept the original mod files, just renamed them as header_php.captcha.php etc. so I had the untouched mod files if I needed them, but this rename wasn't quite enough! I changed it to captcha.header_php.php or somesuch and now my page works again...)

    Whew!
    I always seem to figure out my own problems RIGHT after I make a forum post about it... :)
    Tiffany Rose
    Frozen Rose Design

  10. #470
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Captcha using TTF & GD

    Quote Originally Posted by misticloudz View Post
    I always seem to figure out my own problems RIGHT after I make a forum post about it... :)
    Always helps to talk it through.... also, file renaming for backups. Best to remove them to a backup set of your store or just remove the extension '.php' change it to something like'.bak' or '.old'. leaving the '.php' even renaming the file can lead to more problems.
    Dave
    Always forward thinking... Lost my mind!

 

 
Page 47 of 60 FirstFirst ... 37454647484957 ... LastLast

Similar Threads

  1. Replies: 68
    Last Post: 29 Jul 2013, 06:33 PM
  2. CAPTCHA using TTF & GD - not working
    By derrr99 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 13 Dec 2010, 04:05 PM
  3. Replies: 13
    Last Post: 2 Jun 2008, 03:29 PM
  4. Captcha using TTF & GD & Tel Not Required (how do I Avoid Overwrites?)
    By CelticKatt in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 8 Apr 2008, 04:18 AM
  5. Can CAPTCHA Using TTF & GD be installed in check out?
    By Lainee in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 8 May 2007, 04:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR