Code Monkey home page Code Monkey logo

freegeoip's Introduction

------------------------
FREEGEOIP MODULE README
------------------------

The FreeGeoIP module is intended to enable the site developers find out the location of a visiting user. Site developers then can use this information and tweak the site functionality per region if required.
For e.g. Want to show different content at a time on site for a user in United States as compared to that of a user in India.

------------------------
INSTALLATION
------------------------
1. Download the module and place it with other contributed modules
   (e.g. sites/all/modules/).

2. Enable the FreeGeoIP module on the Modules list page. Appropriate
   tables will be created in the background.

3. Modify permissions on the People >> Permissions page.

4. Go to admin/config/services/freegeoip, and change the FreeGeoIP URL if required, i.e. if you have Redis server installed at your end.

5. Also change the Default Country if required.

6. Click Save configuration.

------------------------
INSTRUCTIONS FOR DEVELOPERS
------------------------
FreeGeoIP contacts the Redis server to find out the location from which a user is coming. This happens with the help of a http request implemented in the implementation of hook_boot(). in the module. This data is saved in the session variable. The variable can be accessed as

$_SESSION['freegeoip'];

which is an array of the format :

array(
  'ip' => '',
  'country_code' => '',
  'country_name' => '',
  'region_code' => '',
  'region_name' => '',
  'city' => '',
  'zipcode' => '',
  'latitude' => '',
  'longitude' => '',
  'metro_code' => '',
  'area_code' => '',
)

freegeoip's People

Watchers

James Cloos avatar Nitesh Sethia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.