From 60b8c67a5663c882b43a62278da70127b5ca2cf1 Mon Sep 17 00:00:00 2001 From: bastianonm Date: Fri, 16 Mar 2018 22:08:58 +0000 Subject: [PATCH] * fix uom * fix file not found --- js/WP-GPX-Maps.js | 3 +-- readme.txt | 5 ++++- wp-gpx-maps.php | 6 +++--- wp-gpx-maps_admin_tracks.php | 2 +- wp-gpx-maps_utils.php | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/js/WP-GPX-Maps.js b/js/WP-GPX-Maps.js index 88c16c2..dd909c0 100644 --- a/js/WP-GPX-Maps.js +++ b/js/WP-GPX-Maps.js @@ -798,8 +798,7 @@ Author URI: http://www.devfarm.it/ max: graphDist[graphDist.length-1], // Include a dollar sign in the ticks callback: function(value, index, values) { - var fpt = _formats[0]; - return Math.round(value, fpt.dec) + fpt.suf; + return Math.round(value, l_x.dec) + l_x.suf; } }             }] diff --git a/readme.txt b/readme.txt index 7bad844..f02645a 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i 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: 4.9.4 -Stable tag: 1.5.03 +Stable tag: 1.5.04 Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -153,6 +153,9 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.5.04 = +* fix uom +* fix file not found = 1.5.03 = * fix random error = 1.5.02 = diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index 1ed1d2a..ec81cb8 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 chart -Version: 1.5.03 +Version: 1.5.04 Author: Bastianon Massimo Author URI: http://www.devfarm.it/ */ @@ -62,7 +62,7 @@ function enqueue_WP_GPX_Maps_scripts_admin($hook) function enqueue_WP_GPX_Maps_scripts() { wp_register_script('chartjs', plugins_url( '/js/Chart.min.js', __FILE__ ), array(), "2.7.2" ); - wp_register_script('WP-GPX-Maps', plugins_url( '/js/WP-GPX-Maps.js', __FILE__ ), array('jquery','googlemaps','chartjs'), "1.5.02" ); + wp_register_script('WP-GPX-Maps', plugins_url( '/js/WP-GPX-Maps.js', __FILE__ ), array('jquery','googlemaps','chartjs'), "1.5.031" ); $wpgpxmaps_googlemapsv3_apikey = get_option('wpgpxmaps_googlemapsv3_apikey'); @@ -153,7 +153,7 @@ function handle_WP_GPX_Maps_folder_Shortcodes($attr, $content='') { foreach($files as $file) { - if (substr($file, - 4) == ".gpx" ) { + if (strtolower(substr($file, - 4)) == ".gpx" ) { $gpx = $folder . DIRECTORY_SEPARATOR . $file; $points = wpgpxmaps_getPoints($gpx, $pointsoffset, $donotreducegpx, $distanceType); diff --git a/wp-gpx-maps_admin_tracks.php b/wp-gpx-maps_admin_tracks.php index 0858ecd..0fe5302 100644 --- a/wp-gpx-maps_admin_tracks.php +++ b/wp-gpx-maps_admin_tracks.php @@ -8,7 +8,7 @@ if ( $is_admin != 1 ) return; - $gpxRegEx = '/.gpx$/'; + $gpxRegEx = '/.gpx$/i'; if ( isset($_POST['clearcache']) ) { diff --git a/wp-gpx-maps_utils.php b/wp-gpx-maps_utils.php index 8c01ae3..4605937 100644 --- a/wp-gpx-maps_utils.php +++ b/wp-gpx-maps_utils.php @@ -66,7 +66,8 @@ function wp_gpx_maps_sitePath() { - return substr(get_home_path(), 0, -1); + return substr(substr(__FILE__, 0, strrpos(__FILE__,'wp-content')), 0, -1); + //return substr(get_home_path(), 0, -1); } function gpxFolderPath()