From ddea5e4d31a6e54b4c14a074ac8ef6dc4f3ce922 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Dec 2023 15:53:23 +0100 Subject: [PATCH 1/3] also calc distance for gridlines/-corners and embed in tweet --- application/views/view_log/qso.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index e5c805e6..179a3756 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -152,6 +152,23 @@ Gridsquare (Multi): COL_VUCC_GRIDS; ?> + qra->distance($row->station_gridsquare, $row->COL_VUCC_GRIDS, $measurement_base); + + switch ($measurement_base) { + case 'M': + $distance .= " mi"; + break; + case 'K': + $distance .= " km"; + break; + case 'N': + $distance .= " nmi"; + break; + } + echo $distance; + ?> @@ -408,7 +425,17 @@ if ($row->COL_DXCC != 0) { $twitter_string .= urlencode("in ".ucwords(strtolower(($row->COL_COUNTRY)))." "); } - $twitter_string .= urlencode("(Gridsquare: ".$row->COL_GRIDSQUARE." / distance: ".$distance.") on ".$twitter_band_sat." using ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)." ".$hashtags); + $distancestring = ''; + if ($row->COL_VUCC_GRIDS == null) { + $distancestring = "(Gridsquare: ".$row->COL_GRIDSQUARE." / distance: ".$distance.")"; + } else { + if (substr_count($row->COL_VUCC_GRIDS, ',') == 1) { + $distancestring = "(Gridline: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; + } else if (substr_count($row->COL_VUCC_GRIDS, ',') == 3) { + $distancestring = "(Gridcorner: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; + } + } + $twitter_string .= urlencode($distancestring." on ".$twitter_band_sat." using ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)." ".$hashtags); } ?> From 7984b41538c2c2096d712f24121bd6dcd3f113ac Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Dec 2023 15:56:37 +0100 Subject: [PATCH 2/3] Cover fall through --- application/views/view_log/qso.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 179a3756..c1a8ace0 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -433,6 +433,8 @@ $distancestring = "(Gridline: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; } else if (substr_count($row->COL_VUCC_GRIDS, ',') == 3) { $distancestring = "(Gridcorner: ".$row->COL_VUCC_GRIDS." / distance: ".$distance.")"; + } else { + $distancestring = "(Grids: ".$row->COL_VUCC_GRIDS.")"; } } $twitter_string .= urlencode($distancestring." on ".$twitter_band_sat." using ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)." ".$hashtags); From b7f4efa33f37d1fd037ac4139a2353335a9e6ff7 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 19 Dec 2023 16:00:55 +0100 Subject: [PATCH 3/3] Add SAT emoji to Tweet --- application/views/view_log/qso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index c1a8ace0..395b743e 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -396,7 +396,7 @@ COL_SAT_NAME != null) { - $twitter_band_sat = $row->COL_SAT_NAME; + $twitter_band_sat = $row->COL_SAT_NAME." \u{1F6F0}\u{FE0F}"; $hashtags = "#hamr #cloudlog #amsat"; } else { $twitter_band_sat = $row->COL_BAND;