From c846dd178a382ba4b00af96a7d42cc5cd194e513 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Tue, 9 Aug 2022 19:20:36 +0000 Subject: [PATCH] Add distance to tweet if QRA-locator is set, distance is calculated and added with value to tweet --- application/views/view_log/qso.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 5062032b..bc920699 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -112,19 +112,20 @@ $CI->load->library('qra'); // Cacluate Distance - echo $CI->qra->distance($row->station_gridsquare, $row->COL_GRIDSQUARE, $measurement_base); + $distance = $CI->qra->distance($row->station_gridsquare, $row->COL_GRIDSQUARE, $measurement_base); switch ($measurement_base) { case 'M': - echo "mi"; + $distance .= "mi"; break; case 'K': - echo "km"; + $distance .= "km"; break; case 'N': - echo "nmi"; + $distance .= "nmi"; break; } + echo $distance; ?> @@ -295,8 +296,9 @@ $twitter_band_sat = $row->COL_BAND; $hashtags = "#hamr #cloudlog"; } - - $twitter_string = urlencode("Just worked ".$row->COL_CALL." in ".ucwords(strtolower(($row->COL_COUNTRY)))." (Gridsquare: ".$row->COL_GRIDSQUARE.") on ".$twitter_band_sat." using ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)." ".$hashtags); + if (!isset($distance)) + $distance = ""; + $twitter_string = urlencode("Just worked ".$row->COL_CALL." in ".ucwords(strtolower(($row->COL_COUNTRY)))." (Gridsquare: ".$row->COL_GRIDSQUARE." / distance: ".$distance.") on ".$twitter_band_sat." using ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)." ".$hashtags); ?>