You are here

function getlocations_fields_smart_ip_get in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_fields/getlocations_fields.functions.inc \getlocations_fields_smart_ip_get()

Return value

Returns location array

2 calls to getlocations_fields_smart_ip_get()
getlocations_fields_getmap in modules/getlocations_fields/getlocations_fields.module
input map
getlocations_fields_smart_ip in modules/getlocations_fields/getlocations_fields.functions.inc

File

modules/getlocations_fields/getlocations_fields.functions.inc, line 526
getlocations_fields.functions.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_fields_smart_ip_get() {
  $location = FALSE;
  if (module_exists('smart_ip')) {
    global $user;
    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'];
    }
  }
  return $location;
}