From 70949df3b3c9125c69cc95994735b7ce2fedbe5d Mon Sep 17 00:00:00 2001 From: dmorley Date: Wed, 11 Jan 2017 19:47:35 -0500 Subject: [PATCH] move n/a to view --- db/pull.php | 10 +++++----- show.php | 4 ++-- showfull.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db/pull.php b/db/pull.php index be8e23c..9c1a558 100644 --- a/db/pull.php +++ b/db/pull.php @@ -240,11 +240,11 @@ while ($row = pg_fetch_all($result)) { echo '
'; } if ($location) { - $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']) : "n/a"; - $state = isset($location['region']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['region']) : "n/a"; - $lat = isset($location['latitude']) ? $location['latitude']: "n/a"; - $long = isset($location['longitude']) ? $location['longitude'] : "n/a"; + $country = isset($location['country_code']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['country_code']) : null; + $city = isset($location['city']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['city']) : null; + $state = isset($location['region']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['region']) : null; + $lat = isset($location['latitude']) ? $location['latitude']: null; + $long = isset($location['longitude']) ? $location['longitude'] : null; //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) { $lat = $lat + (rand(1, 15) / 10); diff --git a/show.php b/show.php index a72fba6..599580b 100644 --- a/show.php +++ b/show.php @@ -56,9 +56,9 @@ $numrows = pg_num_rows($result); echo '' . $row['uptimelast7'] . '%'; echo '' . $row['active_users_halfyear'] . ''; if ($country_code === $row['country']) { - echo '' . $row['country'] . ''; + echo '' . $row['country'] . ''; } else { - echo '' . $row['country'] . ''; + echo '' . $row['country'] . ''; } echo ''; $row['service_facebook'] === 't' && print ''; diff --git a/showfull.php b/showfull.php index 7f14606..0899324 100644 --- a/showfull.php +++ b/showfull.php @@ -96,9 +96,9 @@ $numrows = pg_num_rows($result); echo ''; echo '' . $row['score'] . '/100'; if ($country_code === $row['country']) { - echo '' . $row['country'] . ''; + echo '' . $row['country'] . ''; } else { - echo '' . $row['country'] . ''; + echo '' . $row['country'] . ''; } echo ''; -- GitLab