You are here

function geoip_country_name_by_addr in Smart IP 7.2

Same name and namespace in other branches
  1. 6.2 includes/geoip.inc \geoip_country_name_by_addr()

File

includes/geoip.inc, line 568

Code

function geoip_country_name_by_addr($gi, $addr) {
  if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
    $record = geoip_record_by_addr($gi, $addr);
    return $record->country_name;
  }
  else {
    $country_id = geoip_country_id_by_addr($gi, $addr);
    if ($country_id !== false) {
      return $gi->GEOIP_COUNTRY_NAMES[$country_id];
    }
  }
  return false;
}