Difference between revisions of "Google reCAPTCHA"

From WHMCS Documentation

m
m
Line 7: Line 7:
 
To make the reCAPTCHA widget display a different theme, you first need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears. WHMCS would recommend placing this in the header.tpl file of your template just before the </head> tag.
 
To make the reCAPTCHA widget display a different theme, you first need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears. WHMCS would recommend placing this in the header.tpl file of your template just before the </head> tag.
  
<nowiki>{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
+
<source lang="php">
 +
{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 
  var RecaptchaOptions = {
 
  var RecaptchaOptions = {
 
     theme : 'theme_name'
 
     theme : 'theme_name'
 
  };
 
  };
 
  </script>{/literal}{/if}
 
  </script>{/literal}{/if}
</nowiki>
+
</source>
  
 
The 'theme_name' can be one of four pre-defined options
 
The 'theme_name' can be one of four pre-defined options
Line 29: Line 30:
 
By default, the language of the reCAPTCHA is English, however this can be customised to English (en), Dutch (nl), French (fr), German (de), Portuguese (pt), Russian (ru), Spanish (es) or Turkish (tr).  To change the language, you need to add some javascript to define the language to your templates.  This should be added to the pages you are using with captcha verification. To allow for multi-language environments, a language file variable is used to define the language:
 
By default, the language of the reCAPTCHA is English, however this can be customised to English (en), Dutch (nl), French (fr), German (de), Portuguese (pt), Russian (ru), Spanish (es) or Turkish (tr).  To change the language, you need to add some javascript to define the language to your templates.  This should be added to the pages you are using with captcha verification. To allow for multi-language environments, a language file variable is used to define the language:
  
<nowiki>{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
+
<source lang="php">
 +
{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 
  var RecaptchaOptions = {
 
  var RecaptchaOptions = {
 
     theme : 'theme_name',
 
     theme : 'theme_name',
Line 35: Line 37:
 
  };
 
  };
 
  </script>{/literal}{/if}
 
  </script>{/literal}{/if}
</nowiki>
+
</source>
  
 
If your language is not one supported by Google, you are able to create your own translations. More information on this at [http://code.google.com/apis/recaptcha/docs/customization.html#i18n i18n]
 
If your language is not one supported by Google, you are able to create your own translations. More information on this at [http://code.google.com/apis/recaptcha/docs/customization.html#i18n i18n]

Revision as of 20:11, 11 August 2014

The following information is taken in part from here

Customizing the Look and Feel of reCAPTCHA

Theme

To make the reCAPTCHA widget display a different theme, you first need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears. WHMCS would recommend placing this in the header.tpl file of your template just before the </head> tag.

{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'theme_name'
 };
 </script>{/literal}{/if}

The 'theme_name' can be one of four pre-defined options

If you do not wish to use any of the default themes, you can create your own to match your site design. You can see how to do this @ Custom Theme. To use a custom theme, the theme variable must be set to 'custom'.

Language

By default, the language of the reCAPTCHA is English, however this can be customised to English (en), Dutch (nl), French (fr), German (de), Portuguese (pt), Russian (ru), Spanish (es) or Turkish (tr). To change the language, you need to add some javascript to define the language to your templates. This should be added to the pages you are using with captcha verification. To allow for multi-language environments, a language file variable is used to define the language:

{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'theme_name',
    lang: '{/literal}{$LANG.isocode}{literal}'
 };
 </script>{/literal}{/if}

If your language is not one supported by Google, you are able to create your own translations. More information on this at i18n