Author:
wjnielsen
Version:
1.0
Release Date:
23 Oct 2009
Category:
Third-Party Integration

Description

A utility dependent upon Alistair’s reCaptcha Extension which allows for utilizing reCaptcha Themes and setting a tabindex attribute value.

XSLT

View Raw
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
About:
============
Author: Will Nielsen
Version: 1.0
Date: 23 October 2009
Email: will@nielsendigital.com
Web: http://nielsendigital.com

Instructions:
=============
 1. Download and install the reCaptcha Extension (http://github.com/pointybeard/recaptcha/tree)
 2. Create a utility which includes this code
 3. Import that utility (e.g., <xsl:import href="../utilities/get-recaptcha.xsl" /> into the templates you wish to use.
 4. Call the template "recaptcha-field" with optional params in place of Step #8 in the reCaptcha Extension 1.0 README

Params
=============
tabindex: integer value (default: 10)
theme: string red | white (default) | blackglass | clean | custom


 -->


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template name="recaptcha-field">
	<xsl:param name="tabindex" select="'10'" />
	<xsl:param name="theme" select="'white'" />
		<div id="recaptcha" >
			<xsl:if test="/data/events/register/filter/@name = 'recaptcha'" >
				<xsl:attribute name="class">correction</xsl:attribute>
			</xsl:if>
			<h4>Challenge Words (verifying you are a human being not a computer)</h4>
			<script type="text/javascript">
				var RecaptchaOptions = {
				theme : '<xsl:value-of select="$theme"/>',
				tabindex : <xsl:value-of select="$tabindex"/>
				};				
		    </script>
			<script type="text/javascript"
				src="http://api.recaptcha.net/challenge?k={/data/recaptcha}"></script>
		</div>
	</xsl:template>
</xsl:stylesheet>

Discuss this XSLT Utility

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details