Add distance to tweet

if QRA-locator is set, distance is calculated and added with value to tweet
pull/1553/head
Kim Huebel 2022-08-09 19:20:36 +00:00
rodzic c33c8e7153
commit c846dd178a
1 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -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;
?>
</td>
</tr>
@ -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);
?>
<div class="text-right"><a class="btn btn-sm btn-primary twitter-share-button" target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo $twitter_string; ?>"><i class="fab fa-twitter"></i> Tweet</a></div>