diff --git a/languages/wp-gpx-maps-de_DE.mo b/languages/wp-gpx-maps-de_DE.mo new file mode 100644 index 0000000..bb67c54 Binary files /dev/null and b/languages/wp-gpx-maps-de_DE.mo differ diff --git a/languages/wp-gpx-maps-de_DE.po b/languages/wp-gpx-maps-de_DE.po new file mode 100644 index 0000000..c721752 --- /dev/null +++ b/languages/wp-gpx-maps-de_DE.po @@ -0,0 +1,79 @@ +msgid "" +msgstr "" +"Project-Id-Version: wp-gpx-maps\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-06-25 11:54+0100\n" +"PO-Revision-Date: 2012-06-25 11:55+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + + +#: ../wp-gpx-maps.php:420 +msgid "Altitude" +msgstr "Höhe" + +#: ../wp-gpx-maps.php:421 +msgid "Current Position" +msgstr "Aktuelle Position" + +#: ../wp-gpx-maps.php:422 +msgid "Speed" +msgstr "Geschwindigkeit" + +#: ../wp-gpx-maps.php:423 +msgid "Heart rate" +msgstr "Herzfrequenz" + +#: ../wp-gpx-maps.php:424 +msgid "Cadence" +msgstr "Trittfrequenz" + +#: ../wp-gpx-maps.php:425 +msgid "Go Full Screen" +msgstr "Vollbildansicht" + +#: ../wp-gpx-maps.php:426 +msgid "Exit Full Screen" +msgstr "Vollbildansicht beenden" + +#: ../wp-gpx-maps.php:439 +msgid "Total distance" +msgstr "Distanz" + +#: ../wp-gpx-maps.php:443 +msgid "Max elevation" +msgstr "Maximale Höhe" + +#: ../wp-gpx-maps.php:444 +msgid "Min elevation" +msgstr "Minimale Höhe" + +#: ../wp-gpx-maps.php:445 +msgid "Total climbing" +msgstr "Gesamtanstieg" + +#: ../wp-gpx-maps.php:446 +msgid "Total descent" +msgstr "Gesamtabstieg" + +#: ../wp-gpx-maps.php:450 +msgid "Average speed" +msgstr "Durchschnittsgeschwindigkeit" + +#: ../wp-gpx-maps.php:466 +msgid "Download" +msgstr "Download" + +#: ../wp-gpx-maps_admin_settings.php:75 +#: ../wp-gpx-maps_admin_settings.php:151 +#: ../wp-gpx-maps_admin_settings.php:255 +#: ../wp-gpx-maps_admin_settings.php:286 +msgid "Save Changes" +msgstr "Änderungen speichern" + diff --git a/readme.txt b/readme.txt index 1d72066..2376525 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: maps, gpx, gps, graph, chart, google maps, highcharts, 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.4 -Stable tag: 1.1.31 +Stable tag: 1.1.32 License: GPLv2 or later Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -24,14 +24,22 @@ NextGen Gallery Integration: Display your NextGen Gallery images inside the map! Even if you don't have a gps camera, this plugin can retrive the image position starting from the image date and you gpx file. +Old NGGallery Images (without gps data) and gpx: http://www.pedemontanadelgrappa.it/mappe/itinerario-3-alta-via-degli-eroi/ + +Translated into 7 languages: +- English (default) +- Italian it_IT +- German de_DE +- Spanish es_ES +- Dutch nl_NL +- Swedish sv_SE +- Turkish tr_TR +(many thanks to all the guys who helped me with the translations) + - iphone/ipad/ipod Compatible Try this plugin: http://www.pedemontanadelgrappa.it/category/mappe/ -Thanks to: www.securcube.net, www.darwinner.it, www.pedemontanadelgrappa.it, - -Plugin page - Support Forum Supported gpx namespaces are: @@ -44,6 +52,8 @@ Supported gpx namespaces are: 1. http://www.garmin.com/xmlschemas/TrackPointExtension/v1 +Thanks to: www.securcube.net, www.darwinner.it, www.pedemontanadelgrappa.it, + == Installation == 1. Use the classic wordpress plugin installer or copy the plugins folder to the `/wp-content/plugins/` directory @@ -118,10 +128,25 @@ The attributes are: 1. download: Allow users to download your GPX file -1. summary: Print symmary details of your GPX (default is FALSE) - 1. dtoffset: the difference (in seconds) between your gpx tool date and your camera date +1. skipcache: Do not use cache. If TRUE might be very slow (default is FALSE) + +1. summary: Print summary details of your GPX (default is FALSE) + +1. summarytotlen: Print Total distance in summary table (default is FALSE) + +1. summarymaxele: Print Max Elevation in summary table (default is FALSE) + +1. summaryminele: Print Min Elevation in summary table (default is FALSE) + +1. summaryeleup: Print Total climbing in summary table (default is FALSE) + +1. summaryeledown: Print Total descent in summary table (default is FALSE) + +1. summaryavgspeed: Print Average Speed in summary table (default is FALSE) + +1. summarytotaltime: Print Total time in summary table (default is FALSE) = What happening if I've a very large gpx? = This plugin will print a small amout of points to speedup javascript and pageload. @@ -138,6 +163,10 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.1.32 = +* You can exclude cache (slower and not recommended) +* You can decide what show in the summary table +* German translation (thanks to Ali) = 1.1.31 = * Fixed fullscreen map image slideshow = 1.1.30 = diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index 0a07642..661c378 100644 --- a/wp-gpx-maps.php +++ b/wp-gpx-maps.php @@ -3,7 +3,7 @@ Plugin Name: WP-GPX-Maps Plugin URI: http://www.darwinner.it/ Description: Draws a gpx track with altitude graph -Version: 1.1.31 +Version: 1.1.32 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ License: GPL @@ -133,14 +133,23 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $ngGalleries = findValue($attr, "nggalleries", "wpgpxmaps_map_ngGalleries", ""); $ngImages = findValue($attr, "ngimages", "wpgpxmaps_map_ngImages", ""); $download = findValue($attr, "download", "wpgpxmaps_download", ""); - $summary = findValue($attr, "summary", "wpgpxmaps_summary", ""); $dtoffset = findValue($attr, "dtoffset", "wpgpxmaps_dtoffset", 0); + $skipcache = findValue($attr, "skipcache", "wpgpxmaps_skipcache", ""); + + $summary = findValue($attr, "summary", "wpgpxmaps_summary", ""); + $p_tot_len = findValue($attr, "summarytotlen", "wpgpxmaps_summary_tot_len", false); + $p_max_ele = findValue($attr, "summarymaxele", "wpgpxmaps_summary_max_ele", false); + $p_min_ele = findValue($attr, "summaryminele", "wpgpxmaps_summary_min_ele", false); + $p_total_ele_up = findValue($attr, "summaryeleup", "wpgpxmaps_summary_total_ele_up", false); + $p_total_ele_down = findValue($attr, "summaryeledown", "wpgpxmaps_summary_total_ele_down", false); + $p_avg_speed = findValue($attr, "summaryavgspeed", "wpgpxmaps_summary_avg_speed", false); + $p_total_time = findValue($attr, "summarytotaltime", "wpgpxmaps_summary_total_time", false); $r = rand(1,5000000); $gpxurl = $gpx; - $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$uomspeed,$uom,v1.1.30"; + $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showW,$showHr,$showCad,$donotreducegpx,$pointsoffset,$showSpeed,$uomspeed,$uom,v1.1.32"; $cacheFileName = md5($cacheFileName); @@ -153,8 +162,9 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') // Try to load cache - if (file_exists($gpxcache)) + if (file_exists($gpxcache) && !($skipcache == true)) { + try { $cache_str = file_get_contents($gpxcache); $cache_obj = unserialize($cache_str); @@ -170,6 +180,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $waypoints = $cache_obj["waypoints"]; $max_ele = $cache_obj["max_ele"]; $min_ele = $cache_obj["min_ele"]; + $max_time = $cache_obj["max_time"]; + $min_time = $cache_obj["min_time"]; $total_ele_up = $cache_obj["total_ele_up"]; $total_ele_down = $cache_obj["total_ele_down"]; $avg_speed = $cache_obj["avg_speed"]; @@ -188,6 +200,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $waypoints= ''; $max_ele = 0; $min_ele = 0; + $max_time = 0; + $min_time = 0; $total_ele_up = 0; $total_ele_down = 0; $avg_speed = 0; @@ -235,6 +249,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $max_ele = $points->maxEle; $min_ele = $points->minEle; + $max_time = $points->maxTime; + $min_time = $points->minTime; $total_ele_up = $points->totalEleUp; $total_ele_down = $points->totalEleDown; $avg_speed = $points->avgSpeed; @@ -383,28 +399,32 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') } } - @file_put_contents($gpxcache, - serialize(array( "points_maps" => $points_maps, - "points_x_time" => $points_x_time, - "points_x_lat" => $points_x_lat, - "points_x_lon" => $points_x_lon, - "points_graph_dist" => $points_graph_dist, - "points_graph_ele" => $points_graph_ele, - "points_graph_speed" => $points_graph_speed, - "points_graph_hr" => $points_graph_hr, - "points_graph_cad" => $points_graph_cad, - "waypoints" => $waypoints, - "max_ele" => $max_ele, - "min_ele" => $min_ele, - "total_ele_up" => $total_ele_up, - "total_ele_down" => $total_ele_down, - "avg_speed" => $avg_speed, - "tot_len" => $tot_len - ) - ), - LOCK_EX); - - @chmod($gpxcache,0755); + if (!($skipcache == true)) + { + @file_put_contents($gpxcache, + serialize(array( "points_maps" => $points_maps, + "points_x_time" => $points_x_time, + "points_x_lat" => $points_x_lat, + "points_x_lon" => $points_x_lon, + "points_graph_dist" => $points_graph_dist, + "points_graph_ele" => $points_graph_ele, + "points_graph_speed" => $points_graph_speed, + "points_graph_hr" => $points_graph_hr, + "points_graph_cad" => $points_graph_cad, + "waypoints" => $waypoints, + "max_ele" => $max_ele, + "min_ele" => $min_ele, + "total_ele_up" => $total_ele_up, + "total_ele_down" => $total_ele_down, + "avg_speed" => $avg_speed, + "tot_len" => $tot_len, + "max_time" => $max_time, + "min_time" => $min_time + ) + ), + LOCK_EX); + @chmod($gpxcache,0755); + } if ($gh == "0" || $gh == "0px") { @@ -462,42 +482,51 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') }); '; - // print summary - if ($summary=='true' && ( $points_graph_speed != '' || $points_graph_ele != '' || $points_graph_dist != '') ) + // print summary + if ($summary=='true' && ( $points_graph_speed != '' || $points_graph_ele != '' || $points_graph_dist != '') ) + { + + $output .= "
"; + if ($points_graph_dist != '' && $p_tot_len == 'true') { - - $output .= "
"; - if ($points_graph_dist != '') - { - $output .= "".__("Total distance", "wp-gpx-maps").": $tot_len
"; - } - if ($points_graph_ele != '') - { + $output .= "".__("Total distance", "wp-gpx-maps").": $tot_len
"; + } + if ($points_graph_ele != '') + { + if ($p_max_ele == 'true') $output .= "".__("Max elevation", "wp-gpx-maps").": $max_ele
"; + if ($p_min_ele == 'true') $output .= "".__("Min elevation", "wp-gpx-maps").": $min_ele
"; + if ($p_total_ele_up == 'true') $output .= "".__("Total climbing", "wp-gpx-maps").": $total_ele_up
"; + if ($p_total_ele_down == 'true') $output .= "".__("Total descent", "wp-gpx-maps").": $total_ele_down
"; - } - if ($points_graph_speed != '') - { - $output .= "".__("Average speed", "wp-gpx-maps").": $avg_speed
"; - } - $output .= "
"; } - - // print download link - if ($download=='true' && $gpxurl != '') + if ($points_graph_speed != '' && $p_avg_speed == 'true') { - if ($isGpxUrl == true) - { - - } - else - { - $gpxurl = get_bloginfo('url').$gpxurl; - } - $output.="".__("Download", "wp-gpx-maps").""; + $output .= "".__("Average speed", "wp-gpx-maps").": $avg_speed
"; } + if ($p_total_time == 'true' && $max_time > 0) + { + $time_diff = date("H:i:s", ($max_time - $min_time)); + $output .= "".__("Total Time", "wp-gpx-maps").": $time_diff
"; + } + $output .= "
"; + } + + // print download link + if ($download=='true' && $gpxurl != '') + { + if ($isGpxUrl == true) + { + + } + else + { + $gpxurl = get_bloginfo('url').$gpxurl; + } + $output.="".__("Download", "wp-gpx-maps").""; + } return $output; } @@ -602,6 +631,7 @@ function WP_GPX_Maps_install() { add_option('wpgpxmaps_zoomonscrollwheel','','','yes'); add_option('wpgpxmaps_download','','','yes'); add_option('wpgpxmaps_summary','','','yes'); + add_option('wpgpxmaps_skipcache','','','yes'); } function WP_GPX_Maps_remove() { @@ -634,6 +664,7 @@ function WP_GPX_Maps_remove() { delete_option('wpgpxmaps_zoomonscrollwheel'); delete_option('wpgpxmaps_download'); delete_option('wpgpxmaps_summary'); + delete_option('wpgpxmaps_skipcache'); } ?> diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index e0a2fcc..2cc3da5 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -20,7 +20,16 @@ $showCad = get_option('wpgpxmaps_show_cadence'); $zoomonscrollwheel = get_option("wpgpxmaps_zoomonscrollwheel"); $download = get_option("wpgpxmaps_download"); - $summary = get_option("wpgpxmaps_summary"); + $skipcache = get_option("wpgpxmaps_skipcache"); + + $summary = get_option("wpgpxmaps_summary"); + $tot_len = get_option("wpgpxmaps_summary_tot_len"); + $min_ele = get_option("wpgpxmaps_summary_min_ele"); + $max_ele = get_option("wpgpxmaps_summary_max_ele"); + $total_ele_up = get_option("wpgpxmaps_summary_total_ele_up"); + $total_ele_down = get_option("wpgpxmaps_summary_total_ele_down"); + $avg_speed = get_option("wpgpxmaps_summary_avg_speed"); + $total_time = get_option("wpgpxmaps_summary_total_time"); if (!($t)) $t = 'HYBRID'; @@ -54,29 +63,98 @@ + + Cache: + + onchange="this.value = (this.checked)" /> Do not use cache + + GPX Download: onchange="this.value = (this.checked)" /> Allow users to download your GPX file - + + + +

