Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Extensions / Mobile & Geolocation / SxGeoIP integration

Integration of SxGeo IP base (geo names supplied in Russian). This DB contains Geo coordinates related to user IP-address. SxGeoIP created, developed and maintained by and distributed under BSD licence.

SxGeoIP base

Extension for Cotonti CMF. Integration of SxGeo IP base (geo names supplied in Russian)

#1. Description

Integration of SxGeoIP database in Cotonti CMF. This DB contains Geo coordinates related to user IP-address. SxGeoIP created, developed and maintained by and distributed under BSD licence.

#2. Features

  • Fast query speed
  • Country and city detection
  • Good data cover for ex-USSR area
  • All cities names in russian locale

#3. Disadvantages

  • last update dated srping 2013

#4. Demo page

You can view demo page at site.

#5. Requirements

Current version requires Cotonti Siena v0.9.x and newer.


Plugin works out from the box. For better results check config settings in admin panel.

#5.2. How extension works

Extension use GeoIP data packed in SxGeoIP format files. Country and city info stored in separate files. More info about SxGeoIP format you can find on

#6. Install

  • Unpack, copy files to root folder of your site.
  • Install via Admin → Extensions menu (Administration panel → Extensions)
  • Checks setting in config (Administration panel → Extensions → sxgeo → Configuration).

#6.1. Usage

You can use this extension data in 2 ways:

  1. Through functions call for sx_getCity($ip) and sx_getCountry($ip). These functions return string with Country and City name respectively. You can ommit IP address. In this case you get info according to current user info.


Important notes! Country names are always geted in current Cotonti locale (user selected language), according to countries.*.lang.php file. City names are returned by plugin always in russian (as it sored in SxGeoIP DB).

  1. You can turn on Auto initialization mode, so you can use direct values for current user country and city info.

    Data format:

    * Contains data for country code and id from last sx_getCountry*() call.
    $sx_country = array(
        'iso' => '', // ISO 3166-1 code in appear case
        'name' => '', // Country name with Cotonti locale as defined in countries.*.lang.php file
        'id'  => 0 // Country ID used in SxGeoIP base

    * Contains info about city from last sx_getCity*() call.
    $sx_city = array(
        'info' => array(),  // basic info, see sx_getCity() function for details
        'ext_info' => array() //extended info, see sx_getCityExt() function for details

Use this calls in TPL:
city - {}
country - {}

#7. Licence

Distributed under BSD license.

#8. Author

Andrey Matsovkin - author of Cotonti extension. All other rights belongs to as DB creator.

#9. References

1. Uch  2013-11-11 10:39

Thanks: 0

Добавил файл для comments.loop и стало просто замечательно :)

Total: 1, on page: 1

Only registered users can post new comments