From 223ad1c606d61f161473ce3cc8e15d8f622cc36c Mon Sep 17 00:00:00 2001 From: bastianonm Date: Mon, 18 Nov 2013 13:45:18 +0000 Subject: [PATCH] * Added Bulgarian translation, thanks to Svilen Savov * Added possibility to hide the elevation chart --- readme.txt | 12 +++++++++--- wp-gpx-maps.php | 14 ++++++++++---- wp-gpx-maps_admin_settings.php | 16 ++++++++++++++-- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/readme.txt b/readme.txt index b09c832..ac36cdb 100644 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Contributors: bastianonm Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VHWLRW6JBTML Tags: maps, gpx, gps, graph, chart, google maps, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence Requires at least: 2.0.0 -Tested up to: 3.6.1 -Stable tag: 1.2.3 +Tested up to: 3.7.1 +Stable tag: 1.2.4 Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -26,7 +26,7 @@ Even if you don't have a gps camera, this plugin can retrive the image position Old NGGallery Images (without gps data) and gpx: http://www.pedemontanadelgrappa.it/mappe/itinerario-3-alta-via-degli-eroi/ -Translated into 12 languages: +Translated into 13 languages: - Dutch nl_NL - English (default) @@ -40,6 +40,7 @@ Translated into 12 languages: - Spanish es_ES - Swedish sv_SE - Turkish tr_TR +- Bulgarian bg_BG (many thanks to all guys who helped me with the translations) @@ -103,6 +104,8 @@ The attributes are: 1. showhr: show heart rate inside the chart (default is FALSE) +1. showele: show elevation data inside the chart (default is TRUE) + 1. showcad: show cadence inside the chart (default is FALSE) 1. showgrade: show grade inside the chart (default is FALSE) @@ -176,6 +179,9 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.2.4 = +* Added Bulgarian translation, thanks to Svilen Savov +* Added possibility to hide the elevation chart = 1.2.2 = * Smaller map type selector * New map: MapToolKit - Terrain diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index 2e685f1..f98faa5 100644 --- a/wp-gpx-maps.php +++ b/wp-gpx-maps.php @@ -3,7 +3,7 @@ Plugin Name: WP-GPX-Maps Plugin URI: http://www.devfarm.it/ Description: Draws a gpx track with altitude graph -Version: 1.2.3 +Version: 1.2.4 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ */ @@ -113,8 +113,9 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $showCad = findValue($attr, "showcad", "wpgpxmaps_show_cadence", false); $showHr = findValue($attr, "showhr", "wpgpxmaps_show_hr", false); $showW = findValue($attr, "waypoints", "wpgpxmaps_show_waypoint", false); + $showEle = findValue($attr, "showele", "wpgpxmaps_show_elevation", "true"); $showSpeed = findValue($attr, "showspeed", "wpgpxmaps_show_speed", false); - $showGrade = findValue($attr, "showgrade", "wpgpxmaps_show_grade", false); + $showGrade = findValue($attr, "showgrade", "wpgpxmaps_show_grade", false); $zoomOnScrollWheel = findValue($attr, "zoomonscrollwheel", "wpgpxmaps_zoomonscrollwheel", false); $donotreducegpx = findValue($attr, "donotreducegpx", "wpgpxmaps_donotreducegpx", false); $pointsoffset = findValue($attr, "pointsoffset", "wpgpxmaps_pointsoffset", 10); @@ -154,7 +155,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $gpxurl = $gpx; - $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,v1.1.38"; + $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showEle,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$showGrade,$uomspeed,$uom,v1.1.38"; $cacheFileName = md5($cacheFileName); @@ -217,6 +218,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $isGpxUrl = (preg_match('/^(http(s)?\:\/\/)/', trim($gpx)) == 1); if ((!isset($points_maps) || $points_maps == '') && $gpx != '') { + //if (true) { $sitePath = sitePath(); @@ -383,6 +385,11 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') } } + if ($showEle == "false") + { + $points_graph_ele = ""; + } + $p="/(,|,null,)$/"; $points_maps = preg_replace($p, "", $points_maps); @@ -413,7 +420,6 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') if (preg_match("/^(0,?)+$/", $points_graph_grade)) $points_graph_grade = ""; - } diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index 413178c..01ed7fa 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -15,6 +15,7 @@ $t = get_option('wpgpxmaps_map_type'); $uom = get_option('wpgpxmaps_unit_of_measure'); $uomSpeed = get_option('wpgpxmaps_unit_of_measure_speed'); + $showEle = get_option("wpgpxmaps_show_elevation"); $showSpeed = get_option('wpgpxmaps_show_speed'); $showHr = get_option('wpgpxmaps_show_hr'); $showCad = get_option('wpgpxmaps_show_cadence'); @@ -32,6 +33,9 @@ $avg_speed = get_option("wpgpxmaps_summary_avg_speed"); $total_time = get_option("wpgpxmaps_summary_total_time"); + if (empty($showEle)) + $showEle = "true"; + if (!($t)) $t = 'HYBRID'; if (!($po)) @@ -270,10 +274,18 @@ (leave empty for auto scale) + + + Show elevation: + + onchange="wpgpxmaps_show_elevation.value = this.checked" onload="wpgpxmaps_show_elevation.value = this.checked" /> Show elevation + + + Show speed: - onchange="this.value = (this.checked)" />Show Speed + onchange="this.value = (this.checked)" /> Show Speed @@ -350,7 +362,7 @@

- + " />