About GeoInfo

GeoInfo is a small module that Implements Geoplugin PHP web service.Please donate to "geoplugin.com" in order to keep the service alive. The Module ads two methods to retrieve data from the web service.

Category 1Development Tools
Modules that have more to do with assisting development of a site rather than managing its content.
Category 2Other Modules
Modules that have a unique purpose not covered by existing categories.
Release StateBeta
Close to stable, but users are advised to be cautious and test thoroughly.*
Authorpmichaelis
Module Version1
Class NameGeoInfo
Compatibility2.5, 2.6, 2.7
Date AddedFebruary 10, 2015
Last UpdatedFebruary 19, 2015
Recommended ByNew recommendations may take up to 1 day to appear.

Details

Processwire GeoInfo

GeoInfo is a small module that Implements Geoplugin PHP web service.
Please donate to "geoplugin.com" in order to keep the service alive.

Instructions

The Module ads two methods to retrieve data from the web service.

$page->GeoInfoIP('IP ADDRESS');

you can enter the ip address manually. If left blank the server remote address will be used.
The retrieved data is then stored to the active session, in order to limit the requests.
The web service gives back following data.

'geoplugin_request'
'geoplugin_status'
'geoplugin_credit'
'geoplugin_city'
'geoplugin_region'
'geoplugin_areaCode'
'geoplugin_dmaCode'
'geoplugin_countryCode'
'geoplugin_countryName'
'geoplugin_continentCode'
'geoplugin_latitude'
'geoplugin_longitude'
'geoplugin_regionCode'
'geoplugin_regionName'
'geoplugin_currencyCode'
'geoplugin_currencySymbol'
'geoplugin_currencySymbol_UTF8'
'geoplugin_currencyConverter'

for e.g. $page->GeoInfoIP('IP ADDRESS')->geoplugin_countryCode; will give back the country iso code.

$page->GeoInfoLatLong('LAT', 'LONG');

Enter Latitude and Longitude in order to get following information:

'geoplugin_place'
'geoplugin_countryCode'
'geoplugin_region'
'geoplugin_regionAbbreviated'
'geoplugin_latitude'
'geoplugin_longitude'
'geoplugin_distanceMiles'
'geoplugin_distanceKilometers'

for e.g. $page->GeoInfoLatLong('40.712784', '-74.005941'); will give back the city name "New York City".

Comments

  • Tom

    Tom 2 years ago 00

    There's a problem with the version number -- Version "1" doesn't conform with the (new?) n.n.n (1.0.0) versioning scheme. at least in PW 3.n this triggers an "an update is availalbe" message in Setup/upgrade: (installed: 0.0.1, available 1) - if you run the update, you'll end up exactly with the same message.

    • Philipp

      Philipp 2 years ago 00

      Hey,
      thanks for the comment. I changed the version umber from 1 to 100.
      Does that work for you?

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.