The methods of this class can be used for storing and retrieving location of both authenticated and anonymous users.
Simple usage with GeoPlugin IP address geocoding works like the following:
$_SERVER['REMOTE_ADDR']);
$user_location = $geocoder->geocode($location_parameters);
if (!is_null($user_location))
{
// Store geocoded location to session or user's location log
org_routamc_positioning_user::set_location($user_location);
}
}
if (!is_null($user_location))
{
echo sprintf('You\'re in %s, %s', $user_location['latitude'], $user_location['longitude']);
// Will print "You're in 60.2345, 25.00456"
}
?>
package | org.routamc.positioning |
---|