Skip to content
Permalink
Browse files

fixed and improved gpx child waypoints

  • Loading branch information...
following
following committed Feb 10, 2013
1 parent 29ace6a commit 1dc8526aa11334051e5cab789ad9f46a91640ada
Showing with 5 additions and 4 deletions.
  1. +4 −3 htdocs/lib/search.gpx.inc.php
  2. +1 −1 lib/classes/ChildWp/Handler.php
@@ -581,21 +581,22 @@
// additional waypoints, including personal cache note
$childWaypoints = $childwphandler->getChildWps($r['cacheid']);
$n = 1;
$digits = "%0" . (floor(log10(count($childWaypoints))) + 1) . "d";
foreach ($childWaypoints as $childWaypoint)
{
$thiswp = $gpxWaypoints;
$thiswp = str_replace('{wp_lat}', sprintf('%01.5f', $childWaypoint['latitude']), $thiswp);
$thiswp = str_replace('{wp_lon}', sprintf('%01.5f', $childWaypoint['longitude']), $thiswp);
$thiswp = str_replace('{time}', $time, $thiswp);
$thiswp = str_replace('{name}', $r['waypoint'].'W'.$n , $thiswp);
$thiswp = str_replace('{name}', $r['waypoint'].'W'.sprintf($digits,$n) , $thiswp);
$thiswp = str_replace('{cachename}', xmlentities($r['name']), $thiswp);
$thiswp = str_replace('{comment}',xmlentities($childWaypoint['description']), $thiswp);
$thiswp = str_replace('{desc}', $translate->t('Waypoint','','',0).' '.$n, $thiswp);
switch ($childWaypoint['type'])
{
case 1: $wp_typename = "Parking Area";
defailt: $wp_typename = "Reference Point";
case 1: $wp_typename = "Parking Area"; break;
default: $wp_typename = "Reference Point";
}
$thiswp = str_replace('{type}', $wp_typename, $thiswp);
$thiswp = str_replace('{parent}', $r['waypoint'], $thiswp);
@@ -36,7 +36,7 @@ public function update($childid, $type, $lat, $lon, $desc)
public function getChildWp($childid)
{
$rs = sql("SELECT id, cache_id, type, subtype, latitude, longitude, description FROM coordinates WHERE id = &1", $childid);
$rs = sql("SELECT id, cache_id, subtype, latitude, longitude, description FROM coordinates WHERE id = &1", $childid);
$ret = $this->recordToArray(sql_fetch_array($rs));
mysql_free_result($rs);

0 comments on commit 1dc8526

Please sign in to comment.
You can’t perform that action at this time.