DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: GeoIP Libraries

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Markus Friedrich
Changed:2008-11-24T16:53:27
Author:Markus Friedrich
Email:markus.friedrich(at)dkd.de
Info 3:
Info 4:

EXT: GeoIP Libraries

Extension Key: ml_geoip

Copyright 2006-2008, Markus Friedrich, <markus.friedrich(at)dkd.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: Single Sign On 1

Introduction 1

What does it do? 1

Adminstration 2

Change log 2

Introduction

What does it do?

GeoIP Libraries (ml_geoip) provides the services of MaxMinds free libraries and additional flag icons. It can be used by extension developers to find out the geographical location of ip addresses.

Administration

Installation

The extension GeoIP Libraries uses the MaxMind libraries, before you can use the extension you have to import this libraries. The url from which the libraries should be downloaded is defined via the extension manager. By default the url “ http://geolite.maxmind.com/download/geoip/database/tmp/GeoIP.dat.gz ” is set.

To import a new version use the “UPDATE” method of the extension manager.

Function Reference

GeoIP Libraries currently provides this functions:

  • getCountryIdByAddress($ip)Gets the country id by given ip address
  • getCountryCodeByAddress($ip)Gets the country code by given ip address
  • getCountryNameByAddress($ip)Gets the country name by given ip address
  • getCountryIdByName($address)Gets the country id by given internet address e.g. www.dkd.de
  • getCountryCodeByName($address)Gets the country code by given internet address e.g. www.dkd.de
  • getCountryNameByName($address)Gets the country name by given internet address e.g. www.dkd.de
  • getCountryFlagByAddress($ip, $useHtml = false, $backendLink = false)Get the according flag to a certain country:=> ip – ip address=> useHTML – the filename is surrounded by a html img tag=> backendLink – the img path is prepared for typo3 backend use
  • getCountryFlagByCode($code, $useHtml = false, $backendLink = false)Get the according flag to a certain country=> code – country code (2-digit iso code)=> useHTML – the filename is surrounded by a html img tag=> backendLink – the img path is prepared for typo3 backend use

How to use ml_geoip

To use the functions of GeoIP Libraries you have to include the class file

require_once(t3lib_extMgm::extPath('ml_geoip').'class.tx_mlgeoip.p hp');

The next step is to make an instance of the class “tx_mlgeoip”

$geoip = t3lib_div::makeInstance('tx_mlgeoip');

Now you can use the functions, e.g.

$geoip->getCountryCodeByAddress($ip);

Change log

Version 0.1.3:

  • updated contact information
  • updated library source
  • minor changes according to the typo3 coding guidelines

Version 0.1.2:

geoip libraries updated

Version 0.1.1:

geoip libraries updated

Version 0.1.0:

Initial release

img-1 EXT: GeoIP Libraries - 3