+ + + " /> +

+ + + +
+ +
+ + + +

Summary table

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Summary table: onchange="this.value = (this.checked)" /> Print summary table
Total distance: + onchange="this.value = (this.checked)" /> Print Total distance +
Max Elevation: + onchange="this.value = (this.checked)" /> Print Max Elevation +
Min Elevation: + onchange="this.value = (this.checked)" /> Print Min Elevation +
Min Elevation: + onchange="this.value = (this.checked)" /> Print Total climbing +
Min Elevation: + onchange="this.value = (this.checked)" /> Print Total descent +
Min Elevation: + onchange="this.value = (this.checked)" /> Print Average Speed +
Total time: + onchange="this.value = (this.checked)" /> Print Total time +

- + " />

+
+
diff --git a/wp-gpx-maps_utils.php b/wp-gpx-maps_utils.php index 1a36ccf..ab399b3 100644 --- a/wp-gpx-maps_utils.php +++ b/wp-gpx-maps_utils.php @@ -127,6 +127,8 @@ $points->speed = array(); $points->hr = array(); $points->cad = array(); + $points->maxTime = 0; + $points->minTime = 0; $points->maxEle = 0; $points->minEle = 0; $points->totalEleUp = 0; @@ -302,12 +304,26 @@ unset($nodes); try { + + array_pop($points->dt, null); + array_pop($points->lat, null); + array_pop($points->lon, null); + array_pop($points->ele, null); + array_pop($points->dist, null); + array_pop($points->speed, null); + array_pop($points->hr, null); + array_pop($points->cad, null); + + $_time = array_filter($points->dt); $_ele = array_filter($points->ele); $_dist = array_filter($points->dist); $_speed = array_filter($points->speed); $points->maxEle = max($_ele); $points->minEle = min($_ele); $points->totalLength = max($_dist); + $points->maxTime = max($_time); + $points->minTime = min($_time); + $points->avgSpeed = array_sum($_speed) / count($_speed); } catch (Exception $e) { }