Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.2
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

spf_if_eu

A conditional container tag to serve content to EU visitors only (e.g. a cookie-prompt: see usage notes below) or non-EU visitors (via <txp:else />) tag.

Update (May 2016) – use oui_cookie, it’s much better.

Installation:

  1. DOWNLOAD and unzip.
  2. Upload the ‘geoip’ directory to your web root.
  3. Install and activate this plugin – spf_if_eu.txt.

Usage:

  1. The plugin is intended to be used on page templates (e.g. to serve a cookie prompt such as cPrompt or my forked version – but can also be used in articles and forms.
  2. Content within <txp:spf_if_eu> ... </txp:spf_if_eu> tags will only be served to visitors from the EU.
  3. The <txp:else /> tag can also be used to serve content only to non-EU visitors.

Notes:

  1. Country detection is via MaxMind’s GeoIP database – it (very occasionally) makes errors.
  2. Not tested on Texpattern < 4.4.1 and PHP < 5.

Version history

0.2 – 26 August 2012

  • Optimised (thanks Jukka).

0.1 – June 2012

  • First release.

Article Request Count:
Keywords/tags:
Initially released:
June 2012
Posted here:
09 Jun 2012
Article modified:
28 May 2016

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (1)

Content for European Union users of just for Europeans? :-)

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern