From 9f993afafd0f7134e9242d76f6443ce86309abba Mon Sep 17 00:00:00 2001 From: bastianonm Date: Thu, 26 Dec 2013 13:23:14 +0000 Subject: [PATCH] * Added Catalan translation, thanks to Edgar * Updated Spanish translation, thanks to Dani * Added different types of distance: Normal, Flat (don't consider altitude) and Climb distance --- languages/wp-gpx-maps-bg_BG.mo | Bin 0 -> 1575 bytes languages/wp-gpx-maps-bg_BG.po | 93 +++++++++++++++++++++++++++++++++ languages/wp-gpx-maps-ca.mo | Bin 0 -> 1389 bytes languages/wp-gpx-maps-ca.po | 93 +++++++++++++++++++++++++++++++++ languages/wp-gpx-maps-es_ES.mo | Bin 1142 -> 1399 bytes languages/wp-gpx-maps-es_ES.po | 16 +++--- readme.txt | 11 ++-- wp-gpx-maps.php | 11 ++-- wp-gpx-maps_admin_settings.php | 15 +++++- wp-gpx-maps_utils.php | 47 +++++++++++------ 10 files changed, 256 insertions(+), 30 deletions(-) create mode 100644 languages/wp-gpx-maps-bg_BG.mo create mode 100644 languages/wp-gpx-maps-bg_BG.po create mode 100644 languages/wp-gpx-maps-ca.mo create mode 100644 languages/wp-gpx-maps-ca.po diff --git a/languages/wp-gpx-maps-bg_BG.mo b/languages/wp-gpx-maps-bg_BG.mo new file mode 100644 index 0000000000000000000000000000000000000000..5310bc854c3e9996d20289343212a028333f36c8 GIT binary patch literal 1575 zcmaKq&u<$=6vqc>`Qbu;!KDJkAjGBBnBAm6*#e?*(l(+NR_!7VsL^zHuou=l*6!Fz zI5nwSL=mb~@uP=|UlN>4n^4z@6P3SU_P~V$5;v|rairh3w(ArjMtc72oA>*T|Jb|j zONR3l_O6?@U4X@}lG@*{!w4RS6Edw^Q z5E_289YwtACrZWan7&Uvu4H0(B8_6l!$9%bCW@u3EEl+nR7d97%3-`ktICezrG|{j zvD(n{qo8WuVoe(v@mknaZ1CwvVe?EF*N1ALQtE!Bg{hG=LM723D&L6NK)kDx6hnA? zz9s6d1<{nPv~W_jbYes~t%re_YS&Xy(;hEW-l>UFqVhh)G{*4wgyT*K*AbHrcMp08 z-2;y6IB*mvRVSpxW4}q^y25>hPfU95_ekWvVL@kkV8cCxQk5@Zkq+*V#b%(#6 z=Gt2W6m?R66A^K}jjf5Al1;Q!o-NOeXK;&7p``IzG14x!(4SEY=A~97!}u`w8!}0i zdE->=s5mtCqw*i9M9jp#4zN0pA3777!h52kRS+8SwpyImNsykv_B=i}cX&>XjZ-pJ zEomAaFXHl;itz`^Cm95DxA=1L)v+hvSns}f~B7=W^Xb39X^+{i*}vaA7Jfe=dw=`X}`4__9ko> zAeWHUUWfmh?J|4C-ptO!y26omnP(TWOLmRtv6QpV^4K0ef3aOY=;J?pvU7GVTcXT8 z>c`&V`0V3j9X+EbyUOfUBmt|KI0p#BV|{5@tie4Wz^}MwMvX zdo5ERy{&zq$E|Dp#{P^YZE$-TiB>5Qv-j@0sDVs)5ZYLOs|}NEV!!k#_gOI13Jry! IaX(!7T|{Iv;{X5v literal 0 HcmV?d00001 diff --git a/languages/wp-gpx-maps-bg_BG.po b/languages/wp-gpx-maps-bg_BG.po new file mode 100644 index 0000000..3e52bad --- /dev/null +++ b/languages/wp-gpx-maps-bg_BG.po @@ -0,0 +1,93 @@ +msgid "" +msgstr "" +"Project-Id-Version: wp-gpx-maps\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-10-30 14:41+0100\n" +"PO-Revision-Date: 2013-11-16 23:13+0200\n" +"Last-Translator: Svilen Savov \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-Generator: Poedit 1.5.7\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../wp-gpx-maps.php:467 +msgid "Altitude" +msgstr "Височина" + +#: ../wp-gpx-maps.php:468 +msgid "Current Position" +msgstr "Текуща Позиция" + +#: ../wp-gpx-maps.php:469 +msgid "Speed" +msgstr "Скорост" + +#: ../wp-gpx-maps.php:470 +msgid "Heart rate" +msgstr "Пулс" + +#: ../wp-gpx-maps.php:471 +msgid "Cadence" +msgstr "Ритъм" + +#: ../wp-gpx-maps.php:472 +msgid "Go Full Screen" +msgstr "Покажи на цял екран" + +#: ../wp-gpx-maps.php:473 +msgid "Exit Full Screen" +msgstr "Изход от цял екран" + +#: ../wp-gpx-maps.php:474 +msgid "Hide Images" +msgstr "Скрий Снимките" + +#: ../wp-gpx-maps.php:475 +msgid "Show Images" +msgstr "Покажи Снкмките" + +#: ../wp-gpx-maps.php:476 +msgid "Back to center" +msgstr "Центрирай" + +#: ../wp-gpx-maps.php:489 +msgid "Total distance" +msgstr "Обща дистанция" + +#: ../wp-gpx-maps.php:494 +msgid "Max elevation" +msgstr "Максимална височина" + +#: ../wp-gpx-maps.php:496 +msgid "Min elevation" +msgstr "Минимална височина" + +#: ../wp-gpx-maps.php:498 +msgid "Total climbing" +msgstr "Общо изкачване" + +#: ../wp-gpx-maps.php:500 +msgid "Total descent" +msgstr "Общо спускане" + +#: ../wp-gpx-maps.php:504 +msgid "Average speed" +msgstr "Средна скорост" + +#: ../wp-gpx-maps.php:509 +msgid "Total Time" +msgstr "Общо Време" + +#: ../wp-gpx-maps.php:525 +msgid "Download" +msgstr "Свали" + +#: ../wp-gpx-maps_admin_settings.php:83 ../wp-gpx-maps_admin_settings.php:151 +#: ../wp-gpx-maps_admin_settings.php:229 ../wp-gpx-maps_admin_settings.php:333 +#: ../wp-gpx-maps_admin_settings.php:364 +msgid "Save Changes" +msgstr "Запази Промените" diff --git a/languages/wp-gpx-maps-ca.mo b/languages/wp-gpx-maps-ca.mo new file mode 100644 index 0000000000000000000000000000000000000000..373c6a03cef67ae5c036c554ea78c5eefaa2a926 GIT binary patch literal 1389 zcmZvbzmFS56vqb$1RQ>ZKoJB;QzFn9`|cuz4Mg~Sm*m75th0$yM6q6W-`R8Q&a7s~ zcRq=h3MfI8X^?1Ag^~)_NYElgjl>^7K>^=quj3#w(!0;S+4p;%f4^|%D~0niYW@a_{hu}e2Bp4pC`#@xf)e))P~vUW_g6uw??X`LaT`Q=3tvFJ z1VO0^;nW3)9I021EzMIX~wE^%z?(N ztCBfW+mwEyqt_|B$U$`}W0$h(PD8+r?)%C{>z&&1CocDtsoj~4`r0(l^&kz*PF?r^ zQExDXr~^e-H*CgwuRyX&^=PI!=VMw#>sj}RHlSnH-3d7{98CPl%4x7Dap)uEdT0w) z%YW0{7I&>1*J{R6oWHE zrUF&<_IkVPHrmZrqwDct4v|kwlo)vy-!5~q?ut$)6e^DIeLTEoF0bvRfnG#jd3KXsFHpV~-K7d9S|Bh^J0fflPb|IVeBlq_9p=MOZcaZ0(` z!2=Wa5o1#WyqOIei&c`tUgV@PurlXJs^c(M`kxO6HWsWABb(o+RCTbDu(Sn5*|@qi zUCi&zaQBFQ--(X&uujS0u~pAkQtd;>QJijNc H)))T*j2BwB literal 0 HcmV?d00001 diff --git a/languages/wp-gpx-maps-ca.po b/languages/wp-gpx-maps-ca.po new file mode 100644 index 0000000..6380bbd --- /dev/null +++ b/languages/wp-gpx-maps-ca.po @@ -0,0 +1,93 @@ +msgid "" +msgstr "" +"Project-Id-Version: wp-gpx-maps\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-10-30 14:41+0100\n" +"PO-Revision-Date: 2013-12-14 21:43+0100\n" +"Last-Translator: edgar \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-Generator: Poedit 1.5.5\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../wp-gpx-maps.php:467 +msgid "Altitude" +msgstr "Altitud" + +#: ../wp-gpx-maps.php:468 +msgid "Current Position" +msgstr "Posició actual" + +#: ../wp-gpx-maps.php:469 +msgid "Speed" +msgstr "Velocitat" + +#: ../wp-gpx-maps.php:470 +msgid "Heart rate" +msgstr "Ritme cardíac" + +#: ../wp-gpx-maps.php:471 +msgid "Cadence" +msgstr "Cadència" + +#: ../wp-gpx-maps.php:472 +msgid "Go Full Screen" +msgstr "Anar a pantalla completa" + +#: ../wp-gpx-maps.php:473 +msgid "Exit Full Screen" +msgstr "Sortir de pantalla completa" + +#: ../wp-gpx-maps.php:474 +msgid "Hide Images" +msgstr "Amagar imatges" + +#: ../wp-gpx-maps.php:475 +msgid "Show Images" +msgstr "Mostrar imatges" + +#: ../wp-gpx-maps.php:476 +msgid "Back to center" +msgstr "Centrar" + +#: ../wp-gpx-maps.php:489 +msgid "Total distance" +msgstr "Distància total" + +#: ../wp-gpx-maps.php:494 +msgid "Max elevation" +msgstr "Altitud màxima" + +#: ../wp-gpx-maps.php:496 +msgid "Min elevation" +msgstr "Altitud mínima" + +#: ../wp-gpx-maps.php:498 +msgid "Total climbing" +msgstr "Ascensió total" + +#: ../wp-gpx-maps.php:500 +msgid "Total descent" +msgstr "Descens total" + +#: ../wp-gpx-maps.php:504 +msgid "Average speed" +msgstr "Velocitat mitjana" + +#: ../wp-gpx-maps.php:509 +msgid "Total Time" +msgstr "Temps total" + +#: ../wp-gpx-maps.php:525 +msgid "Download" +msgstr "Descarregar" + +#: ../wp-gpx-maps_admin_settings.php:83 ../wp-gpx-maps_admin_settings.php:151 +#: ../wp-gpx-maps_admin_settings.php:229 ../wp-gpx-maps_admin_settings.php:333 +#: ../wp-gpx-maps_admin_settings.php:364 +msgid "Save Changes" +msgstr "Desar canvis" diff --git a/languages/wp-gpx-maps-es_ES.mo b/languages/wp-gpx-maps-es_ES.mo index 145c4046ef912efdbb28afc3a99b1b2418028a3a..196e49472459ff1bd14e3b8e52a444b3fb4f0e0e 100644 GIT binary patch delta 810 zcmYMx&ui2`6bJCxAJw|6wOgg4wm3&=$(m%hLKhKh7i~f5qD$$aScYVp4JMf-nN}7G zd-9@qiuGDNc=q7clY(b^@gU;4e}O%C(C^Ep^ug>WlgzyLX7s=Ut-moa8A zK4Z*cY!>i?_zuV6A-n*8!U=c;&%$Fk3I9P_H(4CbuR>Zk2P<$9R$&`bp3cZ2dxnSe zcoF0a25=1XmykBThLq?Xq>Uf)`6u`WMZZ95q*G?>BHVy9??Gy)52?WcJO^LFYw#_c zW<$n4;(<1PgEjaAPQjzxzmOW3Kv(pA7E+>HkQ!fvwEqF5LhJe5gXk|?1K1@D^vaMf z%MVx$^|PP?)a^;o-*FOjY6`kODn!NUW=a@mFzB>Y81+W66lh=XxRNdH%2;@kCw(bh zc3(KpxmMhfk(M!A7Osra{lZFh#djrN4Y4vwe--Ah_tcAg%ARIByGo0Icl}VN)#6@g znMT9pRtvNe^Mw!*{>w6E0l60(m`{rYn(2CQyr#V>H PmtkMwu5j$MUAF%NMR<^E delta 536 zcmZ9|ze~eF6bJBYo5nV+Kd7K+J7jS2M`{{dkvKVYQwaEDKbmL*v5_=_f>>~KD;xy} zLD#O1uKE`Uj_NA7x48LzO?2?V<&$@LclRzsWsvE-7o;9TOktETZZT%*J%I<}3})at z9EVqM40a){xrx8`01D=>@m*(P47unuX%{Ww2_IDga> zeMic$7t3K#(4n*ut@#bQF*W-?aMMxKbaUKi^at6N7rNp#F)fCP9bqMxq!Y)nMK5`g z)7LelrdBFuttv{X;)0\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-Generator: Poedit 1.5.5\n" "X-Poedit-SearchPath-0: ..\n" #: ../wp-gpx-maps.php:467 msgid "Altitude" -msgstr "Altura" +msgstr "Altitud" #: ../wp-gpx-maps.php:468 msgid "Current Position" @@ -43,15 +44,15 @@ msgstr "Salir de pantalla completa" #: ../wp-gpx-maps.php:474 msgid "Hide Images" -msgstr "" +msgstr "Ocultar Imágenes" #: ../wp-gpx-maps.php:475 msgid "Show Images" -msgstr "" +msgstr "Mostrar Imágenes" #: ../wp-gpx-maps.php:476 msgid "Back to center" -msgstr "" +msgstr "Centrar" #: ../wp-gpx-maps.php:489 msgid "Total distance" @@ -78,9 +79,8 @@ msgid "Average speed" msgstr "Velocidad media" #: ../wp-gpx-maps.php:509 -#, fuzzy msgid "Total Time" -msgstr "Distancia total" +msgstr "Tiempo total" #: ../wp-gpx-maps.php:525 msgid "Download" diff --git a/readme.txt b/readme.txt index ac36cdb..22f319a 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.7.1 -Stable tag: 1.2.4 +Tested up to: 3.8 +Stable tag: 1.2.5 Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. @@ -26,8 +26,9 @@ 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 13 languages: +Translated into 14 languages: +- Catalan ca - Dutch nl_NL - English (default) - French fr_FR @@ -179,6 +180,10 @@ Yes! 1. Altitude & Speed & Hearth rate == Changelog == += 1.2.5 = +* Added Catalan translation, thanks to Edgar +* Updated Spanish translation, thanks to Dani +* Added different types of distance: Normal, Flat (don't consider altitude) and Climb distance = 1.2.4 = * Added Bulgarian translation, thanks to Svilen Savov * Added possibility to hide the elevation chart diff --git a/wp-gpx-maps.php b/wp-gpx-maps.php index f98faa5..da458b5 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.4 +Version: 1.2.5 Author: Bastianon Massimo Author URI: http://www.pedemontanadelgrappa.it/ */ @@ -140,6 +140,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $ngImages = findValue($attr, "ngimages", "wpgpxmaps_map_ngImages", ""); $download = findValue($attr, "download", "wpgpxmaps_download", ""); $dtoffset = findValue($attr, "dtoffset", "wpgpxmaps_dtoffset", 0); + $distanceType = findValue($attr, "distanceType", "wpgpxmaps_distance_type", 0); + $skipcache = findValue($attr, "skipcache", "wpgpxmaps_skipcache", ""); $summary = findValue($attr, "summary", "wpgpxmaps_summary", ""); @@ -151,11 +153,12 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $p_avg_speed = findValue($attr, "summaryavgspeed", "wpgpxmaps_summary_avg_speed", false); $p_total_time = findValue($attr, "summarytotaltime", "wpgpxmaps_summary_total_time", false); + $colors_map = "\"".implode("\",\"",(explode(" ",$color_map)))."\""; $gpxurl = $gpx; - $cacheFileName = "$gpx,$w,$mh,$mt,$gh,$showEle,$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,$distanceType,v1.1.38"; $cacheFileName = md5($cacheFileName); @@ -166,6 +169,8 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') $gpxcache.= DIRECTORY_SEPARATOR.$cacheFileName.".tmp"; + $skipcache=true; + // Try to load cache if (file_exists($gpxcache) && !($skipcache == true)) { @@ -236,7 +241,7 @@ function handle_WP_GPX_Maps_Shortcodes($attr, $content='') return "No gpx found"; } - $points = getPoints( $gpx, $pointsoffset, $donotreducegpx); + $points = getPoints( $gpx, $pointsoffset, $donotreducegpx, $distanceType); $points_maps = ''; $points_graph_dist = ''; diff --git a/wp-gpx-maps_admin_settings.php b/wp-gpx-maps_admin_settings.php index 01ed7fa..6ecec85 100644 --- a/wp-gpx-maps_admin_settings.php +++ b/wp-gpx-maps_admin_settings.php @@ -33,6 +33,8 @@ $avg_speed = get_option("wpgpxmaps_summary_avg_speed"); $total_time = get_option("wpgpxmaps_summary_total_time"); + $distanceType = get_option("wpgpxmaps_distance_type"); + if (empty($showEle)) $showEle = "true"; @@ -68,6 +70,17 @@ + + Distance type: + + + + + Cache: @@ -84,7 +97,7 @@

