region

UNIX name Owner Status
region eZ Publish Legacy stable
Version Compatible with
N/A N/A
A fork of http://projects.ez.no/region - an eZ Publish geo-location extension.

REGION EXTENSION

Region extension

Original Author: Bj?rn Dieding, http://www.xrow.com
Additions by: Geoff Bentley, Serhey Dolgushev

The region extension redirects a user to a siteaccess based on his ip address.
This can be done in the background (the ip address is checked in the database)
automatically, or the user can choose a country siteaccess in a specific
pagelayout.

This extension includes GeoLite data created by MaxMind, available from
http://maxmind.com/

The geo ip database is taken from
http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip

Project Homepage:
http://projects.ez.no/region

When geo-detection is triggered

Geo-detection is triggered when a user requests the home page or a non-region-specific URL (e.g /verve).

How the geo-detection works

In order to serve up a siteaccess, the region extension must formulate a region via a country code and a language.

  1. Country code
    • GET variable 'TESTIP' (IP address) or 'country' (2-char country code)
    • it will first try to find a preferred region by looking up the user's IP address in a MaxMind Geo-lite database
      (sucked into MySQL DB tables)
  2. Language
    • GET variable 'lang' (containing 3-char language code)
    • Browser languages

It formulates the region in the following order:

  1. Exact match of region (language + country code) in list of available regions ("LanguageSA" under "RegionalSettings" in site.ini)
  2. First item in above list with a country match
  3. First item in above list with a language match
  4. First item in above list

Setup

  • install extension
  • run php bin/php/ezpgenerateautoloads.php
  • activate the extension in your site.ini.append
  • edit settings/region.ini
  • clear ini cache

Template operators

{in_region('my-region')}

  • Works with the RegionCountryList setting in region.ini, under [Regions].
  • returns true if the user's country is listed in the specified RegionCountryList e.g RegionCountryList[my-region]
  • otherwise returns false
  • works with 'TESTIP' and 'country' GET variables listed above, for testing purposes

?>

No news yet.

This project has no reviews yet. Be the first one to review it!

No forum messages yet.