Skip to content
a Textpattern plugin to display content only to visitors from the EU
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
geoip
src
README.textile
instructions.txt
spf_if_eu.txt

README.textile

spf_if_eu

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.

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 it 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 to non-EU visitors only:

<txp:spf_if_eu>

… content for EU visitors

<txp:else />

… content for non-EU visitors

</txp:spf_if_eu>

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.
Something went wrong with that request. Please try again.