Unverified Commit cacff7a8 authored by dmorley's avatar dmorley
Browse files

put n/a if location data is missing

parent f8a71171
...@@ -240,11 +240,11 @@ while ($row = pg_fetch_all($result)) { ...@@ -240,11 +240,11 @@ while ($row = pg_fetch_all($result)) {
echo '<br>'; echo '<br>';
} }
if ($location) { if ($location) {
$country = $location['country_code']; $country = isset($location['country_code']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['country_code']) : "n/a";
$city = isset($location['city']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['city']) : null; $city = isset($location['city']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['city']) : "n/a";
$state = isset($location['region']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['region']) : null; $state = isset($location['region']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['region']) : "n/a";
$lat = $location['latitude']; $lat = isset($location['latitude']) ? $location['latitude']: "n/a";
$long = $location['longitude']; $long = isset($location['longitude']) ? $location['longitude'] : "n/a";
//if lat and long are just a generic country with no detail lets make some tail up or openmap just stacks them all on top another //if lat and long are just a generic country with no detail lets make some tail up or openmap just stacks them all on top another
if (strlen($lat) < 4) { if (strlen($lat) < 4) {
$lat = $lat + (rand(1, 15) / 10); $lat = $lat + (rand(1, 15) / 10);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment