Tuesday, December 13, 2011

My answer to "how GEO location is working flow of the geo location"

This is my answer to a Question on Support site for LampCMS project


First read and follow instructions in geo_import.php file in the www directory.

The location of user is resolved during the post of new question or answer and stored with the answer or question, in the same collection, in the same record.

Also location of user is stored during the registration process in the USERS collection, and during the normal operation of a site, if the "whos online" module is enabled in !config.ini, then it is also stored in the ONLINE collection.

You can then use this data in your custom module to display the locations of users. For example you can create a page with Google maps showing currently logged in users on the map or you can show a map on the View Question page showing locations of where the answers came from.

Or you can just edit template to display country name and city.

The extra fields added to collections to represent locations are:

'cc' = country code like US
'cn' = country name like "India"
'city' = city
'lat' = latitude
'lon' = longitude

Not all fields will have data, some locations may have only cc and cn and no city. Most of the time all the fields will be present.


No comments:

Post a Comment