A conditional container tag for Textpattern.
Serve content to EU visitors only (e.g. a cookie-prompt: see usage notes below) or non-EU visitors (via
<txp:else />) tag.
Latest version: spf_if_eu GitHub repository.
- DOWNLOAD and unzip.
- Upload the ‘geoip’ directory to your web root.
- Install and activate this plugin – spf_if_eu.txt.
- 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 it can also be used in articles and forms.
- Content within
<txp:spf_if_eu> ... </txp:spf_if_eu>tags will only be served to visitors from the EU.
<txp:else />tag can also be used to serve content to non-EU visitors only:
… content for EU visitors
… content for non-EU visitors
- Country detection is via MaxMind’s GeoIP database – it (very occasionally) makes errors.
- Not tested on Texpattern < 4.4.1 and PHP < 5.
0.2 – 26 August 2012
- Optimised (thanks Jukka).
0.1 – June 2012
- First release.