- + " />

diff --git a/wp-gpx-maps_utils.php b/wp-gpx-maps_utils.php index eeddf5c..69c7aaa 100644 --- a/wp-gpx-maps_utils.php +++ b/wp-gpx-maps_utils.php @@ -79,7 +79,7 @@ return TRUE; } - function getPoints($gpxPath,$gpxOffset = 10, $donotreducegpx) + function getPoints($gpxPath,$gpxOffset = 10, $donotreducegpx, $distancetype) { $points = array(); @@ -92,7 +92,7 @@ if (file_exists($gpxPath)) { - $points = @parseXml($gpxPath, $gpxOffset); + $points = @parseXml($gpxPath, $gpxOffset, $distancetype); } else { @@ -125,7 +125,7 @@ return $points; } - function parseXml($filePath, $gpxOffset) + function parseXml($filePath, $gpxOffset, $distancetype) { $points = null; @@ -242,7 +242,7 @@ else { //Normal Case - $offset = calculateDistance((float)$lat, (float)$lon, (float)$ele, (float)$lastLat, (float)$lastLon, (float)$lastEle); + $offset = calculateDistance((float)$lat, (float)$lon, (float)$ele, (float)$lastLat, (float)$lastLon, (float)$lastEle, $distancetype); $dist = $dist + $offset; $points->totalLength = $dist; @@ -397,7 +397,7 @@ else { //Normal Case - $offset = calculateDistance($lat, $lon, 0,$lastLat, $lastLon, 0); + $offset = calculateDistance($lat, $lon, 0,$lastLat, $lastLon, 0, $distancetype); $dist = $dist + $offset; if (((float) $offset + (float) $lastOffset) > $gpxOffset) { @@ -462,7 +462,7 @@ else { //Normal Case - $offset = calculateDistance($lat, $lon, 0,$lastLat, $lastLon, 0); + $offset = calculateDistance($lat, $lon, 0,$lastLat, $lastLon, 0, $distancetype); $dist = $dist + $offset; if (((float) $offset + (float) $lastOffset) > $gpxOffset) { @@ -500,7 +500,6 @@ } } - } unset($gpx); @@ -543,15 +542,33 @@ return (float)($degrees * 3.1415926535897932385 / 180); } - function calculateDistance($lat1,$lon1,$ele1,$lat2,$lon2,$ele2) + function calculateDistance($lat1,$lon1,$ele1,$lat2,$lon2,$ele2,$distancetype) { - $alpha = (float)sin((float)toRadians((float) $lat2 - (float) $lat1) / 2); - $beta = (float)sin((float)toRadians((float) $lon2 - (float) $lon1) / 2); - //Distance in meters - $a = (float) ( (float)$alpha * (float)$alpha) + (float) ( (float)cos( (float)toRadians($lat1)) * (float)cos( (float)toRadians($lat2)) * (float)$beta * (float)$beta ); - $dist = 2 * 6369628.75 * (float)atan2((float)sqrt((float)$a), (float)sqrt(1 - (float) $a)); - $d = (float)sqrt((float)pow((float)$dist, 2) + pow((float) $lat1 - (float)$lat2, 2)); - return sqrt((float)pow((float)$ele1-(float)$ele2,2)+(float)pow((float)$d,2)); + + if ($distancetype == '2') // climb + { + return (float)$ele1 - (float)$ele2; + } + else if ($distancetype == '1') // flat + { + $alpha = (float)sin((float)toRadians((float) $lat2 - (float) $lat1) / 2); + $beta = (float)sin((float)toRadians((float) $lon2 - (float) $lon1) / 2); + //Distance in meters + $a = (float) ( (float)$alpha * (float)$alpha) + (float) ( (float)cos( (float)toRadians($lat1)) * (float)cos( (float)toRadians($lat2)) * (float)$beta * (float)$beta ); + $dist = 2 * 6369628.75 * (float)atan2((float)sqrt((float)$a), (float)sqrt(1 - (float) $a)); + return (float)sqrt((float)pow((float)$dist, 2) + pow((float) $lat1 - (float)$lat2, 2)); + } + else // normal + { + $alpha = (float)sin((float)toRadians((float) $lat2 - (float) $lat1) / 2); + $beta = (float)sin((float)toRadians((float) $lon2 - (float) $lon1) / 2); + //Distance in meters + $a = (float) ( (float)$alpha * (float)$alpha) + (float) ( (float)cos( (float)toRadians($lat1)) * (float)cos( (float)toRadians($lat2)) * (float)$beta * (float)$beta ); + $dist = 2 * 6369628.75 * (float)atan2((float)sqrt((float)$a), (float)sqrt(1 - (float) $a)); + $d = (float)sqrt((float)pow((float)$dist, 2) + pow((float) $lat1 - (float)$lat2, 2)); + return sqrt((float)pow((float)$ele1-(float)$ele2,2)+(float)pow((float)$d,2)); + } + } function my_date_diff($old_date, $new_date) {