function getdirections_smart_ip in Get Directions 7.2
Same name and namespace in other branches
- 7.3 getdirections.module \getdirections_smart_ip()
Return value
Returns location array
1 string reference to 'getdirections_smart_ip'
- getdirections_menu in ./
getdirections.module - Implement hook_menu().
File
- ./
getdirections.module, line 1887 - Fetches google map directions.
Code
function getdirections_smart_ip() {
if (module_exists('smart_ip')) {
global $user;
$location = FALSE;
if ($user->uid > 0 && isset($user->data['geoip_location'])) {
$location = $user->data['geoip_location'];
}
elseif (isset($_SESSION['smart_ip']['location'])) {
$location = $_SESSION['smart_ip']['location'];
}
drupal_json_output($location);
}
exit;
}