TNG captcha v5

From Genwiki

Revision as of 11:23, 11 October 2006 by Admin (Talk | contribs)

Jump to: navigation, search

If you are not comfortable with html and php editing, this page may not be for you


Overview

TNG Installation Contents

Installation for TNG Version 5.1.4

If you have previously modified your TNG newacctform.php or suggest.php file, do not continue. You WILL lose any changes to that file you have previously made.

  1. backup your existing TNG v5.1.4 newacctform.php and suggest.php file
  2. download this zip (TNG_captcha_Rev_3.5.zip)
  3. unzip it, examine the contents
  4. copy the "freecap" folder to the main TNG folder
    • make sure it is readable and executable by all
  5. verify that all the ".ht****" files and the freecap.php file are in the new "freecap" folder
    • ensure they are all readable
    • MAC users - please note that the .ht*** files are reported to be hidden files and may not be visible. The program "Transfer" has been recommended to assist with this.
  6. copy the applicable captcha_text.php files to your language folders.
    • for example, copy the /./English/captch_text.php to the ./English folder
  7. for each supported language, edit the text.php file in the language folder and add an include line at the second to last line, just before the "?>"
    • add the line @include("captcha_text.php");
  8. copy the TNG_captcha.php file to the base TNG folder
  9. copy the newacctform.php and/or the suggest.php file to your base TNG folder. This should replace an existing TNG file of the same name
  10. check it out


Installation for TNG pre - Version 5.1.4

  • IF you are NOT running v5.1.4 or you HAVE made changes to either of the above files then, you must add the single include line to the newacctform.php or suggest.php file on your own. Follow the instructions above, except edit the newacctform.php and/or the suggest.php files, do not copy them.
  • use the sample newacctform.php and suggest.php files as examples.
    • in newacctform.php, examine the "include" at line 44
    • in suggest.php, examine the "include" at line 111
  • edit your version of each of these files to add the include at the appropriate line


Customizations

The captcha provided in the original puremango package has been included as is. If you wish to experiment with some of the options, please review the freecap.php script in the freecap folder. It includes a description of the code, the possible options, and locations to find alternate fonts and suggestions on background image creation.


Customization - Embedded email address in Captcha page

If you would like to use the version which displays your email address (but hidden from robots), you may use the TNG_captcha.php file in the "Captcha with email address" folder. This file MUST be customized with your email address information. Follow these instructions:

  1. open the TNG_captcha.php file in the "Captcha with email address" folder
  2. if your email address is myname@mydomain.com then
    • edit the line xa="myname";
    • edit the line xs="mydomain.com";
    • edit the line xq="The Subject line for the email message";
  3. edit line 65 and change "My Name" to the name you would like displayed on the page
  4. close the file and copy it to the main TNG folder
  5. check it out


I'm still getting registration spam!

If you have successfully installed the captcha on the registration form, but are still receiving registration spam, read on. Your site may have been discovered by a spambot that already understands how our TNG sites operate, or one that is continuing to target your site because it has already learned how to spam your site before you installed your captcha. The following simple steps will defeat this learned spambot behaviour.

  • ensure you have a backup copy of your original TNG "addnewacct.php" file
  • rename the addnewacct.php file to something else (such as nospamnewacct.php) as follows:
    • find your local copy of the "addnewacct.php" file
    • copy it to the new name such as "nospamnewacct.php"
    • place the "nospamnewacct.php" file into your TNG main folder (probably using your ftp program)
    • do NOT leave a copy of "addnewacct.php" in your TNG folder (remove the file using your ftp program)
  • open your local copy of "newacctform.php" with your favourite editor (example: wordpad)
    • find the line "$formstr = getFORM( "addnewacct", "post", "form1", "" );"
    • change the "addnewacct" to the new name you chose for the file ("nospamnewacct", leave the .php off in this line)
    • save the changes
  • place the modified "newacctform.php" in your TNG main folder (probably using your ftp program)


I'm still getting suggest spam!

If you have successfully installed the captcha on the suggest form, but are still receiving suggest spam, read on. Your site may have been discovered by a spambot that already understands how our TNG sites operate, or one that is continuing to target your site because it has already learned how to spam your site before you installed your captcha. The following simple steps will defeat this learned spambot behaviour.

  • ensure you have a backup copy of your original TNG "suggest.php" file
  • rename the "tngsendmail.php" file to something else (such as "mytngsendmail.php") as follows:
    • find your local copy of the "tngsendmail.php" file
    • copy it to the new name such as "mytngsendmail.php"
    • place the "mytngsendmail.php" file into your TNG main folder (probably using your ftp program)
    • do NOT leave a copy of "tngsendmail.php" in your TNG folder (remove the file using your ftp program)
  • open your local copy of "suggest.php" with your favourite editor (example: wordpad)
    • find the line "$formstr = getFORM("tngsendmail", "POST\" onSubmit=\"return validateForm();", "suggest", "suggest" );"
    • change the "tngsendmail" to the new name you chose for the file ("mytngsendmail", leave the .php off in this line)
    • save the changes
  • place the modified "suggest.php" in your TNG main folder (probably using your ftp program)


I've installed the captcha, the text is ok, but my Graphic is not diplayed!

If everything seems to be setup correctly, but the graphic is missing, you may not have the required GD library support loaded with your server's PHP installation. You can verify that the GD library support is loaded by using the TNG->admin->Setup&Configuration->PHP-info_Screen. Search through this long screen to locate a line that indicates "GD support" enabled. If you can't find any mention of this library, then that's the likely problem.

Although this is a fairly standard module to have loaded, you may need to email your hosting company's support contact and request that they enable the GD support for your PHP.

If you are managing your own server, you'll need to add the support. Check http://ca.php.net/gd for assistance.


In the event of a problem with your version 5.1.4 TNG site

  1. copy your backup newacctform.php and/or suggest.php to your base TNG folder
  2. copy your language text.php files back to their language folders
  3. if you made the additional modifications, copy your backup "addnewacct.php" and/or your backup "tngsendmail.php" file to your base TNG folder as well
    • all should be well now
  4. you may also delete the "freecap" folder and files, TNG_captcha.php, and the captcha language support files


In the event of a problem with your version 6 TNG site

  1. delete the captcha_text.php file from all language folders
  2. delete the TNG_captcha.php file from the main TNG folder
  3. delete the "freecap" folder and contents
    • all should be well now


Support

  1. You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
    • Please post suggestions, or your own flavour of this mod to the forum or list


Acknowledgments

A big thanks goes out to all those TNG users in the TNGuser list that contributed to the discussion regarding the use of a Captcha in TNG

  • A special thanks goes out to
    • Francis Amar who provided the French and Spanish translations.
    • Martien van Balgooi who provided the Dutch translation.
    • Aguinaldo Valentin Fidelis who provided the Brazilian Portuguese translation.
    • Ian Singer who provided the alternate English text file.
    • John Lisle for providing the code to hide the email address from those pesky spambots and email harvesters.
    • Russell G. Strong who provided the German translation.
    • Henny Savenije who provided some minor code suggestions and suggestions for the installation repackage to connect with TNG version 6 more simply
  • Thanks to Darrin for suggesting to create a single line include version in preparation for TNG v6.
Personal tools