Add distance to tweet

if QRA-locator is set, distance is calculated and added with value to tweet
这个提交包含在:
Kim Huebel 2022-08-09 19:20:36 +00:00
父节点 c33c8e7153
当前提交 c846dd178a

查看文件

@ -112,19 +112,20 @@
$CI->load->library('qra'); $CI->load->library('qra');
// Cacluate Distance // 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) { switch ($measurement_base) {
case 'M': case 'M':
echo "mi"; $distance .= "mi";
break; break;
case 'K': case 'K':
echo "km"; $distance .= "km";
break; break;
case 'N': case 'N':
echo "nmi"; $distance .= "nmi";
break; break;
} }
echo $distance;
?> ?>
</td> </td>
</tr> </tr>
@ -295,8 +296,9 @@
$twitter_band_sat = $row->COL_BAND; $twitter_band_sat = $row->COL_BAND;
$hashtags = "#hamr #cloudlog"; $hashtags = "#hamr #cloudlog";
} }
if (!isset($distance))
$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); $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> <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>