Difference between revisions of "TNG captcha"

From Genwiki

Jump to: navigation, search
(Acknowledgements)
Line 8: Line 8:
  
 
This implementation is based upon [http://www.puremango.co.uk/cm_php_captcha_script_113.php PureMango's code] version 1.41.  Check the link for a [http://www.puremango.co.uk/freecap14/freecap_wrap14.php demo] of how it works.  The original package from PureMango contains an additional php wrapper file that provides the demo example.
 
This implementation is based upon [http://www.puremango.co.uk/cm_php_captcha_script_113.php PureMango's code] version 1.41.  Check the link for a [http://www.puremango.co.uk/freecap14/freecap_wrap14.php demo] of how it works.  The original package from PureMango contains an additional php wrapper file that provides the demo example.
 
This was a fairly quick implementation. There may be a more elegant way to integrate the PureMango code in such a way that it is much more modular.  I leave that as an exercise for the ambitious.  If someone has already integrated the PureMango captcha with TNG, drop me a note.
 
  
  
 
{| cellpadding="3"
 
{| cellpadding="3"
 
|-
 
|-
| ''Revision 1.0 July 23, 2006'' ||  - No functional difference, the code is a little nicer looking, a note added for the visually disabled. ||
+
| ''Rev 3 Jul 26, 2006'' ||  - Rewritten as a single line modification of the TNG files. Multi-language support including: English, French, Spanish, and DutchThis version requires only a single line change to the original TNG files allowing for easy migration to the next TNG version. ||  
|-
+
| ''Revision 2.0 July 23, 2006'' ||  - Added the captcha for the TNG suggest.php file. ||
+
|-
+
| ''Revision 2.1 July 23, 2006'' || - minor text change to the suggest page comment requesting email assistance.<br/> - removed the 'Hidden' attribute from the original distribution files to make handling a little easier (especially in the MAC world) ||
+
|-
+
| ''Revision 2.2 July 23, 2006'' ||  - added a version of the account login form with French and Spanish translation examples ||
+
|-
+
| ''Revision 2.3 July 24, 2006'' ||  - added individual versions for French, Spanish, Dutch for both forms ||
+
 
|}
 
|}
  
Line 29: Line 19:
  
 
# A working [http://lythgoes.net/genealogy/software.php TNG] installation - see ''[http://lythgoes.net/genealogy/software.php The Next Generation of Genealogy Sitebuilding]''
 
# A working [http://lythgoes.net/genealogy/software.php TNG] installation - see ''[http://lythgoes.net/genealogy/software.php The Next Generation of Genealogy Sitebuilding]''
# A backup of your TNG newacctform.php and suggest.php files
+
# A backup of your TNG newacctform.php and suggest.php file, and the text.php file for each of your supported languages
  
  
 
==Side Effects==
 
==Side Effects==
  
# As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod.
+
# As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod. However, it is only a single line addition to each of the files.
#* Since I am using this mod, and stay current with TNG, I would expect that updated mods would be available quickly. Of course that's not much of a guarantee coming from a volunteer.
+
#* A French and Spanish translation has been provided courtesy of '''Francis Amar'''. ''(Francis may be contacted via the TNG user list)''.  
# The default version does not support alternate languages, ''it has been implemented as a single Language only''. The default file is English.
+
#* A Dutch translation has been provided courtesy of '''Martien van Balgooi'''. ''(Martien may be contacted via the TNG user list)''.  
#* A French and Spanish translation file has been provided courtesy of '''Francis Amar'''. ''(Francis may be contacted via the TNG user list)''.  
+
#* A Dutch translation file has been provided courtesy of '''Martien van Balgooi'''. ''(Martien may be contacted via the TNG user list)''.  
+
  
  
Line 45: Line 33:
 
The following zip file contains the necessary files to allow the addition of this feature.
 
The following zip file contains the necessary files to allow the addition of this feature.
  
* The zip file [[Media:TNG_captcha_Rev_2.3.zip|TNG_captcha_Rev_2.3.zip]] contains:
+
* The zip file [[Media:TNG_captcha_Rev_3.zip|TNG_captcha_Rev_3.zip]] contains:
 
** the "freecap" fonts, backgrounds, dictionary, and freecap.php file
 
** the "freecap" fonts, backgrounds, dictionary, and freecap.php file
** newacctform.php - <font color="red">a modified TNG 5.1.4 file</font>  
+
** newacctform_captcha.php - <font color="red">a modified TNG 5.1.4 file</font>  
** suggest.php - <font color="red">a modified TNG 5.1.4 file</font>  
+
** suggest_captcha.php - <font color="red">a modified TNG 5.1.4 file</font>  
** newacctform_french.php - alternate language version
+
** TNG_captcha.php - the TNG captcha wrapper
** newacctform_spanish.php - alternate language version
+
** captcha_text_english.php - alternate language version
** newacctform_dutch.php - alternate language version  
+
** captcha_text_french.php - alternate language version
** suggest_french.php - alternate language version  
+
** captcha_text_spanish.php - alternate language version
** suggest_spanish.php - alternate language version  
+
** captcha_text_dutch.php - alternate language version
** suggest_dutch.php - alternate language version  
+
  
  
Line 62: Line 49:
  
 
# backup your existing TNG v5.1.4 newacctform.php and suggest.php file
 
# backup your existing TNG v5.1.4 newacctform.php and suggest.php file
# download this zip ([[Media:TNG_captcha_Rev_2.3.zip|TNG_captcha_Rev_2.3.zip]])
+
# download this zip ([[Media:TNG_captcha_Rev_3.zip|TNG_captcha_Rev_3.zip]])
 
# unzip it, examine the contents
 
# unzip it, examine the contents
# create a "freecap" folder in the main TNG directory
+
# create a "freecap" folder in the main TNG folder
 
#* make sure it is readable and executable by all
 
#* make sure it is readable and executable by all
 
# copy all the ".ht****" files and the freecap.php file to the new "freecap" folder
 
# copy all the ".ht****" files and the freecap.php file to the new "freecap" folder
 
#* ensure they are all readable
 
#* 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.
 
#* 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.
 +
# copy your desired language files to your language folder.
 +
#* for example, copy the captch_text_english.php to the ./English folder
 +
# 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_english.php");
 +
#* or if adding it in the french language folder  @include("captcha_text_french.php");
 +
# copy the TNG_captcha.php file to the base TNG folder
 
# 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
 
# 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
#* Alternate language versions may be selected, renamed, and used instead of the default english file
 
 
# check it out
 
# check it out
  
  
* '''IF you are NOT running v5.1.4 or you HAVE made changes to newacctform.php then''', you are on your own.  The file is completely different from the TNG 5.1.4 version. The modifications are significant. If you are not completely comfortable doing this sort of update, then try upgrading to TNG v5.1.4 first.
+
* '''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
  
  
Line 83: Line 80:
 
#* all should be well now
 
#* all should be well now
 
# you may also delete the "freecap" folder and files
 
# you may also delete the "freecap" folder and files
 
 
 
==Alternate Language - French/Spanish/Dutch==
 
 
At this time, the account request form has been coded in a single language.  By default, the newacctform.php file has been provided in English.  If you wish to convert this to either French,  Spanish, or Dutch:
 
 
# extract the newacctform or suggest french/spanish/dutch.php from the zip file
 
# rename the file to remove the language type
 
# resultant file names must be  newacctform.php  or  suggest.php
 
# copy the replacement language file to your base TNG directory
 
  
  
Line 106: Line 92:
 
=Acknowledgements=
 
=Acknowledgements=
  
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 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, and Darrin's suggestion to create a single line include version in preparation for TNG v6.
 
* '''A special thanks goes out to Francis Amar who provided the French and Spanish translations.'''
 
* '''A special thanks goes out to Francis Amar who provided the French and Spanish translations.'''
 
* '''A special thanks goes out to Martien van Balgooi who provided the Dutch translation.'''
 
* '''A special thanks goes out to Martien van Balgooi who provided the Dutch translation.'''

Revision as of 20:06, 26 July 2006

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


Overview

This TNG modification provides a CAPTCHA for the TNG "New User Registration" form and/or the TNG "Suggest" form. It will provide a user challenge screen before the form will be made available.

This implementation is based upon PureMango's code version 1.41. Check the link for a demo of how it works. The original package from PureMango contains an additional php wrapper file that provides the demo example.


Rev 3 Jul 26, 2006 - Rewritten as a single line modification of the TNG files. Multi-language support including: English, French, Spanish, and Dutch. This version requires only a single line change to the original TNG files allowing for easy migration to the next TNG version.


Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG newacctform.php and suggest.php file, and the text.php file for each of your supported languages


Side Effects

  1. As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod. However, it is only a single line addition to each of the files.
    • A French and Spanish translation has been provided courtesy of Francis Amar. (Francis may be contacted via the TNG user list).
    • A Dutch translation has been provided courtesy of Martien van Balgooi. (Martien may be contacted via the TNG user list).


TNG Modifications

The following zip file contains the necessary files to allow the addition of this feature.

  • The zip file TNG_captcha_Rev_3.zip contains:
    • the "freecap" fonts, backgrounds, dictionary, and freecap.php file
    • newacctform_captcha.php - a modified TNG 5.1.4 file
    • suggest_captcha.php - a modified TNG 5.1.4 file
    • TNG_captcha.php - the TNG captcha wrapper
    • captcha_text_english.php - alternate language version
    • captcha_text_french.php - alternate language version
    • captcha_text_spanish.php - alternate language version
    • captcha_text_dutch.php - alternate language version


  • IF you are running v 5.1.4 then

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.zip)
  3. unzip it, examine the contents
  4. create a "freecap" folder in the main TNG folder
    • make sure it is readable and executable by all
  5. copy all the ".ht****" files and the freecap.php file to 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 your desired language files to your language folder.
    • for example, copy the captch_text_english.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_english.php");
    • or if adding it in the french language folder @include("captcha_text_french.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


  • 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


  • In the event of a problem with your TNG site
  1. copy your backup newacctform.php and/or suggest.php to your base TNG directory
    • all should be well now
  2. you may also delete the "freecap" folder and files


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


Acknowledgements

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, and Darrin's suggestion to create a single line include version in preparation for TNG v6.

  • A special thanks goes out to Francis Amar who provided the French and Spanish translations.
  • A special thanks goes out to Martien van Balgooi who provided the Dutch translation.