/xmlgooglemaps.php

  1. <?php 
  2. /** 
  3. Plugin Name: XML Google Maps 
  4. Plugin URI: http://www.matusz.ch/blog/projekte/xml-google-maps-wordpress-plugin/ 
  5. Feed URI: http://www.matusz.ch/blog/tags/xml-google-maps-wp-plugin/feed/ 
  6. Description: This plugin allows you to easily insert Google Map or Google Earth Plugin Maps into your blog. Supports KML, KMZ, GPX, geoRSS filelinks. Supports Dfeault, Satellite, Hybrid, Physical and Google Earth Plugin Maptypes 
  7. Version: 1.9 
  8. Author: Patrick Matusz 
  9. Author URI: http://www.matusz.ch/blog/ 
  10. */ 
  11.  
  12. global $wpdb; 
  13.  
  14. $wpdb->xmlgooglemapsdb = $table_prefix . 'xmlgooglemaps'; 
  15.  
  16. // Defining Options 
  17. define("key_xmlgm_uid", "xmlgm_uid", true); 
  18. define("xmlgm_uid_default", "(none)", true); 
  19. define("key_xmlgm_width", "xmlgm_width", true); 
  20. define("xmlgm_width_default", "664", true); 
  21. define("key_xmlgm_height", "xmlgm_height", true); 
  22. define("xmlgm_height_default", "400", true); 
  23. define("key_xmlgm_align", "xmlgm_align", true); 
  24. define("xmlgm_align_default", "left", true); 
  25. define("key_xmlgm_urldisplaymode", "xmlgm_urldisplaymode", true); 
  26. define("xmlgm_urldisplaymode_default", "title", true); 
  27. define("key_xmlgm_viewstyle", "xmlgm_viewstyle", true); 
  28. define("xmlgm_viewstyle_default", "G_NORMAL_MAP", true); 
  29. define("key_xmlgm_panzoomcontrol", "xmlgm_panzoomcontrol", true); 
  30. define("xmlgm_panzoomcontrol_default", "large", true); 
  31. define("key_xmlgm_overviewmap", "xmlgm_overviewmap", true); 
  32. define("xmlgm_overviewmap_default", "hide", true); 
  33. define("key_xmlgm_scalecontrol", "xmlgm_scalecontrol", true); 
  34. define("xmlgm_scalecontrol_default", "hide", true); 
  35. define("key_xmlgm_maptypecontrol", "xmlgm_maptypecontrol", true); 
  36. define("xmlgm_maptypecontrol_default", "show", true); 
  37. define("key_xmlgm_mapnorm", "xmlgm_mapnorm", true); 
  38. define("xmlgm_mapnorm_default", "show", true); 
  39. define("key_xmlgm_maphyb", "xmlgm_maphyb", true); 
  40. define("xmlgm_maphyb_default", "show", true); 
  41. define("key_xmlgm_mapsat", "xmlgm_mapsat", true); 
  42. define("xmlgm_mapsat_default", "show", true); 
  43. define("key_xmlgm_mapphy", "xmlgm_mapphy", true); 
  44. define("xmlgm_mapphy_default", "hide", true); 
  45. define("key_xmlgm_mapearth", "xmlgm_mapearth", true); 
  46. define("xmlgm_mapearth_default", "hide", true); 
  47. define("key_xmlgm_dragging", "xmlgm_dragging", true); 
  48. define("xmlgm_dragging_default", "enabled", true); 
  49. define("key_xmlgm_doubleClickZoom", "xmlgm_doubleClickZoom", true); 
  50. define("xmlgm_doubleClickZoom_default", "enabled", true); 
  51. define("key_xmlgm_continuousZoom", "xmlgm_continuousZoom", true); 
  52. define("xmlgm_continuousZoom_default", "enabled", true); 
  53. define("key_xmlgm_googleBar", "xmlgm_googleBar", true); 
  54. define("xmlgm_googleBar_default", "disabled", true); 
  55. define("key_xmlgm_scrollWheelZoom", "xmlgm_scrollWheelZoom", true); 
  56. define("xmlgm_scrollWheelZoom_default", "enabled", true); 
  57. define("key_xmlgm_elevationmeasurement", "xmlgm_elevationmeasurement", true); 
  58. define("xmlgm_elevationmeasurement_default", "metric", true); 
  59. define("key_xmlgm_speedscale", "xmlgm_speedscale", true); 
  60. define("xmlgm_speedscale_default", "level2", true); 
  61.  
  62. //KML Parsing 
  63. define("key_xmlgm_kmlparsing", "xmlgm_kmlparsing", true); 
  64. define("xmlgm_kmlparsing_default", "enabled", true); 
  65.  
  66. //GPX Options 
  67. define("key_xmlgm_linecolor", "xmlgm_linecolor", true); 
  68. define("xmlgm_linecolor_default", "#0000FF", true); 
  69. define("key_xmlgm_linewidth", "xmlgm_linewidth", true); 
  70. define("xmlgm_linewidth_default", "5", true); 
  71. define("key_xmlgm_lineopacity", "xmlgm_lineopacity", true); 
  72. define("xmlgm_lineopacity_default", "50", true); 
  73. define("key_xmlgm_gpxview", "xmlgm_gpxview", true); 
  74. define("xmlgm_gpxview_default", "all", true); 
  75. define("key_xmlgm_gpxcssstyle", "xmlgm_gpxcssstyle", true); 
  76. define("xmlgm_gpxcssstyle_default", "font-family: Verdana, Arial, Sans-Serif;", true); 
  77. define("key_xmlgm_gpxdirectopenwplink", "xmlgm_gpxdirectopenwplink", true); 
  78. define("xmlgm_gpxdirectopenwplink_default", "dblclick", true); 
  79.  
  80. //Elevation Options 
  81. define("key_xmlgm_elevationheight", "xmlgm_elevationheight", true); 
  82. define("xmlgm_elevationheight_default", "200", true); 
  83. define("key_xmlgm_elevlinecolor", "xmlgm_elevlinecolor", true); 
  84. define("xmlgm_elevlinecolor_default", "#0000FF", true); 
  85. define("key_xmlgm_elevationchart", "xmlgm_elevationchart", true); 
  86. define("xmlgm_elevationchart_default", "show", true); 
  87. define("key_xmlgm_elelinewidth", "xmlgm_elelinewidth", true); 
  88. define("xmlgm_elelinewidth_default", "5", true); 
  89. define("key_xmlgm_elevationtitle", "xmlgm_elevationtitle", true); 
  90. define("xmlgm_elevationtitle_default", "Elevation Profile", true); 
  91.  
  92. //Speed Options 
  93. define("key_xmlgm_speedheight", "xmlgm_speedheight", true); 
  94. define("xmlgm_speedheight_default", "200", true); 
  95. define("key_xmlgm_speedlinecolor", "xmlgm_speedlinecolor", true); 
  96. define("xmlgm_speedlinecolor_default", "#0000FF", true); 
  97. define("key_xmlgm_speedchart", "xmlgm_speedchart", true); 
  98. define("xmlgm_speedchart_default", "hide", true); 
  99. define("key_xmlgm_speedlinewidth", "xmlgm_speedlinewidth", true); 
  100. define("xmlgm_speedlinewidth_default", "5", true); 
  101. define("key_xmlgm_speedcharttitle", "xmlgm_speedcharttitle", true); 
  102. define("xmlgm_speedcharttitle_default", "Speed Profile", true); 
  103.  
  104. //Check Point Options 
  105. define("key_xmlgm_checkpointmapmarkercolor", "xmlgm_checkpointmapmarkercolor", true); 
  106. define("xmlgm_checkpointmapmarkercolor_default", "red", true); 
  107. define("key_xmlgm_checkpointtable", "xmlgm_checkpointtable", true); 
  108. define("xmlgm_checkpointtable_default", "hide", true); 
  109. define("key_xmlgm_checkpointinterval", "xmlgm_checkpointinterval", true); 
  110. define("xmlgm_checkpointinterval_default", "0", true); 
  111.  
  112. //Templates 
  113. define("key_xmlgm_checkpointtabletempl", "xmlgm_checkpointtabletempl", true); 
  114. define("xmlgm_checkpointtabletempl_default", "", true); 
  115. define("key_xmlgm_checkpointtablerowtempl", "xmlgm_checkpointtablerowtempl", true); 
  116. define("xmlgm_checkpointtablerowtempl_default", "", true); 
  117. define("key_xmlgm_gpxmarkertempl", "xmlgm_gpxmarkertempl", true); 
  118. define("xmlgm_gpxmarkertempl_default", "", true); 
  119. define("key_xmlgm_nggmarkertempl", "xmlgm_nggmarkertempl", true); 
  120. define("xmlgm_nggmarkertempl_default", "", true); 
  121.  
  122.  
  123. add_option(key_xmlgm_dragging, xmlgm_dragging_default, 'Enables/Disables Dragging on Google Map'); 
  124. add_option(key_xmlgm_doubleClickZoom, xmlgm_doubleClickZoom_default, 'Enables/Disables Double Click Zoom on Google Map'); 
  125. add_option(key_xmlgm_continuousZoom, xmlgm_continuousZoom_default, 'Enables/Disables Continuous Zoom on Google Map'); 
  126. add_option(key_xmlgm_googleBar, xmlgm_googleBar_default, 'Enables/Disables Google Bar on Google Map'); 
  127. add_option(key_xmlgm_scrollWheelZoom, xmlgm_scrollWheelZoom_default, 'Enables/Disables Scroll Wheel Zoom on Google Map'); 
  128. add_option(key_xmlgm_uid, xmlgm_uid_default, 'Your Google Maps API Key'); 
  129. add_option(key_xmlgm_width, xmlgm_width_default, 'Width of your Google Map'); 
  130. add_option(key_xmlgm_height, xmlgm_height_default, 'Height of your Google Map'); 
  131. add_option(key_xmlgm_align, xmlgm_align_default, 'Align of your Google Map'); 
  132. add_option(key_xmlgm_linecolor, xmlgm_linecolor_default, 'Default Line Color of Tracks and Routes'); 
  133. add_option(key_xmlgm_urldisplaymode, xmlgm_urldisplaymode_default, 'Default display mode for URL'); 
  134. add_option(key_xmlgm_viewstyle, xmlgm_viewstyle_default, 'Default style for MAP'); 
  135. add_option(key_xmlgm_linewidth, xmlgm_linewidth_default, 'Default Line Width of Tracks and Routes'); 
  136. add_option(key_xmlgm_lineopacity, xmlgm_lineopacity_default, 'Default Line Opacity of Tracks and Routes'); 
  137. add_option(key_xmlgm_gpxview, xmlgm_gpxview_default, 'Default GPX View Mode'); 
  138. add_option(key_xmlgm_panzoomcontrol, xmlgm_panzoomcontrol_default, 'Pan/Zoom Control'); 
  139. add_option(key_xmlgm_overviewmap, xmlgm_overviewmap_default, 'Overview Map Control'); 
  140. add_option(key_xmlgm_scalecontrol, xmlgm_scalecontrol_default, 'Scale Control'); 
  141. add_option(key_xmlgm_maptypecontrol, xmlgm_maptypecontrol_default, 'Map Type Control'); 
  142. add_option(key_xmlgm_elevlinecolor, xmlgm_elevlinecolor_default, 'Elevation Chart Line Color'); 
  143. add_option(key_xmlgm_elevationchart, xmlgm_elevationchart_default, 'Visibility of Elevation Chart'); 
  144. add_option(key_xmlgm_elelinewidth, xmlgm_elelinewidth_default, 'Elevation Chart Line Width'); 
  145. add_option(key_xmlgm_elevationheight, xmlgm_elevationheight_default, 'Height of Elevation Chart'); 
  146. add_option(key_xmlgm_elevationmeasurement, xmlgm_elevationmeasurement_default, 'Measurement type everything'); 
  147. add_option(key_xmlgm_gpxcssstyle, xmlgm_gpxcssstyle_default, 'GPX Waypoint CSS Style of Title and Description'); 
  148. add_option(key_xmlgm_mapnorm, xmlgm_mapnorm_default, 'Shows/Hides Normal Map Button if Map Type Control is shown'); 
  149. add_option(key_xmlgm_mapsat, xmlgm_mapsat_default, 'Shows/Hides Satellite Map Button if Map Type Control is shown'); 
  150. add_option(key_xmlgm_maphyb, xmlgm_maphyb_default, 'Shows/Hides Hybrid Map Button if Map Type Control is shown'); 
  151. add_option(key_xmlgm_mapphy, xmlgm_mapphy_default, 'Shows/Hides Physical Map Button if Map Type Control is shown'); 
  152. add_option(key_xmlgm_mapearth, xmlgm_mapearth_default, 'Shows/Hides Google Earth Map Button if Map Type Control is shown'); 
  153. add_option(key_xmlgm_speedlinecolor, xmlgm_speedlinecolor_default, 'Speed Chart Line Color'); 
  154. add_option(key_xmlgm_speedchart, xmlgm_speedchart_default, 'Visibility of Speed Chart'); 
  155. add_option(key_xmlgm_speedlinewidth, xmlgm_speedlinewidth_default, 'Speed Chart Line Width'); 
  156. add_option(key_xmlgm_speedheight, xmlgm_speedheight_default, 'Height of Speed Chart'); 
  157. add_option(key_xmlgm_speedscale, xmlgm_speedscale_default, 'Speed Scale'); 
  158. add_option(key_xmlgm_elevationtitle, xmlgm_elevationtitle_default, 'Title of Elevation Chart'); 
  159. add_option(key_xmlgm_speedcharttitle, xmlgm_speedcharttitle_default, 'Title of Speed Chart'); 
  160. add_option(key_xmlgm_checkpointmapmarkercolor, xmlgm_checkpointmapmarkercolor_default, 'Checkpoint Marker Color on map'); 
  161. add_option(key_xmlgm_checkpointtable, xmlgm_checkpointtable_default, 'Shows/Hides a checkpoint table'); 
  162. add_option(key_xmlgm_checkpointinterval, xmlgm_checkpointinterval_default, 'Defines the default Checkpoint Interval (0=hide)'); 
  163. add_option(key_xmlgm_checkpointtablerowtempl, xmlgm_checkpointtablerowtempl_default, 'HTML Template for the Checkpoint Table Row'); 
  164. add_option(key_xmlgm_checkpointtabletempl, xmlgm_checkpointtabletempl_default, 'HTML Template for the Checkpoint Table'); 
  165. add_option(key_xmlgm_kmlparsing, xmlgm_kmlparsing_default, 'Enables/Disables KML parsing for correct view!'); 
  166. add_option(key_xmlgm_gpxmarkertempl, xmlgm_gpxmarkertempl_default, 'HTML Template for the GPX Marker'); 
  167. add_option(key_xmlgm_nggmarkertempl, xmlgm_nggmarkertempl_default, 'HTML Template for the NextGen Gallery Marker'); 
  168. add_option(key_xmlgm_gpxdirectopenwplink, xmlgm_gpxdirectopenwplink_default, 'If this option is set to click or doubleclick, this effect on marker will open the link in the GPX Waypoint Element!'); 
  169.  
  170.  
  171. //Actions & Filters 
  172. add_filter('the_content', 'xmlgooglemaps_converter', 2); 
  173. add_filter('upload_mimes', 'xmlgooglemaps_mimes'); 
  174. add_action('admin_menu', 'add_xmlgm_option_page'); 
  175.  
  176. //Add Option Page 
  177. function add_xmlgm_option_page() { 
  178. global $wpdb; 
  179. add_options_page('XML Google Maps Options', 'XML Google Maps', 8, basename(__FILE__), 'xmlgm_options_page'); 
  180.  
  181. function xmlgooglemaps_converter($content) { 
  182. global $wpdb; 
  183.  
  184. require_once(dirname(__FILE__).'/xmlgooglemaps_helper.php'); 
  185.  
  186. dbinstall(); 
  187.  
  188. //$content = str_replace("\n", "####nnnn####", $content); 
  189. //$content = str_replace("\r", "####rrrr####", $content); 
  190.  
  191. //GPX 
  192. $content = xmlgooglemaps_converter_gpx($content); 
  193.  
  194. //KMX 
  195. $content = xmlgooglemaps_converter_kmx($content); 
  196.  
  197. // Google Maps Meine Karten: http://maps.google.com/maps/ms?ie=UTF8&hl=de&msa=0&output=nl&msid=102758581694521177745.00000111d56d20b14f816 
  198. $content = xmlgooglemaps_converter_GoogleMaps($content); 
  199.  
  200. // Picasa Maps 
  201. $content = xmlgooglemaps_converter_Picasa($content); 
  202.  
  203. //XML Google Maps Parts 
  204. $content = xmlgooglemaps_converter_myxmlgm($content); 
  205.  
  206. //$content = str_replace("####nnnn####", "\n", $content); 
  207. //$content = str_replace("####rrrr####", "\r", $content); 
  208.  
  209. return $content; 
  210.  
  211. function xmlgooglemaps_mimes($mimes) { 
  212. $mime_types = array ('gpx' => 'application/gpx', 'kml' => 'application/vnd.google-earth.kml+xml', 'kmz' => 'application/vnd.google-earth.kmz+xml'); 
  213. return array_merge($mimes, $mime_types); 
  214.  
  215. function dbinstall() { 
  216. global $wpdb; 
  217. if (!gmxml_tableexists($wpdb->xmlgooglemapsdb)) { 
  218. $create_sql = "CREATE TABLE $wpdb->xmlgooglemapsdb (". 
  219. "xml_id INT(11) NOT NULL auto_increment, ". 
  220. "xml_path TEXT NOT NULL , ". 
  221. "xml_path_resolved TEXT NOT NULL , ". 
  222. "PRIMARY KEY (xml_id))"; 
  223. $wpdb->query($create_sql); 
  224. if (!gmxml_columnexists($wpdb->xmlgooglemapsdb, "xml_varstring")) { 
  225. $column_sql = "ALTER TABLE $wpdb->xmlgooglemapsdb ADD COLUMN xml_varstring TEXT NOT NULL;"; 
  226. $wpdb->query($column_sql); 
  227.  
  228. function xmlgooglemaps_converter_Picasa($content) { 
  229.  
  230. preg_match_all('/\<a(.*?)href=["\'](http:\/\/picasaweb\.google\.[a-z\.]*\/data\/feed\/base\/user\/[a-zA-Z0-9\/:\-\., _?&=;]*?)["\'](.*?)\>(.*?)\<\/a\>/i', $content, $found); 
  231.  
  232. for ($i=0; $i< count($found[0]);$i++) { 
  233. $file = $found[2][$i]; 
  234. $file = str_replace("&", "&", $file); 
  235. $file_resolved = $file; 
  236.  
  237. $displayurl = $found[0][$i]; 
  238. $urlstring = $found[4][$i]; 
  239.  
  240. $iurlstring = stripos($urlstring, "["); 
  241. if ($iurlstring !== false) { 
  242. $jurlstring = stripos($urlstring, "]", $iurlstring); 
  243. $iurlstring += 1; 
  244. $varstring = substr($urlstring, $iurlstring, $jurlstring-$iurlstring); 
  245. } else { 
  246. $varstring = ""; 
  247.  
  248. $params = new xml_gm_params(); 
  249. $params->setParams($varstring); 
  250.  
  251. $displayurl = getDisplayURL($params->urlDisplayMode, $displayurl, $varstring); 
  252.  
  253. if (strtolower($params->urlDisplayMode) == "nomap") { 
  254. $content = str_replace($found[0][$i], $displayurl, $content); 
  255. } else { 
  256. $mygooglemapid = getid($file, $file_resolved, $varstring); 
  257. $content = str_replace($found[0][$i], '<div style="text-align: '.$params->align.';"><iframe src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?mygooglemapid='.$mygooglemapid.'" style="border: 0px; width: '.$params->width.'px; height: '.$params->height.'px;" name="Google_My_Map" frameborder="0"></iframe></div>'.$displayurl, $content); 
  258. return $content; 
  259.  
  260. function xmlgooglemaps_converter_GoogleMaps($content) { 
  261.  
  262. preg_match_all('/\<a(.*?)href=["\'](http:\/\/maps\.google\.[a-z\.]*\/maps\/ms[a-zA-Z0-9\/:\-\., _?&=;]*?)["\'](.*?)\>(.*?)\<\/a\>/i', $content, $found); 
  263.  
  264. for ($i=0; $i< count($found[0]);$i++) { 
  265. $file = $found[2][$i]; 
  266. $file = str_replace("&", "&", $file); 
  267.  
  268. if (stripos(strtolower($file), "msid=") !== false) { 
  269.  
  270. if (stripos(strtolower($file), "output=") === false) { 
  271. $file .= "&output=nl"; 
  272.  
  273. $file_resolved = $file; 
  274.  
  275. $displayurl = $found[0][$i]; 
  276. $urlstring = $found[4][$i]; 
  277.  
  278. $iurlstring = stripos($urlstring, "["); 
  279. if ($iurlstring !== false) { 
  280. $jurlstring = stripos($urlstring, "]", $iurlstring); 
  281. $iurlstring += 1; 
  282. $varstring = substr($urlstring, $iurlstring, $jurlstring-$iurlstring); 
  283. } else { 
  284. $varstring = ""; 
  285.  
  286. $params = new xml_gm_params(); 
  287. $params->setParams($varstring); 
  288. $displayurl = getDisplayURL($params->urlDisplayMode, $displayurl, $varstring); 
  289. if (strtolower($params->urlDisplayMode) == "nomap") { 
  290. $content = str_replace($found[0][$i], $displayurl, $content); 
  291. } else { 
  292. $mygooglemapid = getid($file, $file_resolved, $varstring); 
  293. $content = str_replace($found[0][$i], '<div style="text-align: '.$params->align.';"><iframe src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?mygooglemapid='.$mygooglemapid.'" style="border: 0px; width: '.$params->width.'px; height: '.$params->height.'px;" name="Google_My_Map" frameborder="0"></iframe></div>'.$displayurl, $content); 
  294. } else { 
  295. $content = str_replace($found[0][$i], '<p style="color: red;"><b>Error in displaying map:</b><br />I think your link to the My Google Maps is not correct. Please have a look at the following image:<br /><img src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/help01.jpg" /><br />You have to save your Google Map first!</p>'.$displayurl, $content); 
  296. return $content; 
  297.  
  298. function xmlgooglemaps_converter_kmx($content) { 
  299. preg_match_all('/\<a(.*?)href=["\']([a-zA-Z0-9\/:\-\._]*?.km[lz])["\'](.*?)\>(.*?)\<\/a\>/i', $content, $found); 
  300.  
  301. for ($i=0; $i< count($found[0]);$i++) { 
  302. $file = $found[2][$i]; 
  303.  
  304. $plugins=get_option('active_plugins'); 
  305. $pluginpath= ""; 
  306. for ($j=0; $j<count($plugins); $j++) { 
  307. if (stripos($plugins[$j], "xmlgooglemaps.php") > 0) { 
  308. $pluginpath = dirname(PLUGINDIR."/".$plugins[$j]); 
  309. break; 
  310. $surl = get_option('siteurl'); 
  311. $spath = preg_replace('|/'.$pluginpath.'.*|i', '', dirname(__FILE__)); 
  312.  
  313. $file_resolved = $file; 
  314.  
  315. if (stripos($file, $surl)==0) { 
  316. $newres = str_replace($surl, $spath, $file); 
  317. if (file_exists($newres)) { 
  318. $file_resolved = $newres; 
  319.  
  320. $displayurl = $found[0][$i]; 
  321. $urlstring = $found[4][$i]; 
  322. $iurlstring = stripos($urlstring, "["); 
  323. if ($iurlstring !== false) { 
  324. $jurlstring = stripos($urlstring, "]", $iurlstring); 
  325. $iurlstring += 1; 
  326. $varstring = substr($urlstring, $iurlstring, $jurlstring-$iurlstring); 
  327. } else { 
  328. $varstring = ""; 
  329.  
  330. $params = new xml_gm_params(); 
  331. $params->setParams($varstring); 
  332. $displayurl = getDisplayURL($params->urlDisplayMode, $displayurl, $varstring); 
  333. if (strtolower($params->urlDisplayMode) == "nomap") { 
  334. $content = str_replace($found[0][$i], $displayurl, $content); 
  335. } else { 
  336. $kmlid = getid($file, $file_resolved, $varstring); 
  337. $content = str_replace($found[0][$i], '<div style="text-align: '.$params->align.';"><iframe src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?kmlid='.$kmlid.'" style="border: 0px; width: '.$params->width.'px; height: '.$params->height.'px;" name="Google_KML_Maps" frameborder="0"></iframe></div>'.$displayurl, $content); 
  338. return $content; 
  339.  
  340. function xmlgooglemaps_converter_myxmlgm($content) { 
  341. preg_match_all('/\[xmlgm(.*?)\]/i', $content, $found); 
  342. for ($i=0; $i< count($found[0]);$i++) { 
  343. $varstring = str_replace("[xmlgm", "", $found[0][$i]); 
  344. $varstring = str_replace("]", "", $varstring); 
  345. $varstring = trim($varstring); 
  346.  
  347. //Support added for any other GeoXML [xmlgm {url} parameter] 
  348. $pathi = stripos($varstring, "{"); 
  349. $pathj = stripos($varstring, "}"); 
  350.  
  351. if (($pathi !== false) && ($pathj !== false)) { 
  352. $path = trim(substr($varstring, $pathi+1, $pathj-$pathi-1)); 
  353. $varstring = trim(substr($varstring, 0, $pathi).substr($varstring, $pathj+1)); 
  354.  
  355. $params = new xml_gm_params(); 
  356. $params->setParams($varstring); 
  357.  
  358. if (strtolower($params->urlDisplayMode) != "nomap") { 
  359. $myid = getid($path, $path, $varstring); 
  360.  
  361. $content = str_replace($found[0][$i], '<div style="text-align: '.$params->align.';"><iframe src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?myid='.$myid.'" style="border: 0px; width: '.$params->width.'px; height: '.$params->height.'px;" name="My_XML_Google_Maps" frameborder="0"></iframe></div>', $content); 
  362.  
  363. return $content; 
  364.  
  365. function xmlgooglemaps_converter_gpx($content) { 
  366. preg_match_all('/\<a(.*?)href=["\']([a-zA-Z0-9\/:\-\._]*?.gpx)["\'](.*?)\>(.*?)\<\/a\>/i', $content, $found); 
  367. //preg_match_all('/\<a([^\>]*?)href=["\']([a-zA-Z0-9\/:\-\._]*?.gpx)["\']([^\>]*?)\>(.*?)\<\/a\>/i', $content, $found); 
  368. // print("<!-- "); 
  369. // print_r($found); 
  370. // print(" -->"); 
  371. for ($i=0; $i< count($found[0]);$i++) { 
  372. $file = $found[2][$i]; 
  373.  
  374. $plugins=get_option('active_plugins'); 
  375. $pluginpath= ""; 
  376. for ($j=0; $j<count($plugins); $j++) { 
  377. if (stripos($plugins[$j], "xmlgooglemaps.php") > 0) { 
  378. $pluginpath = dirname(PLUGINDIR."/".$plugins[$j]); 
  379. break; 
  380. $surl = get_option('siteurl'); 
  381. $spath = preg_replace('|/'.$pluginpath.'.*|i', '', dirname(__FILE__)); 
  382.  
  383. $file_resolved = $file; 
  384. if (stripos($file, $surl)==0) { 
  385. $newres = str_replace($surl, $spath, $file); 
  386. if (file_exists($newres)) { 
  387. $file_resolved = $newres; 
  388.  
  389. $urlstring = $found[4][$i]; 
  390. $iurlstring = stripos($urlstring, "["); 
  391. $displayurl = $found[0][$i]; 
  392. if ($iurlstring !== false) { 
  393. $jurlstring = stripos($urlstring, "]", $iurlstring); 
  394. $iurlstring += 1; 
  395. $varstring = substr($urlstring, $iurlstring, $jurlstring-$iurlstring); 
  396. } else { 
  397. $varstring = ""; 
  398.  
  399. $params = new xml_gm_params(); 
  400. $params->setParams($varstring); 
  401. $displayurl = getDisplayURL($params->urlDisplayMode, $displayurl, $varstring); 
  402. if (strtolower($params->urlDisplayMode) == "nomap") { 
  403. $content = str_replace($found[0][$i], $displayurl, $content); 
  404. } else { 
  405. $gpxid = getid($file, $file_resolved, $varstring); 
  406.  
  407. //Altitudes / Speed Charts 
  408. $altstring = ""; 
  409. $speedstring = ""; 
  410. $cptabstring = ""; 
  411. if (($params->gpxElevationChart == "show") || ($params->gpxSpeedChart == "show") || ($params->gpxCheckpointTable == "show") ) { 
  412. require_once(dirname(__FILE__).'/xmlgooglemaps_gpxParser.php'); 
  413. require_once(dirname(__FILE__).'/xmlgooglemaps_googleChartsAPI.php'); 
  414. $gpxfile = new gpxParser(); 
  415. $gpxfile->parse($file_resolved); 
  416. $gpxdata = $gpxfile->output; 
  417. if (($params->gpxView == "all") || ($params->gpxView == "trk")) { 
  418. $trkmax = $gpxdata["trk_count"]; 
  419. $x_ele = array(); 
  420. $y_ele = array(); 
  421. $dist_speed = array(); 
  422. $time_speed = array(); 
  423. $ptcount = 0; 
  424. $dist = 0; 
  425. for ($trkcount=0;$trkcount<$trkmax; $trkcount++) { 
  426. $trkptmax=$gpxdata["trk".$trkcount]["trkpt_count"]; 
  427. for ($trkptcount=0;$trkptcount<$trkptmax; $trkptcount++) { 
  428. $pt = $gpxdata["trk".$trkcount]["trkpt".$trkptcount]; 
  429. if ($ptcount==0) { 
  430. $lat1 = floatval($pt["lat"]); 
  431. $lon1 = floatval($pt["lon"]); 
  432. $time1 = myFunctions::xmlDate2DateTime($pt["time"]); 
  433. $lat2 = floatval($pt["lat"]); 
  434. $lon2 = floatval($pt["lon"]); 
  435. $time2 = myFunctions::xmlDate2DateTime($pt["time"]); 
  436. $tmp = myFunctions::distBetween2PointsKM($lat1, $lon1, $lat2, $lon2); 
  437. if (!is_nan($tmp)) { 
  438. $dist += $tmp; 
  439. if (($tmp>0) && ($time2-$time1>0)) { 
  440. $dist_speed[] = $tmp; 
  441. $time_speed[] = $time2-$time1; 
  442. switch ($params->measurement) { 
  443. case "imperial": 
  444. $x_ele[] = $dist/1.609344; 
  445. $y_ele[] = $pt["ele"]/0.3048;  
  446. break; 
  447. case "nautic_imperial": 
  448. $x_ele[] = $dist/1.852216; 
  449. $y_ele[] = $pt["ele"]/0.3048;  
  450. break; 
  451. case "nautic_metric": 
  452. $x_ele[] = $dist/1.852216; 
  453. $y_ele[] = $pt["ele"];  
  454. break; 
  455. case "metric": 
  456. default: 
  457. $x_ele[] = $dist; 
  458. $y_ele[] = $pt["ele"];  
  459. break; 
  460. $lat1 = $lat2; 
  461. $lon1 = $lon2; 
  462. $time1 = $time2; 
  463. $ptcount++; 
  464. if ($dist>0) { 
  465. if ($params->gpxElevationChart == "show") { 
  466. $alt = new googleChartsApi_PMPro($x_ele, $y_ele); 
  467. $altstring .= '<img style="text-align: '.$params->align.'; margin: 0px; padding: 0px; max-width: 100%;" src="'.$alt->getEleUrl($params->width, $params->gpxElevationChartHeight, $params->gpxElevationLineColor, $params->gpxElevationLineWidth, $params->measurement, $params->gpxElevationChartTitle, $params->gpxCheckpointInterval).'" /><br />'; 
  468. if ($params->gpxSpeedChart == "show") { 
  469. $newdist=0; 
  470. $newtime=0; 
  471. $newtotaldist=0; 
  472. $x_speed = array(); 
  473. $y_speed = array(); 
  474. for ($spi=0;$spi<count($dist_speed); $spi++) { 
  475. $newdist += $dist_speed[$spi]; 
  476. $newtotaldist += $dist_speed[$spi]; 
  477. $newtime += $time_speed[$spi]; 
  478. switch (strtolower($params->measurement.$params->speedscale)) { 
  479. case "imperiallevel2": 
  480. $x_speed[] = $newtotaldist/1.609344; 
  481. $y_speed[] = ($newdist/1.609344) / ($newtime/3600); 
  482. break; 
  483. case "imperiallevel1": 
  484. $x_speed[] = $newtotaldist/1.609344; 
  485. $y_speed[] = ($newdist/0.3048) / ($newtime); 
  486. break; 
  487. case "metriclevel1": 
  488. $x_speed[] = $newtotaldist; 
  489. $y_speed[] = ($newdist*1000) / ($newtime); 
  490. break; 
  491. case "nautic_metriclevel1": 
  492. case "nautic_metriclevel2": 
  493. case "nautic_imperiallevel1": 
  494. case "nautic_imperiallevel2":  
  495. $x_speed[] = $newtotaldist/1.852216; 
  496. $y_speed[] = ($newdist/1.852216) / ($newtime/3600); 
  497. break; 
  498. default: 
  499. case "metriclevel2": 
  500. $x_speed[] = $newtotaldist; 
  501. $y_speed[] = ($newdist) / ($newtime/3600); 
  502. break; 
  503. $newdist=0; 
  504. $newtime=0; 
  505. $sp = new googleChartsApi_PMPro($x_speed, $y_speed, 0); 
  506. $speedstring .= '<img style="text-align: '.$params->align.'; margin: 0px; padding: 0px; max-width: 100%;" src="'.$sp->getSpeedUrl($params->width, $params->gpxSpeedChartHeight, $params->gpxSpeedLineColor, $params->gpxSpeedLineWidth, $params->measurement, $params->speedscale, $params->gpxSpeedChartTitle, $params->gpxCheckpointInterval).'" /><br />'; 
  507. if ($params->gpxCheckpointTable == "show") { 
  508. $cptabstring = $params->gpxCheckpointTableTemplate; 
  509. $cptabstring = str_replace("%WIDTH%", $params->width, $cptabstring); 
  510. //Vorbereiten des Masssystems 
  511. switch ($params->measurement) { 
  512. case "imperial": 
  513. $divident = 1.609344; 
  514. $measurement = "mi"; 
  515. $divident2 = 0.3048; 
  516. $measurement2 = "ft"; 
  517. if ($params->speedscale == "level1") { 
  518. $scale = "fps"; 
  519. } else { 
  520. $scale = "mph"; 
  521. break; 
  522. case "nautic_metric":  
  523. $divident = 1.852216; 
  524. $measurement = "nm"; 
  525. $divident2 = 1; 
  526. $measurement2 = "m"; 
  527. $scale = "kn"; 
  528. break; 
  529. case "nautic_imperial":  
  530. $divident = 1.852216; 
  531. $measurement = "nm"; 
  532. $divident2 = 0.3048; 
  533. $measurement2 = "ft"; 
  534. $scale = "kn"; 
  535. break; 
  536. default: 
  537. $divident = 1; 
  538. $measurement = "km"; 
  539. $divident2 = 1; 
  540. $measurement2 = "m"; 
  541. if ($params->speedscale == "level1") { 
  542. $scale = "m/s"; 
  543. } else { 
  544. $scale = "km/s"; 
  545. break; 
  546. //Initialisierung 
  547. $trkmax = $gpxdata["trk_count"]; 
  548. $nextcheckpointnumber=1;  
  549. $dist = 0; 
  550. $lastdist=0; 
  551. $totaltime = 0; 
  552. $lasttotaltime=0; 
  553. $movingtime = 0;  
  554. $lastmovingtime = 0;  
  555. $lastpt = ""; 
  556. $maxpartspeed = 0; 
  557. $maxspeed = 0; 
  558. $partclimbup = 0; 
  559. $climbup = 0; 
  560. $partclimbdown = 0; 
  561. $climbdown = 0; 
  562. $checkpointnumber = 1; 
  563. //Trackpunkte durchgehen 
  564. for ($trkcount=0;$trkcount<$trkmax; $trkcount++) { 
  565. $trkptmax=$gpxdata["trk".$trkcount]["trkpt_count"]; 
  566. for ($trkptcount=0;$trkptcount<$trkptmax; $trkptcount+=$params->gpxInterval) { 
  567. $pt = $gpxdata["trk".$trkcount]["trkpt".$trkptcount]; 
  568. if (($params->gpxCheckpointInterval>0)) { 
  569. if (($trkcount > 0) || ($trkptcount>0)) { 
  570. //2. - n-1. Punkt 
  571. $deltatime = myFunctions::xmlDate2DateTime($pt["time"])-myFunctions::xmlDate2DateTime($lastpt["time"]); 
  572. $deltadist = myFunctions::distBetween2PointsKM(floatval($lastpt["lat"]), floatval($lastpt["lon"]), floatval($pt["lat"]), floatval($pt["lon"])); 
  573. //Zeit und Distanz (Durchschnittsgeschwindigkeit) 
  574. $totaltime += $deltatime; 
  575. $dist += $deltadist; 
  576. //Zeit (nur falls eine Distanz zur*ckgelegt wurde) 
  577. if ($deltadist!=0) { 
  578. $movingtime += $deltatime; 
  579. //Max Speed 
  580. $maxpartspeed = max(myFunctions::getSpeed($params->measurement, $params->speedscale, $deltadist, $deltatime), $maxpartspeed); 
  581. $maxspeed = max($maxpartspeed, $maxspeed); 
  582. //H*henmeter 
  583. $elediff = (intval($pt["ele"])-intval($lastpt["ele"]))/ $divident2; 
  584. if ($elediff>0) { 
  585. $climbup += $elediff; 
  586. $partclimbup += $elediff; 
  587. } else { 
  588. $climbdown -= $elediff; 
  589. $partclimbdown -= $elediff; 
  590. if ($dist/$divident>$nextcheckpointnumber*$params->gpxCheckpointInterval) { 
  591. $cpadd=""; 
  592. $cptabstringrow = $params->gpxCheckpointTableRowTemplate; 
  593. $cptabstringrow = str_replace("%MARKERIMAGEURL%" , get_option('siteurl').'/wp-content/plugins/xml-google-maps/mm_20_'.$params->gpxCheckpointMarkerColor.$cpadd.'.png', $cptabstringrow); 
  594.  
  595. $cptabstringrow = str_replace("%DISTANCE%" , sprintf("%01.3f", $dist/$divident).' '.$measurement, $cptabstringrow); 
  596. $cptabstringrow = str_replace("%PARTDISTANCE%" , sprintf("%01.3f", ($dist-$lastdist)/$divident).' '.$measurement, $cptabstringrow); 
  597. $cptabstringrow = str_replace("%TIME%" , myFunctions::seconds2Text($totaltime), $cptabstringrow); 
  598. $cptabstringrow = str_replace("%PARTTIME%" , myFunctions::seconds2Text($totaltime-$lasttotaltime), $cptabstringrow); 
  599. $cptabstringrow = str_replace("%MOVINGTIME%" , myFunctions::seconds2Text($movingtime), $cptabstringrow); 
  600. $cptabstringrow = str_replace("%PARTMOVINGTIME%" , myFunctions::seconds2Text($movingtime-$lastmovingtime), $cptabstringrow); 
  601. $cptabstringrow = str_replace("%SPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $totaltime), $cptabstringrow); 
  602. $cptabstringrow = str_replace("%PARTSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $totaltime-$lasttotaltime), $cptabstringrow); 
  603. $cptabstringrow = str_replace("%MOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $movingtime), $cptabstringrow); 
  604. $cptabstringrow = str_replace("%PARTMOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $movingtime-$lastmovingtime), $cptabstringrow);  
  605. $cptabstringrow = str_replace("%MAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxspeed), $cptabstringrow); 
  606. $cptabstringrow = str_replace("%PARTMAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxpartspeed), $cptabstringrow); 
  607. $cptabstringrow = str_replace("%CHECKPOINTNUMBER%" , $checkpointnumber++, $cptabstringrow); 
  608. $cptabstringrow = str_replace("%CLIMBUP%" , round($climbup, 0).' '.$measurement2, $cptabstringrow); 
  609. $cptabstringrow = str_replace("%CLIMBDOWN%" , round($climbdown, 0).' '.$measurement2, $cptabstringrow); 
  610. $cptabstringrow = str_replace("%PARTCLIMBUP%" , round($partclimbup, 0).' '.$measurement2, $cptabstringrow); 
  611. $cptabstringrow = str_replace("%PARTCLIMBDOWN%" , round($partclimbdown, 0).' '.$measurement2, $cptabstringrow); 
  612. $cptabstring = str_replace("%ROW%", $cptabstringrow."%ROW%", $cptabstring); 
  613. $nextcheckpointnumber = floor(($dist/$divident) / $params->gpxCheckpointInterval) + 1; 
  614. $lastdist = $dist; 
  615. $lasttotaltime = $totaltime; 
  616. $lastmovingtime = $movingtime; 
  617. $maxpartspeed = 0; 
  618. $partclimbdown = 0; 
  619. $partclimbup = 0; 
  620. } else { 
  621. //1. Punkt 
  622. $cpadd="_s"; 
  623. $cptabstringrow = $params->gpxCheckpointTableRowTemplate; 
  624. $cptabstringrow = str_replace("%MARKERIMAGEURL%" , get_option('siteurl').'/wp-content/plugins/xml-google-maps/mm_20_'.$params->gpxCheckpointMarkerColor.$cpadd.'.png', $cptabstringrow); 
  625. $cptabstringrow = str_replace("%DISTANCE%" , sprintf("%01.3f", $dist/$divident).' '.$measurement, $cptabstringrow); 
  626. $cptabstringrow = str_replace("%PARTDISTANCE%" , sprintf("%01.3f", ($dist-$lastdist)/$divident).' '.$measurement, $cptabstringrow); 
  627. $cptabstringrow = str_replace("%TIME%" , myFunctions::seconds2Text($totaltime), $cptabstringrow); 
  628. $cptabstringrow = str_replace("%PARTTIME%" , myFunctions::seconds2Text($totaltime-$lasttotaltime), $cptabstringrow); 
  629. $cptabstringrow = str_replace("%MOVINGTIME%" , myFunctions::seconds2Text($movingtime), $cptabstringrow); 
  630. $cptabstringrow = str_replace("%PARTMOVINGTIME%" , myFunctions::seconds2Text($movingtime-$lastmovingtime), $cptabstringrow);  
  631. $cptabstringrow = str_replace("%SPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $totaltime), $cptabstringrow); 
  632. $cptabstringrow = str_replace("%PARTSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $totaltime-$lasttotaltime), $cptabstringrow); 
  633. $cptabstringrow = str_replace("%MOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $movingtime), $cptabstringrow); 
  634. $cptabstringrow = str_replace("%PARTMOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $movingtime-$lastmovingtime), $cptabstringrow);  
  635. $cptabstringrow = str_replace("%MAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxspeed), $cptabstringrow); 
  636. $cptabstringrow = str_replace("%PARTMAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxpartspeed), $cptabstringrow); 
  637. $cptabstringrow = str_replace("%CHECKPOINTNUMBER%" , $checkpointnumber++, $cptabstringrow); 
  638. $cptabstringrow = str_replace("%CLIMBUP%" , '-', $cptabstringrow); 
  639. $cptabstringrow = str_replace("%CLIMBDOWN%" , '-', $cptabstringrow); 
  640. $cptabstringrow = str_replace("%PARTCLIMBUP%" , '-', $cptabstringrow); 
  641. $cptabstringrow = str_replace("%PARTCLIMBDOWN%" , '-', $cptabstringrow); 
  642. $cptabstring = str_replace("%ROW%", $cptabstringrow."%ROW%", $cptabstring); 
  643. $lastpt = $pt; 
  644. if (($params->gpxCheckpointInterval>0)) { 
  645. //Letzter Punkt, falls noch notwendig! 
  646. $cpadd="_e"; 
  647. $cptabstringrow = $params->gpxCheckpointTableRowTemplate; 
  648. $cptabstringrow = str_replace("%MARKERIMAGEURL%" , get_option('siteurl').'/wp-content/plugins/xml-google-maps/mm_20_'.$params->gpxCheckpointMarkerColor.$cpadd.'.png', $cptabstringrow); 
  649. $cptabstringrow = str_replace("%DISTANCE%" , sprintf("%01.3f", $dist/$divident).' '.$measurement, $cptabstringrow); 
  650. $cptabstringrow = str_replace("%PARTDISTANCE%" , sprintf("%01.3f", ($dist-$lastdist)/$divident).' '.$measurement, $cptabstringrow); 
  651. $cptabstringrow = str_replace("%TIME%" , myFunctions::seconds2Text($totaltime), $cptabstringrow); 
  652. $cptabstringrow = str_replace("%PARTTIME%" , myFunctions::seconds2Text($totaltime-$lasttotaltime), $cptabstringrow); 
  653. $cptabstringrow = str_replace("%MOVINGTIME%" , myFunctions::seconds2Text($movingtime), $cptabstringrow); 
  654. $cptabstringrow = str_replace("%PARTMOVINGTIME%" , myFunctions::seconds2Text($movingtime-$lastmovingtime), $cptabstringrow);  
  655. $cptabstringrow = str_replace("%SPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $totaltime), $cptabstringrow); 
  656. $cptabstringrow = str_replace("%PARTSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $totaltime-$lasttotaltime), $cptabstringrow); 
  657. $cptabstringrow = str_replace("%MOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $movingtime), $cptabstringrow); 
  658. $cptabstringrow = str_replace("%PARTMOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist-$lastdist, $movingtime-$lastmovingtime), $cptabstringrow);  
  659. $cptabstringrow = str_replace("%MAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxspeed), $cptabstringrow); 
  660. $cptabstringrow = str_replace("%PARTMAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxpartspeed), $cptabstringrow); 
  661. $cptabstringrow = str_replace("%CHECKPOINTNUMBER%" , $checkpointnumber++, $cptabstringrow); 
  662. $cptabstringrow = str_replace("%CLIMBUP%" , round($climbup, 0).' '.$measurement2, $cptabstringrow); 
  663. $cptabstringrow = str_replace("%CLIMBDOWN%" , round($climbdown, 0).' '.$measurement2, $cptabstringrow); 
  664. $cptabstringrow = str_replace("%PARTCLIMBUP%" , round($partclimbup, 0).' '.$measurement2, $cptabstringrow); 
  665. $cptabstringrow = str_replace("%PARTCLIMBDOWN%" , round($partclimbdown, 0).' '.$measurement2, $cptabstringrow); 
  666. $cptabstring = str_replace("%ROW%", $cptabstringrow."%ROW%", $cptabstring); 
  667. //Endbehandlung 
  668. $cptabstring = str_replace("%DISTANCE%" , sprintf("%01.3f", $dist/$divident).' '.$measurement, $cptabstring); 
  669. $cptabstring = str_replace("%TIME%" , myFunctions::seconds2Text($totaltime), $cptabstring); 
  670. $cptabstring = str_replace("%MOVINGTIME%" , myFunctions::seconds2Text($movingtime), $cptabstring); 
  671. $cptabstring = str_replace("%SPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $totaltime), $cptabstring); 
  672. $cptabstring = str_replace("%MOVINGSPEED%" , myFunctions::getSpeedString($params->measurement, $params->speedscale, $dist, $movingtime), $cptabstring); 
  673. $cptabstring = str_replace("%MAXSPEED%" , myFunctions::getSpeedString2($params->measurement, $params->speedscale, $maxspeed), $cptabstring);  
  674. $cptabstring = str_replace("%CLIMBUP%" , round($climbup, 0).' '.$measurement2, $cptabstring); 
  675. $cptabstring = str_replace("%CLIMBDOWN%" , round($climbdown, 0).' '.$measurement2, $cptabstring); 
  676. $cptabstring = str_replace("%PARTCLIMBUP%" , round($partclimbup, 0).' '.$measurement2, $cptabstring); 
  677. $cptabstring = str_replace("%PARTCLIMBDOWN%" , round($partclimbdown, 0).' '.$measurement2, $cptabstring); 
  678. $cptabstring = $cptabstring = str_replace("%ROW%", "", $cptabstring);; 
  679. $repstring = '<div style="text-align: '.$params->align.';">'; 
  680. $repstring .= '<iframe src="'.get_option('siteurl').'/wp-content/plugins/xml-google-maps/xmlgooglemaps_show.php?gpxid='.$gpxid.'" style="border: 0px; width: '.$params->width.'px; height: '.$params->height.'px;" name="Google_Gpx_Maps" frameborder="0">'; 
  681. $repstring .= '</iframe></div>'.$altstring.$speedstring.$cptabstring.$displayurl.''; 
  682. $content = str_replace($found[0][$i], $repstring, $content); 
  683. return $content; 
  684.  
  685. function gmxml_tableexists($tablename) { 
  686. global $wpdb; 
  687. foreach ($wpdb->get_col("SHOW TABLES", 0) as $table ) { 
  688. if ($table == $tablename) { 
  689. return true; 
  690. return false; 
  691.  
  692. function gmxml_columnexists($tablename, $columnname) { 
  693. global $wpdb; 
  694. foreach ($wpdb->get_col("DESC $tablename", 0) as $column ) { 
  695. if ($column == $columnname) { 
  696. return true; 
  697. return false; 
  698.  
  699. function getid($path, $resolvedpath, $varstring) { 
  700. global $wpdb; 
  701. // Check IP From IP Logging Database 
  702. $ret = $wpdb->get_var("SELECT xml_id FROM $wpdb->xmlgooglemapsdb WHERE xml_path = '$path' AND xml_path_resolved = '$resolvedpath' AND xml_varstring = '$varstring'"); 
  703. if ($ret == 0) { 
  704. $wpdb->query("INSERT INTO $wpdb->xmlgooglemapsdb (xml_path, xml_path_resolved, xml_varstring) VALUES ('$path', '$resolvedpath', '$varstring')"); 
  705. $ret = getid($path, $resolvedpath, $varstring); 
  706. return intval($ret); 
  707.  
  708.  
  709. //Optiona Page 
  710. function xmlgm_options_page() { 
  711. global $wpdb; 
  712. require_once(dirname(__FILE__).'/xmlgooglemaps_helper.php'); 
  713. // If we are a postback, store the options 
  714. if (isset($_POST['info_update'])) { 
  715. check_admin_referer(); 
  716.  
  717. // Google Maps API 
  718. $xmlgm_uid = $_POST[key_xmlgm_uid]; 
  719. if ($xmlgm_uid == '') 
  720. $xmlgm_uid = xmlgm_uid_default; 
  721. update_option(key_xmlgm_uid, $xmlgm_uid); 
  722.  
  723. //Width 
  724. $xmlgm_width = intval($_POST[key_xmlgm_width]); 
  725. if ($xmlgm_width == 0) 
  726. $xmlgm_width = xmlgm_width_default; 
  727. update_option(key_xmlgm_width, $xmlgm_width); 
  728.  
  729. //Height 
  730. $xmlgm_height = intval($_POST[key_xmlgm_height]); 
  731. if ($xmlgm_height == 0) 
  732. $xmlgm_height = xmlgm_height_default; 
  733. update_option(key_xmlgm_height, $xmlgm_height); 
  734.  
  735. // IFrame Align 
  736. $xmlgm_align = $_POST[key_xmlgm_align]; 
  737. if ($xmlgm_align == '') 
  738. $xmlgm_align = xmlgm_align_default; 
  739. update_option(key_xmlgm_align, $xmlgm_align); 
  740.  
  741. // Line Color 
  742. $xmlgm_linecolor = myFunctions::colorName2Hex($_POST[key_xmlgm_linecolor]); 
  743. if ($xmlgm_linecolor == '') 
  744. $xmlgm_linecolor = xmlgm_linecolor_default; 
  745. update_option(key_xmlgm_linecolor, $xmlgm_linecolor); 
  746.  
  747. // Elevation Line Color 
  748. $xmlgm_elelinecolor = myFunctions::colorName2Hex($_POST[key_xmlgm_elevlinecolor]); 
  749. if ($xmlgm_elelinecolor == '') 
  750. $xmlgm_elelinecolor = xmlgm_elevlinecolor_default; 
  751. update_option(key_xmlgm_elevlinecolor, $xmlgm_elelinecolor); 
  752.  
  753. // Elevation Chart Visibility 
  754. $xmlgm_elevationchart = $_POST[key_xmlgm_elevationchart]; 
  755. if ($xmlgm_elevationchart == '') 
  756. $xmlgm_elevationchart = xmlgm_elevationchart_default; 
  757. update_option(key_xmlgm_elevationchart, $xmlgm_elevationchart); 
  758.  
  759. //Elevation Line Width 
  760. $xmlgm_elelinewidth = intval($_POST[key_xmlgm_elelinewidth]); 
  761. if ($xmlgm_elelinewidth == 0) 
  762. $xmlgm_elelinewidth = xmlgm_elelinewidth_default; 
  763. update_option(key_xmlgm_elelinewidth, $xmlgm_elelinewidth); 
  764.  
  765. // Speed Line Color 
  766. $xmlgm_speedlinecolor = myFunctions::colorName2Hex($_POST[key_xmlgm_speedlinecolor]); 
  767. if ($xmlgm_speedlinecolor == '') 
  768. $xmlgm_speedlinecolor = xmlgm_speedlinecolor_default; 
  769. update_option(key_xmlgm_speedlinecolor, $xmlgm_speedlinecolor); 
  770.  
  771. // Speed Chart Visibility 
  772. $xmlgm_speedchart = $_POST[key_xmlgm_speedchart]; 
  773. if ($xmlgm_speedchart == '') 
  774. $xmlgm_speedchart = xmlgm_speedchart_default; 
  775. update_option(key_xmlgm_speedchart, $xmlgm_speedchart); 
  776.  
  777. //Speed Line Width 
  778. $xmlgm_speedlinewidth = intval($_POST[key_xmlgm_speedlinewidth]); 
  779. if ($xmlgm_speedlinewidth == 0) 
  780. $xmlgm_speedlinewidth = xmlgm_speedlinewidth_default; 
  781. update_option(key_xmlgm_speedlinewidth, $xmlgm_speedlinewidth); 
  782.  
  783. // URL Display Mode 
  784. $xmlgm_urldisplaymode = $_POST[key_xmlgm_urldisplaymode]; 
  785. if ($xmlgm_urldisplaymode == '') 
  786. $xmlgm_urldisplaymode = xmlgm_urldisplaymode_default; 
  787. update_option(key_xmlgm_urldisplaymode, $xmlgm_urldisplaymode); 
  788.  
  789. //Map View Style 
  790. $xmlgm_viewstyle = $_POST[key_xmlgm_viewstyle]; 
  791. if ($xmlgm_viewstyle == '') 
  792. $xmlgm_viewstyle = xmlgm_viewstyle_default; 
  793. update_option(key_xmlgm_viewstyle, $xmlgm_viewstyle); 
  794.  
  795. //Line Width 
  796. $xmlgm_linewidth = intval($_POST[key_xmlgm_linewidth]); 
  797. if ($xmlgm_linewidth == 0) 
  798. $xmlgm_linewidth = xmlgm_linewidth_default; 
  799. update_option(key_xmlgm_linewidth, $xmlgm_linewidth); 
  800.  
  801. //Elevation Height 
  802. $xmlgm_eleheight = intval($_POST[key_xmlgm_elevationheight]); 
  803. if ($xmlgm_eleheight == 0) 
  804. $xmlgm_eleheight = xmlgm_elevationheight_default; 
  805. update_option(key_xmlgm_elevationheight, $xmlgm_eleheight); 
  806.  
  807. //Elevation Height 
  808. $xmlgm_speedheight = intval($_POST[key_xmlgm_speedheight]); 
  809. if ($xmlgm_speedheight == 0) 
  810. $xmlgm_speedheight = xmlgm_speedheight_default; 
  811. update_option(key_xmlgm_speedheight, $xmlgm_speedheight); 
  812.  
  813. //Line Opacity 
  814. $xmlgm_lineopacity = intval($_POST[key_xmlgm_lineopacity]); 
  815. if (($xmlgm_lineopacity < 0) || ($xmlgm_lineopacity > 100)) 
  816. $xmlgm_lineopacity = xmlgm_lineopacity_default; 
  817. update_option(key_xmlgm_lineopacity, $xmlgm_lineopacity); 
  818.  
  819. //GPX View Style 
  820. $xmlgm_gpxview = $_POST[key_xmlgm_gpxview]; 
  821. if ($xmlgm_gpxview == '') 
  822. $xmlgm_gpxview = xmlgm_gpxview_default; 
  823. update_option(key_xmlgm_gpxview, $xmlgm_gpxview); 
  824.  
  825. //Pan/Zoom Control 
  826. $xmlgm_panzoomcontrol = $_POST[key_xmlgm_panzoomcontrol]; 
  827. if ($xmlgm_panzoomcontrol == '') 
  828. $xmlgm_panzoomcontrol = xmlgm_panzoomcontrol_default; 
  829. update_option(key_xmlgm_panzoomcontrol, $xmlgm_panzoomcontrol); 
  830.  
  831. //Overview Map Control 
  832. $xmlgm_overviewmap = $_POST[key_xmlgm_overviewmap]; 
  833. if ($xmlgm_overviewmap == '') 
  834. $xmlgm_overviewmap = xmlgm_overviewmap_default; 
  835. update_option(key_xmlgm_overviewmap, $xmlgm_overviewmap); 
  836.  
  837. //Scale Control 
  838. $xmlgm_scalecontrol = $_POST[key_xmlgm_scalecontrol]; 
  839. if ($xmlgm_scalecontrol == '') 
  840. $xmlgm_scalecontrol = xmlgm_scalecontrol_default; 
  841. update_option(key_xmlgm_scalecontrol, $xmlgm_scalecontrol); 
  842.  
  843. //Map Type Control 
  844. $xmlgm_maptypecontrol = $_POST[key_xmlgm_maptypecontrol]; 
  845. if ($xmlgm_maptypecontrol == '') 
  846. $xmlgm_maptypecontrol = xmlgm_maptypecontrol_default; 
  847. update_option(key_xmlgm_maptypecontrol, $xmlgm_maptypecontrol); 
  848.  
  849. //Measurement Type 
  850. $xmlgm_elevationmeasurement = $_POST[key_xmlgm_elevationmeasurement]; 
  851. if ($xmlgm_elevationmeasurement == '') 
  852. $xmlgm_elevationmeasurement = xmlgm_elevationmeasurement_default; 
  853. update_option(key_xmlgm_elevationmeasurement, $xmlgm_elevationmeasurement); 
  854.  
  855. //Speed Scale 
  856. $xmlgm_speedscale = $_POST[key_xmlgm_speedscale]; 
  857. if ($xmlgm_speedscale == '') 
  858. $xmlgm_speedscale = xmlgm_speedscale_default; 
  859. update_option(key_xmlgm_speedscale, $xmlgm_speedscale); 
  860.  
  861. //GPX Waypoint CSS Style 
  862. $xmlgm_gpxcssstyle = $_POST[key_xmlgm_gpxcssstyle]; 
  863. if ($xmlgm_gpxcssstyle == '') 
  864. $xmlgm_gpxcssstyle = xmlgm_gpxcssstyle_default; 
  865. update_option(key_xmlgm_gpxcssstyle, $xmlgm_gpxcssstyle); 
  866.  
  867. //GPX Direct Open Waypoint Link 
  868. $xmlgm_gpxdirectopenwplink = $_POST[key_xmlgm_gpxdirectopenwplink]; 
  869. if ($xmlgm_gpxdirectopenwplink == '') 
  870. $xmlgm_gpxdirectopenwplink = xmlgm_gpxdirectopenwplink_default; 
  871. update_option(key_xmlgm_gpxdirectopenwplink, $xmlgm_gpxdirectopenwplink); 
  872.  
  873. //Map Button Normal 
  874. $xmlgm_mapnorm = $_POST[key_xmlgm_mapnorm]; 
  875. if ($xmlgm_mapnorm == '') 
  876. $xmlgm_mapnorm = xmlgm_mapnorm_default; 
  877. update_option(key_xmlgm_mapnorm, $xmlgm_mapnorm); 
  878.  
  879. //Map Satellite Normal 
  880. $xmlgm_mapsat = $_POST[key_xmlgm_mapsat]; 
  881. if ($xmlgm_mapsat == '') 
  882. $xmlgm_mapsat = xmlgm_mapsat_default; 
  883. update_option(key_xmlgm_mapsat, $xmlgm_mapsat); 
  884.  
  885. //Map Hybrid Normal 
  886. $xmlgm_maphyb = $_POST[key_xmlgm_maphyb]; 
  887. if ($xmlgm_maphyb == '') 
  888. $xmlgm_maphyb = xmlgm_maphyb_default; 
  889. update_option(key_xmlgm_maphyb, $xmlgm_maphyb); 
  890.  
  891. //Map Physical Normal 
  892. $xmlgm_mapphy = $_POST[key_xmlgm_mapphy]; 
  893. if ($xmlgm_mapphy == '') 
  894. $xmlgm_mapphy = xmlgm_mapphy_default; 
  895. update_option(key_xmlgm_mapphy, $xmlgm_mapphy); 
  896.  
  897. //Map Google Earth Plugin 
  898. $xmlgm_mapearth = $_POST[key_xmlgm_mapearth]; 
  899. if ($xmlgm_mapearth == '') 
  900. $xmlgm_mapearth = xmlgm_mapearth_default; 
  901. update_option(key_xmlgm_mapearth, $xmlgm_mapearth); 
  902.  
  903. //Dragging 
  904. $xmlgm_dragging = $_POST[key_xmlgm_dragging]; 
  905. if ($xmlgm_dragging == '') 
  906. $xmlgm_dragging = xmlgm_dragging_default; 
  907. update_option(key_xmlgm_dragging, $xmlgm_dragging); 
  908.  
  909. //Double Click Zoom 
  910. $xmlgm_doubleclickzoom = $_POST[key_xmlgm_doubleClickZoom]; 
  911. if ($xmlgm_doubleclickzoom == '') 
  912. $xmlgm_doubleclickzoom = xmlgm_doubleClickZoom_default; 
  913. update_option(key_xmlgm_doubleClickZoom, $xmlgm_doubleclickzoom); 
  914.  
  915. //Continuous Zoom 
  916. $xmlgm_continuouszoom = $_POST[key_xmlgm_continuousZoom]; 
  917. if ($xmlgm_continuouszoom == '') 
  918. $xmlgm_continuouszoom = xmlgm_continuousZoom_default; 
  919. update_option(key_xmlgm_continuousZoom, $xmlgm_continuouszoom); 
  920.  
  921. //Google Bar 
  922. $xmlgm_googlebar = $_POST[key_xmlgm_googleBar]; 
  923. if ($xmlgm_googlebar == '') 
  924. $xmlgm_googlebar = xmlgm_googleBar_default; 
  925. update_option(key_xmlgm_googleBar, $xmlgm_googlebar); 
  926.  
  927. //Scroll Wheel Zoom 
  928. $xmlgm_scrollwheelzoom = $_POST[key_xmlgm_scrollWheelZoom]; 
  929. if ($xmlgm_scrollwheelzoom == '') 
  930. $xmlgm_scrollwheelzoom = xmlgm_scrollWheelZoom_default; 
  931. update_option(key_xmlgm_scrollWheelZoom, $xmlgm_scrollwheelzoom); 
  932.  
  933. //Elevation Chart Title 
  934. update_option(key_xmlgm_elevationtitle, $_POST[key_xmlgm_elevationtitle]); 
  935.  
  936. //Speed Chart Title 
  937. update_option(key_xmlgm_speedcharttitle, $_POST[key_xmlgm_speedcharttitle]); 
  938.  
  939. //Checkpoint Marker Color 
  940. $xmlgm_cpcol = $_POST[key_xmlgm_checkpointmapmarkercolor]; 
  941. if ($xmlgm_cpcol == '') 
  942. $xmlgm_cpcol = xmlgm_checkpointmapmarkercolor_default; 
  943. update_option(key_xmlgm_checkpointmapmarkercolor, $xmlgm_cpcol); 
  944.  
  945. //Checkpoint Table 
  946. $xmlgm_cptable = $_POST[key_xmlgm_checkpointtable]; 
  947. if ($xmlgm_cptable == '') 
  948. $xmlgm_cptable = xmlgm_checkpointtable_default; 
  949. update_option(key_xmlgm_checkpointtable, $xmlgm_cptable); 
  950.  
  951. //Checkpoint Interval 
  952. $xmlgm_cpint = floatval($_POST[key_xmlgm_checkpointinterval]); 
  953. update_option(key_xmlgm_checkpointinterval, $xmlgm_cpint); 
  954.  
  955. //Checkpoint Table Template 
  956. $xmlgm_cptabletempl = $_POST[key_xmlgm_checkpointtabletempl]; 
  957. if ($xmlgm_cptabletempl == '') { 
  958. $filename = dirname(__FILE__)."/defaultcptable.template"; 
  959. $handle = fopen ($filename, "r"); 
  960. $xmlgm_cptabletempl = fread ($handle, filesize ($filename)); 
  961. fclose ($handle); 
  962. } else { 
  963. $xmlgm_cptabletempl = str_replace('\"', '"', $xmlgm_cptabletempl); 
  964. $xmlgm_cptabletempl = str_replace("\'", "'", $xmlgm_cptabletempl); 
  965. update_option(key_xmlgm_checkpointtabletempl, $xmlgm_cptabletempl); 
  966.  
  967. //Checkpoint Table Row Template 
  968. $xmlgm_cptablerowtempl = $_POST[key_xmlgm_checkpointtablerowtempl]; 
  969. if ($xmlgm_cptablerowtempl == '') { 
  970. $filename = dirname(__FILE__)."/defaultcptablerow.template"; 
  971. $handle = fopen ($filename, "r"); 
  972. $xmlgm_cptablerowtempl = fread ($handle, filesize ($filename)); 
  973. fclose ($handle); 
  974. } else { 
  975. $xmlgm_cptablerowtempl = str_replace('\"', '"', $xmlgm_cptablerowtempl); 
  976. $xmlgm_cptablerowtempl = str_replace("\'", "'", $xmlgm_cptablerowtempl); 
  977. update_option(key_xmlgm_checkpointtablerowtempl, $xmlgm_cptablerowtempl); 
  978.  
  979. //GPX Marker Template 
  980. $xmlgm_gpxmartempl = $_POST[key_xmlgm_gpxmarkertempl]; 
  981. if ($xmlgm_gpxmartempl == '') { 
  982. $filename = dirname(__FILE__)."/defaultgpxmarker.template"; 
  983. $handle = fopen ($filename, "r"); 
  984. $xmlgm_gpxmartempl = fread ($handle, filesize ($filename)); 
  985. fclose ($handle); 
  986. } else { 
  987. $xmlgm_gpxmartempl = str_replace('\"', '"', $xmlgm_gpxmartempl); 
  988. $xmlgm_gpxmartempl = str_replace("\'", "'", $xmlgm_gpxmartempl); 
  989. update_option(key_xmlgm_gpxmarkertempl, $xmlgm_gpxmartempl); 
  990.  
  991. //NGG Marker Template 
  992. $xmlgm_nggmartempl = $_POST[key_xmlgm_nggmarkertempl]; 
  993. if ($xmlgm_nggmartempl == '') { 
  994. $filename = dirname(__FILE__)."/defaultnggmarker.template"; 
  995. $handle = fopen ($filename, "r"); 
  996. $xmlgm_nggmartempl = fread ($handle, filesize ($filename)); 
  997. fclose ($handle); 
  998. } else { 
  999. $xmlgm_nggmartempl = str_replace('\"', '"', $xmlgm_nggmartempl); 
  1000. $xmlgm_nggmartempl = str_replace("\'", "'", $xmlgm_nggmartempl); 
  1001. update_option(key_xmlgm_nggmarkertempl, $xmlgm_nggmartempl);  
  1002.  
  1003. //KML Parsing 
  1004. $xmlgm_kmlparsing = $_POST[key_xmlgm_kmlparsing]; 
  1005. if ($xmlgm_kmlparsing == '') 
  1006. $xmlgm_kmlparsing = xmlgm_kmlparsing_default; 
  1007. update_option(key_xmlgm_kmlparsing, $xmlgm_kmlparsing); 
  1008.  
  1009.  
  1010. // Give an updated message 
  1011. echo "<div class='updated'><p><strong>XML Google Maps options updated</strong></p></div>"; 
  1012. } else { 
  1013. //Default Werte setzen 
  1014. if (strlen(get_option(key_xmlgm_checkpointtabletempl))==0) { 
  1015. $filename = dirname(__FILE__)."/defaultcptable.template"; 
  1016. if (file_exists($filename)) { 
  1017. $handle = fopen ($filename, "r"); 
  1018. $tmp = fread ($handle, filesize ($filename)); 
  1019. fclose ($handle); 
  1020. update_option(key_xmlgm_checkpointtabletempl, $tmp); 
  1021. if (strlen(get_option(key_xmlgm_checkpointtablerowtempl))==0) { 
  1022. $filename = dirname(__FILE__)."/defaultcptablerow.template"; 
  1023. if (file_exists($filename)) { 
  1024. $handle = fopen ($filename, "r"); 
  1025. $tmp = fread ($handle, filesize ($filename)); 
  1026. fclose ($handle); 
  1027. update_option(key_xmlgm_checkpointtablerowtempl, $tmp); 
  1028. if (strlen(get_option(key_xmlgm_gpxmarkertempl))==0) { 
  1029. $filename = dirname(__FILE__)."/defaultgpxmarker.template"; 
  1030. if (file_exists($filename)) { 
  1031. $handle = fopen ($filename, "r"); 
  1032. $tmp = fread ($handle, filesize ($filename)); 
  1033. fclose ($handle); 
  1034. update_option(key_xmlgm_gpxmarkertempl, $tmp); 
  1035. }  
  1036. if (strlen(get_option(key_xmlgm_nggmarkertempl))==0) { 
  1037. $filename = dirname(__FILE__)."/defaultnggmarker.template"; 
  1038. if (file_exists($filename)) { 
  1039. $handle = fopen ($filename, "r"); 
  1040. $tmp = fread ($handle, filesize ($filename)); 
  1041. fclose ($handle); 
  1042. update_option(key_xmlgm_nggmarkertempl, $tmp); 
  1043. }  
  1044. $navigation .= '<td rowspan="100%" width="15%" valign="top">'; 
  1045. $navigation .= '<div style="text-align: right;"><p><b>Navigation:</b><br /><a href="#basic">Basic Options</a><br /><a href="#control">Control Options</a><br /><a href="#maptype">Map Type Options</a><br /><a href="#mapbehaviour">Map Behaviour Options</a><br /><a href="#gpx">GPX Options</a><br /><a href="#elev">Elevation Chart Options</a><br /><a href="#speedchart">Speed Chart Options</a><br /><a href="#checkpoint">Checkpoint Options</a><br /><a href="#templ">Templates</a></p></div>'; 
  1046. $navigation .= '<div style="text-align: right;"><input class="button" type="submit" name="info_update" value="Save Changes" /></div>'; 
  1047. $navigation .= '</td>'; 
  1048. //TIPPS 
  1049. $ngg = new nggFunctions(); 
  1050. $tipps = array(); 
  1051. $tipps[] = "What about a <a href='http://www.matusz.ch/donate_xmlgooglemapswpplugin.htm' target='_blank'>donation</a>! I spent a lot of time in developing this plugin. <a href='http://www.matusz.ch/donate_xmlgooglemapswpplugin.htm' target='_blank'>Donate now</a>!"; 
  1052. $tipps[] = "What about a <a href='http://www.matusz.ch/donate_xmlgooglemapswpplugin.htm' target='_blank'>donation</a>! I spent a lot of time in developing this plugin. <a href='http://www.matusz.ch/donate_xmlgooglemapswpplugin.htm' target='_blank'>Donate now</a>!";  
  1053. if ($ngg->isNggInstalled()) { 
  1054. $tipps[] = "This plugin reads the gps position information out of your <b>NextGEN Gallery</b> Plugin images. Use ngg_gallery=<gallerid> to show the whole geotagged Gallery on your map or use ngg_picture=<picture id> to show a single picture!"; 
  1055. $tipps[] = "Did you know that the <b>NextGEN</b> Parameters can be used more than once to show multiple galleries or pictures? [xmlgml ngg_gallery=1; ngg_gallery=2] will show the first and second gallery images on the map!"; 
  1056. $tipps[] = "This plugin can handle <b><a href='http://www.umapper.com' target='_blank'>umapper.com</a></b> KML links. Try this [xmlgm {<link to the umapper kml file>}] or <a href='http://www.umapper.com/download/maps/kml/xxx.kml&apos>Testmap</a>!"; 
  1057. $tipps[] = "There are a lot of <b>samples</b> how to use this plugin. Have a look at the <a href='http://www.matusz.ch/blog/projekte/xml-google-maps-wordpress-plugin-en/samples/' target='_blank'>English</a> or <a href='http://www.matusz.ch/blog/projekte/xml-google-maps-wordpress-plugin/beispiele/' target='_blank'>German</a> Sample Page!"; 
  1058. $tipps[] = "Did you know that a <b>GeoRSS</b> Feed can be converted into a map with this plugin? Try this [xmlgm {<link to the georss feed>}]!"; 
  1059. $tipps[] = "Try the <b>Google Earth Browser Plugin</b> in the Google Maps API - this rocks! Set the Default Map Type 'Google Earth Plugin'!"; 
  1060. $tipps[] = "Have a look at the Checkpoint Table feature if you're using a GPX file. This feature will extract additional data out of your GPX tracks (Average Speed, Moving Speed, Max Speed, Climbing up, Climbing down, Distances, Moving Time, Time)!";  
  1061. $tipps[] = "This plugin supports metric, imperial and nautical measurement types!"; 
  1062. $tipps[] = "Did the your KML maps won't show at the correct location or without the right zoomlevel? Try to change the KML Parsing parameter!"; 
  1063. $tipps[] = "Check the <a href='#templ'>templates</a> options section! Define the look and feel of your GPX or NextGen Gallery markers!"; 
  1064. $tipps[] = "Did you ever doubleclicked on a GPX Waypoint Marker that has a Link Element? Yes, this plugin will directly open the specified URL in a new window! You want to open the URL by one click or disable this function, no problem: simply set the specific option or parameter to the specific value!"; 
  1065. if (count($tipps)>0) { 
  1066. $tip = "<table class='form-table' cellspacing='2' cellpadding='5' width='100%'><tr><td width='55px'><img src='".get_option('siteurl')."/wp-content/plugins/xml-google-maps/tipp48.png'></td><td>".$tipps[rand(0, count($tipps)-1)]."</td><td width='55px'><img src='".get_option('siteurl')."/wp-content/plugins/xml-google-maps/tipp48.png'></td></tr></table>"; 
  1067. // Output the options page 
  1068. ?> 
  1069. <script type="text/javascript"> 
  1070. <!-- 
  1071. var enabling = function() { 
  1072. if (document.forms['xmlgmform'].<?php echo key_xmlgm_viewstyle; ?>.value=="G_NORMAL_MAP") { 
  1073. document.forms['xmlgmform'].<?php echo key_xmlgm_mapnorm; ?>.value = "show"; 
  1074. document.forms['xmlgmform'].<?php echo key_xmlgm_mapnorm; ?>.disabled = true; 
  1075. } else { 
  1076. document.forms['xmlgmform'].<?php echo key_xmlgm_mapnorm; ?>.disabled = (document.forms['xmlgmform'].<?php echo key_xmlgm_maptypecontrol; ?>.value == "hide"); 
  1077. if (document.forms['xmlgmform'].<?php echo key_xmlgm_viewstyle; ?>.value=="G_HYBRID_MAP") { 
  1078. document.forms['xmlgmform'].<?php echo key_xmlgm_maphyb; ?>.value = "show"; 
  1079. document.forms['xmlgmform'].<?php echo key_xmlgm_maphyb; ?>.disabled = true; 
  1080. } else { 
  1081. document.forms['xmlgmform'].<?php echo key_xmlgm_maphyb; ?>.disabled = (document.forms['xmlgmform'].<?php echo key_xmlgm_maptypecontrol; ?>.value == "hide"); 
  1082. if (document.forms['xmlgmform'].<?php echo key_xmlgm_viewstyle; ?>.value=="G_PHYSICAL_MAP") { 
  1083. document.forms['xmlgmform'].<?php echo key_xmlgm_mapphy; ?>.value = "show"; 
  1084. document.forms['xmlgmform'].<?php echo key_xmlgm_mapphy; ?>.disabled = true; 
  1085. } else { 
  1086. document.forms['xmlgmform'].<?php echo key_xmlgm_mapphy; ?>.disabled = (document.forms['xmlgmform'].<?php echo key_xmlgm_maptypecontrol; ?>.value == "hide"); 
  1087. if (document.forms['xmlgmform'].<?php echo key_xmlgm_viewstyle; ?>.value=="G_SATELLITE_3D_MAP") { 
  1088. document.forms['xmlgmform'].<?php echo key_xmlgm_mapearth; ?>.value = "show"; 
  1089. document.forms['xmlgmform'].<?php echo key_xmlgm_mapearth; ?>.disabled = true; 
  1090. } else { 
  1091. document.forms['xmlgmform'].<?php echo key_xmlgm_mapearth; ?>.disabled = (document.forms['xmlgmform'].<?php echo key_xmlgm_maptypecontrol; ?>.value == "hide"); 
  1092. }  
  1093. if (document.forms['xmlgmform'].<?php echo key_xmlgm_elevationmeasurement; ?>.value == "imperial") { 
  1094. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[0].text = "Foot per second (level1)"  
  1095. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[1].text = "Miles per hour (level2)" 
  1096. if (document.forms['xmlgmform'].<?php echo key_xmlgm_elevationmeasurement; ?>.value == "metric") { 
  1097. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[0].text = "Metre per second (level1)"  
  1098. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[1].text = "Kilometre per hour (level2)"  
  1099. if (document.forms['xmlgmform'].<?php echo key_xmlgm_elevationmeasurement; ?>.value == "nautic_metric") { 
  1100. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[0].text = "Knots (level1)"  
  1101. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[1].text = "Knots (level2)"  
  1102. if (document.forms['xmlgmform'].<?php echo key_xmlgm_elevationmeasurement; ?>.value == "nautic_imperial") { 
  1103. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[0].text = "Knots (level1)"  
  1104. document.forms['xmlgmform'].<?php echo key_xmlgm_speedscale; ?>.options[1].text = "Knots (level2)"  
  1105. }  
  1106. document.forms['xmlgmform'].cpmarker.src = "<?php echo get_option('siteurl'); ?>/wp-content/plugins/xml-google-maps/mm_20_" + document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointmapmarkercolor; ?>.value + ".png"; 
  1107. document.forms['xmlgmform'].cpmarker_start.src = "<?php echo get_option('siteurl'); ?>/wp-content/plugins/xml-google-maps/mm_20_" + document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointmapmarkercolor; ?>.value + "_s.png"; 
  1108. document.forms['xmlgmform'].cpmarker_end.src = "<?php echo get_option('siteurl'); ?>/wp-content/plugins/xml-google-maps/mm_20_" + document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointmapmarkercolor; ?>.value + "_e.png"; 
  1109. //Validation of Checkpoint Table Parameter 
  1110. var tmp = parseFloat(document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointinterval; ?>.value); 
  1111. if (tmp <= 0 || isNaN(tmp)) { 
  1112. document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointtable; ?>.value = "hide"; 
  1113. document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointtable; ?>.disabled = true; 
  1114. } else { 
  1115. document.forms['xmlgmform'].<?php echo key_xmlgm_checkpointtable; ?>.disabled = false; 
  1116. //--> 
  1117. </script> 
  1118. <form method="post" name="xmlgmform" 
  1119. action="options-general.php?page=xmlgooglemaps.php"> 
  1120. <div class="wrap"> 
  1121. <h2>XML Google Maps Options</h2> 
  1122. <?php echo $tip; ?> 
  1123. <h3 style="clear: left;"><a name="basic"></a>Basic Options</h3> 
  1124. <p>First of all you have to get your own Google API Key from the 
  1125. following page <a href="http://code.google.com/apis/maps/signup.html" 
  1126. target="_blank">http://code.google.com/apis/maps/signup.html</a>. Then 
  1127. specify the width, height and align of the google maps plugin in your 
  1128. posts.</p> 
  1129. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1130. <tr> 
  1131. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1132. for="<?php echo key_xmlgm_uid; ?>">Your Google Maps API Key:</label> 
  1133. </th> 
  1134. <td width="50%"><?php 
  1135. echo "<input type='text' size='50' "; 
  1136. echo "name='".key_xmlgm_uid."' "; 
  1137. echo "id='".key_xmlgm_uid."' "; 
  1138. echo "value='".get_option(key_xmlgm_uid)."' />\n"; 
  1139. ?> 
  1140. <p style="margin: 5px 10px;">Enter your Google Maps API Key in this 
  1141. box. You get your Google Maps API Key from <a 
  1142. href="http://code.google.com/apis/maps/signup.html" target="_blank">http://code.google.com/apis/maps/signup.html</a>.</p> 
  1143. </td> 
  1144. <?php echo $navigation; ?> 
  1145. </tr> 
  1146. <tr> 
  1147. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1148. for="<?php echo key_xmlgm_width; ?>">Width:</label></th> 
  1149. <td width="50%"><?php 
  1150. echo "<input type='text' size='50' "; 
  1151. echo "name='".key_xmlgm_width."' "; 
  1152. echo "id='".key_xmlgm_width."' "; 
  1153. echo "value='".get_option(key_xmlgm_width)."' />\n"; 
  1154. ?> 
  1155. <p style="margin: 5px 10px;">Enter the width of your Map on your posts 
  1156. or pages (only numeric value allowed)</p> 
  1157. </td> 
  1158. </tr> 
  1159. <tr> 
  1160. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1161. for="<?php echo key_xmlgm_height; ?>">Height:</label></th> 
  1162. <td width="50%"><?php 
  1163. echo "<input type='text' size='50' "; 
  1164. echo "name='".key_xmlgm_height."' "; 
  1165. echo "id='".key_xmlgm_height."' "; 
  1166. echo "value='".get_option(key_xmlgm_height)."' />\n"; 
  1167. ?> 
  1168. <p style="margin: 5px 10px;">Enter the height of your Map on your 
  1169. posts or pages (only numeric values allowed)</p> 
  1170. </td> 
  1171. </tr> 
  1172. <tr> 
  1173. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1174. for="<?php echo key_xmlgm_align; ?>">Google Map alignement:</label></th> 
  1175. <td width="50%"><?php 
  1176. echo "<select "; 
  1177. echo "name='".key_xmlgm_align."' "; 
  1178. echo "id='".key_xmlgm_align."'>"; 
  1179. switch (get_option(key_xmlgm_align)) 
  1180. case "right": $selright = "selected='selected'"; break; 
  1181. case "center": $selcenter = "selected='selected'"; break; 
  1182. default: $selleft = "selected='selected'"; break; 
  1183. echo "<option value='left' $selleft>Left (left)</option>"; 
  1184. echo "<option value='center' $selcenter>Center (center)</option>"; 
  1185. echo "<option value='right' $selright>Right (right)</option>"; 
  1186. echo "</select>\n"; 
  1187. ?> 
  1188. <p style="margin: 5px 10px;">Specifies the alignement of the map in 
  1189. your posts or pages</p> 
  1190. </td> 
  1191. </tr> 
  1192. <tr> 
  1193. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1194. for="<?php echo key_xmlgm_urldisplaymode; ?>">URL Display Mode:</label> 
  1195. </th> 
  1196. <td width="50%"><?php 
  1197. echo "<select "; 
  1198. echo "name='".key_xmlgm_urldisplaymode."' "; 
  1199. echo "id='".key_xmlgm_urldisplaymode."'>"; 
  1200. switch (get_option(key_xmlgm_urldisplaymode)) 
  1201. case "none": $selnoneud = "selected='selected'"; break; 
  1202. case "showvars": $selvars = "selected='selected'"; break; 
  1203. case "nomap": $selnomap = "selected='selected'"; break; 
  1204. default: $seldefault = "selected='selected'"; break; 
  1205. echo "<option value='title' $seldefault>Map, URL Title without Parameters (title)</option>"; 
  1206. echo "<option value='none' $selnoneud>Map only (none)</option>"; 
  1207. echo "<option value='showvars' $selvars>Map, URL Title and Parameters (showvars)</option>"; 
  1208. echo "<option value='nomap' $selnomap>URL Title without Paramaters and without Map (nomap)</option>"; 
  1209. echo "</select>\n"; 
  1210. ?> 
  1211. <p style="margin: 5px 10px;">Specifies how to tranform the added Link. 
  1212. If you want to completely remove it then select 'Map only'. 
  1213. If you want to remove only the parameters, then select 'Map, URL 
  1214. Title without Parameters'. Orelse if you want to show the whole 
  1215. link as you typed it in then select 'Map, URL Title and 
  1216. Parameters'. If you wan't to disable the plugin by default,  
  1217. select 'URL Title without Paramaters and without Map'!</p> 
  1218. </td> 
  1219. </tr> 
  1220. <tr> 
  1221. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1222. for="<?php echo key_xmlgm_elevationmeasurement; ?>">Measurement Type:</label> 
  1223. </th> 
  1224. <td width="50%"><?php 
  1225. echo "<select onchange='enabling();' "; 
  1226. echo "name='".key_xmlgm_elevationmeasurement."' "; 
  1227. echo "id='".key_xmlgm_elevationmeasurement."'>"; 
  1228. switch (get_option(key_xmlgm_elevationmeasurement)) 
  1229. case "imperial": $selelemimp = "selected='selected'"; break; 
  1230. case "nautic_metric": $selelemnaumet = "selected='selected'"; break; 
  1231. case "nautic_imperial": $selelemnauimp = "selected='selected'"; break; 
  1232. default: $selelemmet = "selected='selected'"; break; 
  1233. echo "<option value='imperial' $selelemimp>Miles / Feet (imperial)</option>"; 
  1234. echo "<option value='metric' $selelemmet>Kilometres / Metres (metric)</option>"; 
  1235. echo "<option value='nautic_metric' $selelemnaumet>Nautical miles (Altitude: metres) (nautic_metric)</option>"; 
  1236. echo "<option value='nautic_imperial' $selelemnauimp>Nautical miles (Altitude: feet) (nautic_imperial)</option>"; 
  1237. echo "</select>\n"; 
  1238. ?> 
  1239. <p style="margin: 5px 10px;">Measurement Type</p> 
  1240. </td> 
  1241. </tr> 
  1242. <tr> 
  1243. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1244. for="<?php echo key_xmlgm_speedscale; ?>">Speed Scale:</label></th> 
  1245. <td width="50%"><?php 
  1246. echo "<select onchange='enabling();' "; 
  1247. echo "name='".key_xmlgm_speedscale."' "; 
  1248. echo "id='".key_xmlgm_speedscale."'>"; 
  1249. switch (get_option(key_xmlgm_speedscale)) 
  1250. case "level1": $selspeedl1 = "selected='selected'"; break; 
  1251. default: $selspeedl2 = "selected='selected'"; break; 
  1252. echo "<option value='level1' $selspeedl1>Level 1 (level2)</option>"; 
  1253. echo "<option value='level2' $selspeedl2>Level 2 (level1)</option>"; 
  1254. echo "</select>\n"; 
  1255. ?> 
  1256. <p style="margin: 5px 10px;">Speed Scale</p> 
  1257. </td> 
  1258. </tr> 
  1259. <tr> 
  1260. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1261. for="<?php echo key_xmlgm_kmlparsing; ?>">KML Parsing:</label></th> 
  1262. <td width="50%"><?php 
  1263. echo "<select "; 
  1264. echo "name='".key_xmlgm_kmlparsing."' "; 
  1265. echo "id='".key_xmlgm_kmlparsing."'>"; 
  1266. switch (get_option(key_xmlgm_kmlparsing)) 
  1267. case "disabled": $selkmlpdis = "selected='selected'"; break; 
  1268. default: $selkmlpen = "selected='selected'"; break; 
  1269. echo "<option value='enabled' $selkmlpen>Enabled (enabled)</option>"; 
  1270. echo "<option value='disabled' $selkmlpdis>Diabled (disabled)</option>"; 
  1271. echo "</select>\n"; 
  1272. ?> 
  1273. <p style="margin: 5px 10px;">Enables/Disables parsing KML files. If this option is set to enabled, this plugin tries to parse the kml file for coordinates, set the center and zoomlevel to the perfect values. Parsing only works for KML links that ends with the file ending .kml, it won't work with the following notation [xmlgm {xyz.kml}]!</p> 
  1274. </td> 
  1275. </tr>  
  1276. </table> 
  1277. <h3><a name="control"></a>Control Options</h3> 
  1278. <p>Define the controls you want to display on your map</p> 
  1279. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1280. <tr> 
  1281. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1282. for="<?php echo key_xmlgm_panzoomcontrol; ?>">Pan/Zoom Control:</label> 
  1283. </th> 
  1284. <td width="50%"><?php 
  1285. echo "<select "; 
  1286. echo "name='".key_xmlgm_panzoomcontrol."' "; 
  1287. echo "id='".key_xmlgm_panzoomcontrol."'>"; 
  1288. switch (get_option(key_xmlgm_panzoomcontrol)) 
  1289. case "hide": $selnonepz = "selected='selected'"; break; 
  1290. case "small": $selsmall = "selected='selected'"; break; 
  1291. case "zoom": $selzoom = "selected='selected'"; break; 
  1292. default: $sellarge = "selected='selected'"; break; 
  1293. echo "<option value='hide' $selnonepz>Invisible (hide)</option>"; 
  1294. echo "<option value='large' $sellarge>Large (large)</option>"; 
  1295. echo "<option value='small' $selsmall>Small (small)</option>"; 
  1296. echo "<option value='zoom' $selzoom>Zoom only (zoom)</option>"; 
  1297. echo "</select>\n"; 
  1298. ?> 
  1299. <p style="margin: 5px 10px;">Specifies the display style of the 
  1300. Pan/Zoom Control</p> 
  1301. </td> 
  1302. <?php echo $navigation; ?> 
  1303. </tr> 
  1304. <tr> 
  1305. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1306. for="<?php echo key_xmlgm_overviewmap; ?>">Overview Map Control:</label> 
  1307. </th> 
  1308. <td width="50%"><?php 
  1309. echo "<select "; 
  1310. echo "name='".key_xmlgm_overviewmap."' "; 
  1311. echo "id='".key_xmlgm_overviewmap."'>"; 
  1312. switch (get_option(key_xmlgm_overviewmap)) 
  1313. case "show": $selshowom = "selected='selected'"; break; 
  1314. default: $selhideom = "selected='selected'"; break; 
  1315. echo "<option value='hide' $selhideom>Invisible (hide)</option>"; 
  1316. echo "<option value='show' $selshowom>Visible (show)</option>"; 
  1317. echo "</select>\n"; 
  1318. ?> 
  1319. <p style="margin: 5px 10px;">Shows/Hides the overview map in the 
  1320. bottom right corner</p> 
  1321. </td> 
  1322. </tr> 
  1323. <tr> 
  1324. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1325. for="<?php echo key_xmlgm_scalecontrol; ?>">Scale Control:</label></th> 
  1326. <td width="50%"><?php 
  1327. echo "<select "; 
  1328. echo "name='".key_xmlgm_scalecontrol."' "; 
  1329. echo "id='".key_xmlgm_scalecontrol."'>"; 
  1330. switch (get_option(key_xmlgm_scalecontrol)) 
  1331. case "show": $selshowsc = "selected='selected'"; break; 
  1332. default: $selhidesc = "selected='selected'"; break; 
  1333. echo "<option value='hide' $selhidesc>Invisible (hide)</option>"; 
  1334. echo "<option value='show' $selshowsc>Visible (show)</option>"; 
  1335. echo "</select>\n"; 
  1336. ?> 
  1337. <p style="margin: 5px 10px;">Shows/Hides the scale ruler in the bottom 
  1338. left corner</p> 
  1339. </td> 
  1340. </tr> 
  1341. </table> 
  1342. <h3><a name="maptype"></a>Map Type Options</h3> 
  1343. <p>This optionset helps you to define all Map Type Option. Even the Map 
  1344. Type Control options you can change.</p> 
  1345. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1346. <tr> 
  1347. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1348. for="<?php echo key_xmlgm_viewstyle; ?>">Default Map Type:</label></th> 
  1349. <td width="50%"><?php 
  1350. echo "<select onchange='enabling();' "; 
  1351. echo "name='".key_xmlgm_viewstyle."' "; 
  1352. echo "id='".key_xmlgm_viewstyle."'>"; 
  1353. switch (get_option(key_xmlgm_viewstyle)) 
  1354. case "G_SATELLITE_TYPE": 
  1355. case "G_SATELLITE_MAP": 
  1356. $selsat = "selected='selected'"; break; 
  1357. case "G_HYBRID_TYPE": 
  1358. case "G_HYBRID_MAP": 
  1359. $selhyb = "selected='selected'"; break; 
  1360. case "G_PHYSICAL_TYPE": 
  1361. case "G_PHYSICAL_MAP": 
  1362. $selphy = "selected='selected'"; break; 
  1363. case "G_SATELLITE_3D_TYPE": 
  1364. case "G_SATELLITE_3D_MAP": 
  1365. $selearth = "selected='selected'"; break; 
  1366. default: 
  1367. $selmap = "selected='selected'"; break; 
  1368. echo "<option value='G_HYBRID_MAP' $selhyb>Hybrid (G_HYBRID_MAP)</option>"; 
  1369. echo "<option value='G_SATELLITE_MAP' $selsat>Satellite (G_SATELLITE_MAP)</option>"; 
  1370. echo "<option value='G_NORMAL_MAP' $selmap>Map (G_NORMAL_MAP)</option>"; 
  1371. echo "<option value='G_PHYSICAL_MAP' $selphy>Physical (G_PHYSICAL_MAP)</option>"; 
  1372. echo "<option value='G_SATELLITE_3D_MAP' $selearth>Google Earth Plugin (G_SATELLITE_3D_MAP)</option>"; 
  1373. echo "</select>\n"; 
  1374. ?> 
  1375. <p style="margin: 5px 10px;">Default Map Display Style</p> 
  1376. </td> 
  1377. <?php echo $navigation; ?> 
  1378. </tr> 
  1379. <tr> 
  1380. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1381. for="<?php echo key_xmlgm_maptypecontrol; ?>">Map Type Control:</label> 
  1382. </th> 
  1383. <td width="50%"><?php 
  1384. echo "<select onchange='enabling();'"; 
  1385. echo "name='".key_xmlgm_maptypecontrol."' "; 
  1386. echo "id='".key_xmlgm_maptypecontrol."'>"; 
  1387. switch (get_option(key_xmlgm_maptypecontrol)) 
  1388. case "hide": $selhidemtc = "selected='selected'"; break; 
  1389. case "hierarchical": $selhidemhier = "selected='selected'"; break; 
  1390. default: $selshowmtc = "selected='selected'"; break; 
  1391. echo "<option value='hide' $selhidemtc>Invisible (hide)</option>"; 
  1392. echo "<option value='show' $selshowmtc>Visible Default (show)</option>"; 
  1393. echo "<option value='hierarchical' $selhidemhier>Visible Hierarchical Control (hierarchical)</option>"; 
  1394. echo "</select>\n"; 
  1395. ?> 
  1396. <p style="margin: 5px 10px;">Show/Hide Map Type Control</p> 
  1397. </td> 
  1398. </tr> 
  1399. <tr> 
  1400. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1401. for="<?php echo key_xmlgm_mapnorm; ?>">Normal Map Type Button:</label> 
  1402. </th> 
  1403. <td width="50%"><?php 
  1404. echo "<select "; 
  1405. echo "name='".key_xmlgm_mapnorm."' "; 
  1406. echo "id='".key_xmlgm_mapnorm."'>"; 
  1407. switch (get_option(key_xmlgm_mapnorm)) 
  1408. case "hide": $selhidemapnorm = "selected='selected'"; break; 
  1409. default: $selshowmapnorm = "selected='selected'"; break; 
  1410. echo "<option value='hide' $selhidemapnorm>Invisible (hide)</option>"; 
  1411. echo "<option value='show' $selshowmapnorm>Visible (show)</option>"; 
  1412. echo "</select>\n"; 
  1413. ?> 
  1414. <p style="margin: 5px 10px;">Show/Hide Normal Map Type Button</p> 
  1415. </td> 
  1416. </tr> 
  1417. <tr> 
  1418. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1419. for="<?php echo key_xmlgm_mapsat; ?>">Satellite Map Type Button:</label> 
  1420. </th> 
  1421. <td width="50%"><?php 
  1422. echo "<select "; 
  1423. echo "name='".key_xmlgm_mapsat."' "; 
  1424. echo "id='".key_xmlgm_mapsat."'>"; 
  1425. switch (get_option(key_xmlgm_mapsat)) 
  1426. case "hide": $selhidemapsat = "selected='selected'"; break; 
  1427. default: $selshowmapsat = "selected='selected'"; break; 
  1428. echo "<option value='hide' $selhidemapsat>Invisible (hide)</option>"; 
  1429. echo "<option value='show' $selshowmapsat>Visible (show)</option>"; 
  1430. echo "</select>\n"; 
  1431. ?> 
  1432. <p style="margin: 5px 10px;">Show/Hide Satellite Map Type Button</p> 
  1433. </td> 
  1434. </tr> 
  1435. <tr> 
  1436. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1437. for="<?php echo key_xmlgm_maphyb; ?>">Hybrid Map Type Button:</label> 
  1438. </th> 
  1439. <td width="50%"><?php 
  1440. echo "<select "; 
  1441. echo "name='".key_xmlgm_maphyb."' "; 
  1442. echo "id='".key_xmlgm_maphyb."'>"; 
  1443. switch (get_option(key_xmlgm_maphyb)) 
  1444. case "hide": $selhidemaphyb = "selected='selected'"; break; 
  1445. default: $selshowmaphyb = "selected='selected'"; break; 
  1446. echo "<option value='hide' $selhidemaphyb>Invisible (hide)</option>"; 
  1447. echo "<option value='show' $selshowmaphyb>Visible (show)</option>"; 
  1448. echo "</select>\n"; 
  1449. ?> 
  1450. <p style="margin: 5px 10px;">Show/Hide Hybrid Map Type Button</p> 
  1451. </td> 
  1452. </tr> 
  1453. <tr> 
  1454. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1455. for="<?php echo key_xmlgm_mapphy; ?>">Physical Map Type Button:</label> 
  1456. </th> 
  1457. <td width="50%"><?php 
  1458. echo "<select "; 
  1459. echo "name='".key_xmlgm_mapphy."' "; 
  1460. echo "id='".key_xmlgm_mapphy."'>"; 
  1461. switch (get_option(key_xmlgm_mapphy)) 
  1462. case "hide": $selhidemapphy = "selected='selected'"; break; 
  1463. default: $selshowmapphy = "selected='selected'"; break; 
  1464. echo "<option value='hide' $selhidemapphy>Invisible (hide)</option>"; 
  1465. echo "<option value='show' $selshowmapphy>Visible (show)</option>"; 
  1466. echo "</select>\n"; 
  1467. ?> 
  1468. <p style="margin: 5px 10px;">Show/Hide Physical Map Type Button</p> 
  1469. </td> 
  1470. </tr> 
  1471. <tr> 
  1472. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1473. for="<?php echo key_xmlgm_mapearth; ?>">Google Earth Plugin Map Type 
  1474. Button:</label></th> 
  1475. <td width="50%"><?php 
  1476. echo "<select "; 
  1477. echo "name='".key_xmlgm_mapearth."' "; 
  1478. echo "id='".key_xmlgm_mapearth."'>"; 
  1479. switch (get_option(key_xmlgm_mapearth)) 
  1480. case "hide": $selhidemapearth = "selected='selected'"; break; 
  1481. default: $selshowmapearth = "selected='selected'"; break; 
  1482. echo "<option value='hide' $selhidemapearth>Invisible (hide)</option>"; 
  1483. echo "<option value='show' $selshowmapearth>Visible (show)</option>"; 
  1484. echo "</select>\n"; 
  1485. ?> 
  1486. <p style="margin: 5px 10px;">Show/Hide Google Earth Plugin Map Type 
  1487. Button</p> 
  1488. </td> 
  1489. </tr> 
  1490. </table> 
  1491. <h3><a name="mapbehaviour"></a>Map Behaviour Options</h3> 
  1492. <p>Customize the behaviour of the map (e.g. zoom behaviours).</p> 
  1493. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1494. <tr> 
  1495. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1496. for="<?php echo key_xmlgm_dragging; ?>">Dragging:</label></th> 
  1497. <td width="50%"><?php 
  1498. echo "<select "; 
  1499. echo "name='".key_xmlgm_dragging."' "; 
  1500. echo "id='".key_xmlgm_dragging."'>"; 
  1501. switch (get_option(key_xmlgm_dragging)) 
  1502. case "disabled": $seldraggingdis = "selected='selected'"; break; 
  1503. default: $seldraggingen = "selected='selected'"; break; 
  1504. echo "<option value='disabled' $seldraggingdis>Disabled (disabled)</option>"; 
  1505. echo "<option value='enabled' $seldraggingen>Enabled (enabled)</option>"; 
  1506. echo "</select>\n"; 
  1507. ?> 
  1508. <p style="margin: 5px 10px;">Enables/Disables the dragging of the map</p> 
  1509. </td> 
  1510. <?php echo $navigation; ?> 
  1511. </tr> 
  1512. <tr> 
  1513. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1514. for="<?php echo key_xmlgm_doubleClickZoom; ?>">Double Click Zoom:</label> 
  1515. </th> 
  1516. <td width="50%"><?php 
  1517. echo "<select "; 
  1518. echo "name='".key_xmlgm_doubleClickZoom."' "; 
  1519. echo "id='".key_xmlgm_doubleClickZoom."'>"; 
  1520. switch (get_option(key_xmlgm_doubleClickZoom)) 
  1521. case "disabled": $seldczdis = "selected='selected'"; break; 
  1522. default: $seldczen = "selected='selected'"; break; 
  1523. echo "<option value='disabled' $seldczdis>Disabled (disabled)</option>"; 
  1524. echo "<option value='enabled' $seldczen>Enabled (enabled)</option>"; 
  1525. echo "</select>\n"; 
  1526. ?> 
  1527. <p style="margin: 5px 10px;">Enables/Disables double click to zoom in 
  1528. and out</p> 
  1529. </td> 
  1530. </tr> 
  1531. <tr> 
  1532. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1533. for="<?php echo key_xmlgm_continuousZoom; ?>">Continuous Zoom:</label> 
  1534. </th> 
  1535. <td width="50%"><?php 
  1536. echo "<select "; 
  1537. echo "name='".key_xmlgm_continuousZoom."' "; 
  1538. echo "id='".key_xmlgm_continuousZoom."'>"; 
  1539. switch (get_option(key_xmlgm_continuousZoom)) 
  1540. case "disabled": $selczdis = "selected='selected'"; break; 
  1541. default: $selczen = "selected='selected'"; break; 
  1542. echo "<option value='disabled' $selczdis>Disabled (disabled)</option>"; 
  1543. echo "<option value='enabled' $selczen>Enabled (enabled)</option>"; 
  1544. echo "</select>\n"; 
  1545. ?> 
  1546. <p style="margin: 5px 10px;">Enables/Disables continuous smooth 
  1547. zooming for select browsers</p> 
  1548. </td> 
  1549. </tr> 
  1550. <tr> 
  1551. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1552. for="<?php echo key_xmlgm_scrollWheelZoom; ?>">Scroll Wheel Zoom:</label> 
  1553. </th> 
  1554. <td width="50%"><?php 
  1555. echo "<select "; 
  1556. echo "name='".key_xmlgm_scrollWheelZoom."' "; 
  1557. echo "id='".key_xmlgm_scrollWheelZoom."'>"; 
  1558. switch (get_option(key_xmlgm_scrollWheelZoom)) 
  1559. case "disabled": $selswzdis = "selected='selected'"; break; 
  1560. default: $selswzen = "selected='selected'"; break; 
  1561. echo "<option value='disabled' $selswzdis>Disabled (disabled)</option>"; 
  1562. echo "<option value='enabled' $selswzen>Enabled (enabled)</option>"; 
  1563. echo "</select>\n"; 
  1564. ?> 
  1565. <p style="margin: 5px 10px;">Enables/Disables zooming using a mouse's 
  1566. scroll wheel</p> 
  1567. </td> 
  1568. </tr> 
  1569. <tr> 
  1570. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1571. for="<?php echo key_xmlgm_googleBar; ?>">Google Bar:</label></th> 
  1572. <td width="50%"><?php 
  1573. echo "<select "; 
  1574. echo "name='".key_xmlgm_googleBar."' "; 
  1575. echo "id='".key_xmlgm_googleBar."'>"; 
  1576. switch (get_option(key_xmlgm_googleBar)) 
  1577. case "enabled": $selgben = "selected='selected'"; break; 
  1578. default: $selgbdis = "selected='selected'"; break; 
  1579. echo "<option value='disabled' $selgbdis>Disabled (disabled)</option>"; 
  1580. echo "<option value='enabled' $selgben>Enabled (enabled)</option>"; 
  1581. echo "</select>\n"; 
  1582. ?> 
  1583. <p style="margin: 5px 10px;">Enables/Disables he GoogleBar, an 
  1584. integrated search control, to the map. When enabled, this control 
  1585. takes the place of the default Powered By Google logo.</p> 
  1586. </td> 
  1587. </tr> 
  1588. </table> 
  1589. <h3><a name="gpx"></a>GPX Options</h3> 
  1590. <p>Settings specific for GPX Files<br />Have a look at the <a href="#templ">Templates</a> Section, there you can set the look & feel of your GPX Waypoint Markers!</p> 
  1591. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1592. <tr> 
  1593. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1594. for="<?php echo key_xmlgm_linecolor; ?>">Line Color:</label></th> 
  1595. <td width="50%"><?php 
  1596. echo "<input type='text' size='50' "; 
  1597. echo "name='".key_xmlgm_linecolor."' "; 
  1598. echo "id='".key_xmlgm_linecolor."' "; 
  1599. echo "value='".get_option(key_xmlgm_linecolor)."' />\n"; 
  1600. ?> 
  1601. <p style="margin: 5px 10px;">Enter the default line color of any Track 
  1602. or Route</p> 
  1603. </td> 
  1604. <?php echo $navigation; ?> 
  1605. </tr> 
  1606. <tr> 
  1607. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1608. for="<?php echo key_xmlgm_linewidth; ?>">Line Width:</label></th> 
  1609. <td width="50%"><?php 
  1610. echo "<input type='text' size='50' "; 
  1611. echo "name='".key_xmlgm_linewidth."' "; 
  1612. echo "id='".key_xmlgm_linewidth."' "; 
  1613. echo "value='".get_option(key_xmlgm_linewidth)."' />\n"; 
  1614. ?> 
  1615. <p style="margin: 5px 10px;">Enter the default line width of any Track 
  1616. or Route</p> 
  1617. </td> 
  1618. </tr> 
  1619. <tr> 
  1620. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1621. for="<?php echo key_xmlgm_lineopacity; ?>">Line Opacity:</label></th> 
  1622. <td width="50%"><?php 
  1623. echo "<input type='text' size='50' "; 
  1624. echo "name='".key_xmlgm_lineopacity."' "; 
  1625. echo "id='".key_xmlgm_lineopacity."' "; 
  1626. echo "value='".get_option(key_xmlgm_lineopacity)."' />\n"; 
  1627. ?> 
  1628. <p style="margin: 5px 10px;">Enter the default line opacity (1-100) of 
  1629. any Track or Route</p> 
  1630. </td> 
  1631. </tr> 
  1632. <tr> 
  1633. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1634. for="<?php echo key_xmlgm_gpxview; ?>">GPX View Style:</label></th> 
  1635. <td width="50%"><?php 
  1636. echo "<select "; 
  1637. echo "name='".key_xmlgm_gpxview."' "; 
  1638. echo "id='".key_xmlgm_gpxview."'>"; 
  1639. switch (get_option(key_xmlgm_gpxview)) 
  1640. case "wpt": $selwpt = "selected='selected'"; break; 
  1641. case "rte": $selrte = "selected='selected'"; break; 
  1642. case "trk": $seltrk = "selected='selected'"; break; 
  1643. default: $selall = "selected='selected'"; break; 
  1644. echo "<option value='all' $selall>Everything (all)</option>"; 
  1645. echo "<option value='wpt' $selwpt>Waypoints (wpt)</option>"; 
  1646. echo "<option value='rte' $selrte>Routes (rte)</option>"; 
  1647. echo "<option value='trk' $seltrk>Tracks (trk)</option>"; 
  1648. echo "</select>\n"; 
  1649. ?> 
  1650. <p style="margin: 5px 10px;">Shows only the selected part of the GPX 
  1651. File.</p> 
  1652. </td> 
  1653. </tr> 
  1654. <tr> 
  1655. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1656. for="<?php echo key_xmlgm_gpxdirectopenwplink; ?>">GPX Direct Open Waypoint Link:</label></th> 
  1657. <td width="50%"><?php 
  1658. echo "<select "; 
  1659. echo "name='".key_xmlgm_gpxdirectopenwplink."' "; 
  1660. echo "id='".key_xmlgm_gpxdirectopenwplink."'>"; 
  1661. switch (get_option(key_xmlgm_gpxdirectopenwplink)) 
  1662. case "disabled": $seldowpdis = "selected='selected'"; break; 
  1663. case "click": $seldowpcli = "selected='selected'"; break; 
  1664. default: $seldowpdbl = "selected='selected'"; break; 
  1665. echo "<option value='dblclick' $seldowpdbl>Doubleclick (dblclick)</option>"; 
  1666. echo "<option value='click' $seldowpcli>Click (click)</option>"; 
  1667. echo "<option value='disabled' $seldowpdis>Disabled (disabled)</option>"; 
  1668. echo "</select>\n"; 
  1669. ?> 
  1670. <p style="margin: 5px 10px;">If a GPX Waypoint has a link-Element you can Doubleclick or Click the marker to directly open this link! If you want to disable this behaviour, set disabled!</p> 
  1671. </td> 
  1672. </tr> 
  1673.  
  1674. <tr> 
  1675. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1676. for="<?php echo key_xmlgm_gpxcssstyle; ?>">Waypoint CSS Style:</label> 
  1677. </th> 
  1678. <td width="50%"><?php 
  1679. echo "<input type='text' size='50' "; 
  1680. echo "name='".key_xmlgm_gpxcssstyle."' "; 
  1681. echo "id='".key_xmlgm_gpxcssstyle."' "; 
  1682. echo "value='".get_option(key_xmlgm_gpxcssstyle)."' />\n"; 
  1683. ?> 
  1684. <p style="margin: 5px 10px;">Define the GPX Waypoints Info Window CSS 
  1685. Style! Have a look at the <a href="#templ">Templates</a> Section, it would be better to use these templates than this property!</p> 
  1686. </td> 
  1687. </tr> 
  1688. </table> 
  1689. <h3><a name="elev"></a>Elevation Chart Options</h3> 
  1690. <p>Settings for the Elevation Chart (now supported by GPX Tracks only)</p> 
  1691. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1692. <tr> 
  1693. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1694. for="<?php echo key_xmlgm_elevationchart; ?>">Elevation Chart:</label> 
  1695. </th> 
  1696. <td width="50%"><?php 
  1697. echo "<select "; 
  1698. echo "name='".key_xmlgm_elevationchart."' "; 
  1699. echo "id='".key_xmlgm_elevationchart."'>"; 
  1700. switch (get_option(key_xmlgm_elevationchart)) 
  1701. case "hide": $selelevhide = "selected='selected'"; break; 
  1702. default: $selelevshow = "selected='selected'"; break; 
  1703. echo "<option value='hide' $selelevhide>Invisible (hide)</option>"; 
  1704. echo "<option value='show' $selelevshow>Visible (show)</option>"; 
  1705. echo "</select>\n"; 
  1706. ?> 
  1707. <p style="margin: 5px 10px;">Visibility of evelation chart for GPX 
  1708. tracks</p> 
  1709. </td> 
  1710. <?php echo $navigation; ?> 
  1711. </tr> 
  1712. <tr> 
  1713. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1714. for="<?php echo key_xmlgm_elevationtitle; ?>">Elevation Chart Title:</label> 
  1715. </th> 
  1716. <td width="50%"><?php 
  1717. echo "<input type='text' size='50' "; 
  1718. echo "name='".key_xmlgm_elevationtitle."' "; 
  1719. echo "id='".key_xmlgm_elevationtitle."' "; 
  1720. echo "value='".get_option(key_xmlgm_elevationtitle)."' />\n"; 
  1721. ?> 
  1722. <p style="margin: 5px 10px;">Enter the Elevation Chart Title (<b>do 
  1723. not use special chars</b>)</p> 
  1724. </td> 
  1725. </tr> 
  1726. <tr> 
  1727. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1728. for="<?php echo key_xmlgm_elevationheight; ?>">Elevation Chart 
  1729. Height:</label></th> 
  1730. <td width="50%"><?php 
  1731. echo "<input type='text' size='50' "; 
  1732. echo "name='".key_xmlgm_elevationheight."' "; 
  1733. echo "id='".key_xmlgm_elevationheight."' "; 
  1734. echo "value='".get_option(key_xmlgm_elevationheight)."' />\n"; 
  1735. ?> 
  1736. <p style="margin: 5px 10px;">Enter the height of the elevation chart!</p> 
  1737. </td> 
  1738. </tr> 
  1739. <tr> 
  1740. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1741. for="<?php echo key_xmlgm_elevlinecolor; ?>">Elevation Chart Line 
  1742. Color:</label></th> 
  1743. <td width="50%"><?php 
  1744. echo "<input type='text' size='50' "; 
  1745. echo "name='".key_xmlgm_elevlinecolor."' "; 
  1746. echo "id='".key_xmlgm_elevlinecolor."' "; 
  1747. echo "value='".get_option(key_xmlgm_elevlinecolor)."' />\n"; 
  1748. ?> 
  1749. <p style="margin: 5px 10px;">Enter the default line color of the 
  1750. elevation charts line!</p> 
  1751. </td> 
  1752. </tr> 
  1753. <tr> 
  1754. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1755. for="<?php echo key_xmlgm_elelinewidth; ?>">Elevation Chart Line 
  1756. Width:</label></th> 
  1757. <td width="50%"><?php 
  1758. echo "<input type='text' size='50' "; 
  1759. echo "name='".key_xmlgm_elelinewidth."' "; 
  1760. echo "id='".key_xmlgm_elelinewidth."' "; 
  1761. echo "value='".get_option(key_xmlgm_elelinewidth)."' />\n"; 
  1762. ?> 
  1763. <p style="margin: 5px 10px;">Enter the default line width of the 
  1764. elevation chart</p> 
  1765. </td> 
  1766. </tr> 
  1767. </table> 
  1768. <h3><a name="speedchart"></a>Speed Chart Options</h3> 
  1769. <p>Settings for the Speed Chart (now supported by GPX Tracks only)</p> 
  1770. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1771. <tr> 
  1772. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1773. for="<?php echo key_xmlgm_speedchart; ?>">Speed Chart:</label></th> 
  1774. <td width="50%"><?php 
  1775. echo "<select "; 
  1776. echo "name='".key_xmlgm_speedchart."' "; 
  1777. echo "id='".key_xmlgm_speedchart."'>"; 
  1778. switch (get_option(key_xmlgm_speedchart)) 
  1779. case "show": $selspeedshow = "selected='selected'"; break; 
  1780. default: $selspeedhide = "selected='selected'"; break; 
  1781. echo "<option value='hide' $selspeedhide>Invisible (hide)</option>"; 
  1782. echo "<option value='show' $selspeedshow>Visible (show)</option>"; 
  1783. echo "</select>\n"; 
  1784. ?> 
  1785. <p style="margin: 5px 10px;">Visibility of speed chart for GPX tracks</p> 
  1786. </td> 
  1787. <?php echo $navigation; ?> 
  1788. </tr> 
  1789. <tr> 
  1790. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1791. for="<?php echo key_xmlgm_speedcharttitle; ?>">Speed Chart Title:</label> 
  1792. </th> 
  1793. <td width="50%"><?php 
  1794. echo "<input type='text' size='50' "; 
  1795. echo "name='".key_xmlgm_speedcharttitle."' "; 
  1796. echo "id='".key_xmlgm_speedcharttitle."' "; 
  1797. echo "value='".get_option(key_xmlgm_speedcharttitle)."' />\n"; 
  1798. ?> 
  1799. <p style="margin: 5px 10px;">Enter the Speed Chart Title (<b>do not 
  1800. use special chars</b>)</p> 
  1801. </td> 
  1802. </tr> 
  1803. <tr> 
  1804. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1805. for="<?php echo key_xmlgm_speedheight; ?>">Speed Chart Height:</label> 
  1806. </th> 
  1807. <td width="50%"><?php 
  1808. echo "<input type='text' size='50' "; 
  1809. echo "name='".key_xmlgm_speedheight."' "; 
  1810. echo "id='".key_xmlgm_speedheight."' "; 
  1811. echo "value='".get_option(key_xmlgm_speedheight)."' />\n"; 
  1812. ?> 
  1813. <p style="margin: 5px 10px;">Enter the height of the speed chart!</p> 
  1814. </td> 
  1815. </tr> 
  1816. <tr> 
  1817. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1818. for="<?php echo key_xmlgm_speedlinecolor; ?>">Speed Chart Line Color:</label> 
  1819. </th> 
  1820. <td width="50%"><?php 
  1821. echo "<input type='text' size='50' "; 
  1822. echo "name='".key_xmlgm_speedlinecolor."' "; 
  1823. echo "id='".key_xmlgm_speedlinecolor."' "; 
  1824. echo "value='".get_option(key_xmlgm_speedlinecolor)."' />\n"; 
  1825. ?> 
  1826. <p style="margin: 5px 10px;">Enter the default line color of the speed 
  1827. charts line!</p> 
  1828. </td> 
  1829. </tr> 
  1830. <tr> 
  1831. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1832. for="<?php echo key_xmlgm_speedlinewidth; ?>">Speed Chart Line Width:</label> 
  1833. </th> 
  1834. <td width="50%"><?php 
  1835. echo "<input type='text' size='50' "; 
  1836. echo "name='".key_xmlgm_speedlinewidth."' "; 
  1837. echo "id='".key_xmlgm_speedlinewidth."' "; 
  1838. echo "value='".get_option(key_xmlgm_speedlinewidth)."' />\n"; 
  1839. ?> 
  1840. <p style="margin: 5px 10px;">Enter the default line width of the speed 
  1841. chart</p> 
  1842. </td> 
  1843. </tr> 
  1844. </table> 
  1845. <h3><a name="checkpoint"></a>Checkpoint Options</h3> 
  1846. <p>Settings for the Checkpoints (now supported by GPX Tracks only). To 
  1847. activate the checkpoint you have to set the 
  1848. gpxcheckpointinterval-Parameter on every map. The 
  1849. gpxcheckpointinterval-parameter defines the interval in km or mi between 
  1850. every checkpoint!<br />Have a look at the <a href="#templ">Templates</a> section, there you can set the look & feel of your Checkpoint Table!</p> 
  1851. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1852.  
  1853. <tr> 
  1854. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1855. for="<?php echo key_xmlgm_checkpointmapmarkercolor; ?>">Checkpoint 
  1856. Map Marker Color:</label></th> 
  1857. <td width="50%"><?php 
  1858. echo "<select onchange='enabling();' "; 
  1859. echo "name='".key_xmlgm_checkpointmapmarkercolor."' "; 
  1860. echo "id='".key_xmlgm_checkpointmapmarkercolor."'>"; 
  1861. switch (get_option(key_xmlgm_checkpointmapmarkercolor)) 
  1862. case "red": $selcpmred = "selected='selected'"; break; 
  1863. case "green": $selcpmgreen = "selected='selected'"; break; 
  1864. case "yellow": $selcpmyellow = "selected='selected'"; break; 
  1865. case "blue": $selcpmblue = "selected='selected'"; break; 
  1866. default: $selcpmred = "selected='selected'"; break; 
  1867. echo "<option value='red' $selcpmred>Red (red)</option>"; 
  1868. echo "<option value='green' $selcpmgreen>Green (green)</option>"; 
  1869. echo "<option value='yellow' $selcpmyellow>Yellow (yellow)</option>"; 
  1870. echo "<option value='blue' $selcpmblue>Blue (blue)</option>"; 
  1871. echo "</select>\n"; 
  1872. ?> <img id="cpmarker" name="cpmarker" src="" /> <img 
  1873. id="cpmarker_start" name="cpmarker_start" src="" /> <img 
  1874. id="cpmarker_end" name="cpmarker_end" src="" /> 
  1875. <p style="margin: 5px 10px;">Define the Marker Color for the 
  1876. Checkpoint</p> 
  1877. </td> 
  1878. <?php echo $navigation; ?> 
  1879. </tr> 
  1880. <tr> 
  1881. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1882. for="<?php echo key_xmlgm_checkpointinterval; ?>">Checkpoint 
  1883. Interval:</label></th> 
  1884. <td width="50%"><?php 
  1885. echo "<input type='text' size='50' onchange='enabling();'"; 
  1886. echo "name='".key_xmlgm_checkpointinterval."' "; 
  1887. echo "id='".key_xmlgm_checkpointinterval."' "; 
  1888. echo "value='".get_option(key_xmlgm_checkpointinterval)."' />\n"; 
  1889. ?> 
  1890. <p style="margin: 5px 10px;">Set the checkpoint interval (0=disabled)!</p> 
  1891. </td> 
  1892. </tr> 
  1893. <tr> 
  1894. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1895. for="<?php echo key_xmlgm_checkpointtable; ?>">Checkpoint Table:</label> 
  1896. </th> 
  1897. <td width="50%"><?php 
  1898. echo "<select "; 
  1899. echo "name='".key_xmlgm_checkpointtable."' "; 
  1900. echo "id='".key_xmlgm_checkpointtable."'>"; 
  1901. switch (get_option(key_xmlgm_checkpointtable)) 
  1902. case "show": $selcptabshow = "selected='selected'"; break; 
  1903. default: $selcptabhide = "selected='selected'"; break; 
  1904. echo "<option value='hide' $selcptabhide>Invisible (hide)</option>"; 
  1905. echo "<option value='show' $selcptabshow>Visible (show)</option>"; 
  1906. echo "</select>\n"; 
  1907. ?> 
  1908. <p style="margin: 5px 10px;">Visibility of checkpoint table 
  1909. (checkpointinterval has to be set to a value >0)</p> 
  1910. </td> 
  1911. </tr>  
  1912. </table> 
  1913. <h3><a name="templ"></a>Templates</h3> 
  1914. <p>Define the look & feel of your Checkpoint Table, GPX marker or NextGEN Gallery marker!</p> 
  1915. <table class="form-table" cellspacing="2" cellpadding="5" width="100%"> 
  1916. <tr> 
  1917. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1918. for="<?php echo key_xmlgm_checkpointtabletempl; ?>">Checkpoint Table 
  1919. Template:</label></th> 
  1920. <td width="50%"><?php 
  1921. echo "<textarea rows='15' cols='50' style='width: 100%;'"; 
  1922. echo "name='".key_xmlgm_checkpointtabletempl."' "; 
  1923. echo "id='".key_xmlgm_checkpointtabletempl."'>"; 
  1924. echo get_option(key_xmlgm_checkpointtabletempl)."</textarea>\n"; 
  1925. ?> 
  1926. <p style="margin: 5px 10px;">Define your own table template. Use the 
  1927. following parameters for placeholders:<br /> 
  1928. %WIDTH% - Placeholder of the Width setting<br /> 
  1929. %ROW% - Row Template Placeholder<br /> 
  1930. %DISTANCE% - Distance of the track<br /> 
  1931. %TIME% - Time of the track<br /> 
  1932. %MOVINGTIME% - Time of the track (without breaks)<br /> 
  1933. %SPEED% - Average Speed of the track<br /> 
  1934. %MOVINGSPEED% - Average Speed of the track (without breaks)<br />  
  1935. %MAXSPEED% - Max Speed of the track<br /> 
  1936. %CLIMBUP% - Climb Up of the track<br /> 
  1937. %CLIMBDOWN% - Climb Down of the track<br /> 
  1938. <br /> 
  1939. Delete the whole content to restore the default value!</p> 
  1940. </td> 
  1941. <?php echo $navigation; ?> 
  1942. </tr> 
  1943. <tr> 
  1944. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1945. for="<?php echo key_xmlgm_checkpointtablerowtempl; ?>">Checkpoint 
  1946. Table Row Template:</label></th> 
  1947. <td width="50%"><?php 
  1948. echo "<textarea rows='15' cols='50' style='width: 100%;'"; 
  1949. echo "name='".key_xmlgm_checkpointtablerowtempl."' "; 
  1950. echo "id='".key_xmlgm_checkpointtablerowtempl."'>"; 
  1951. echo get_option(key_xmlgm_checkpointtablerowtempl)."</textarea>\n"; 
  1952. ?> 
  1953. <p style="margin: 5px 10px;">Define your own row template. Use the 
  1954. following parameters for placeholders:<br /> 
  1955. %MARKERIMAGEURL% - URL to the checkpoint Image <br /> 
  1956. %CHECKPOINTNUMBER% - Number of the Checkpoint <br /> 
  1957. %PARTDISTANCE% - Distance between checkpoints<br /> 
  1958. %PARTTIME% - Timedifference between checkpoints<br /> 
  1959. %PARTMOVINGTIME% - Timedifference between checkpoints (without breaks)<br /> 
  1960. %PARTSPEED% - Average speed between checkpoints<br /> 
  1961. %PARTMOVINGSPEED% - Average speed between checkpoints (without breaks)<br /> 
  1962. %PARTMAXSPEED% - Max Speed between checkpoints<br /> 
  1963. %PARTCLIMBUP% - Climb Up checkpoints<br /> 
  1964. %PARTCLIMBDOWN% - Climb Down checkpoints<br />  
  1965. %DISTANCE% - Distance from starting point<br /> 
  1966. %TIME% - Time from the starting point<br /> 
  1967. %MOVINGTIME% - Time from the starting point (without breaks)<br />  
  1968. %SPEED% - Average Speed from the starting point<br /> 
  1969. %MOVINGSPEED% - Average Speed from the starting point (without breaks)<br /> 
  1970. %MAXSPEED% - Max Speed from the starting point<br /> 
  1971. %CLIMBUP% - Climb Up from the starting point<br /> 
  1972. %CLIMBDOWN% - Climb Down from the starting point<br /> 
  1973. <br /> 
  1974. Delete the whole content to restore the default value!</p></td> 
  1975. </tr> 
  1976. <tr> 
  1977. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1978. for="<?php echo key_xmlgm_gpxmarkertempl; ?>">GPX Waypoint Marker Template:</label></th> 
  1979. <td width="50%"><?php 
  1980. echo "<textarea rows='15' cols='50' style='width: 100%;'"; 
  1981. echo "name='".key_xmlgm_gpxmarkertempl."' "; 
  1982. echo "id='".key_xmlgm_gpxmarkertempl."'>"; 
  1983. echo get_option(key_xmlgm_gpxmarkertempl)."</textarea>\n"; 
  1984. ?> 
  1985. <p style="margin: 5px 10px;">Define your own row template. Use the 
  1986. following parameters for placeholders:<br /> 
  1987. %DESCRIPTION% - DESC Tag of the GPX Waypoint <br /> 
  1988. %NAME% - NAME Tag of the GPX Waypoint <br /> 
  1989. %LINK% - Attribute HREF of the LINK Tag of the GPX Waypoint <br /> 
  1990. <br /> 
  1991. Delete the whole content to restore the default value!</p></td> 
  1992. </tr>  
  1993. <tr> 
  1994. <th valign="top" style="padding-top: 10px;" width="35%"><label 
  1995. for="<?php echo key_xmlgm_nggmarkertempl; ?>">NextGEN Gallery Image Marker Template:</label></th> 
  1996. <td width="50%"><?php 
  1997. echo "<textarea rows='15' cols='50' style='width: 100%;'"; 
  1998. echo "name='".key_xmlgm_nggmarkertempl."' "; 
  1999. echo "id='".key_xmlgm_nggmarkertempl."'>"; 
  2000. echo get_option(key_xmlgm_nggmarkertempl)."</textarea>\n"; 
  2001. ?> 
  2002. <p style="margin: 5px 10px;">Define your own row template. Use the 
  2003. following parameters for placeholders:<br /> 
  2004. %FULLPATH% - Full Image Path <br /> 
  2005. %THUMBPATH% - Thumb Image Path <br /> 
  2006. %TITLE% - Title of the image <br /> 
  2007. %DESCRIPTION% - Description of the Image <br /> 
  2008. %CREATIONDATE% - Creation Date of the Image <br /> 
  2009. <br /> 
  2010. Delete the whole content to restore the default value!</p></td> 
  2011. </tr>  
  2012. </table> 
  2013. </div> 
  2014. </form> 
  2015. <script type="text/javascript"> 
  2016. <!-- 
  2017. enabling(); 
  2018. --> 
  2019. </script> 
  2020. <?php 
  2021.  
  2022. function getDisplayURL($urldisplaymode, $displayurl, $varstring) { 
  2023. switch ($urldisplaymode) { 
  2024. case "none": 
  2025. $displayurl = ""; 
  2026. break; 
  2027. case "showvars": 
  2028. $displayurl = $displayurl; 
  2029. break; 
  2030. case "nomap": 
  2031. $displayurl = str_replace("[".$varstring."]", "", $displayurl); 
  2032. break; 
  2033. default: 
  2034. $displayurl = str_replace("[".$varstring."]", "", $displayurl); 
  2035. break; 
  2036. return $displayurl; 
  2037.  
  2038. // Not exististing Functions 
  2039. if(!function_exists("stripos")) 
  2040. function stripos($str, $needle) 
  2041. return strpos(strtolower($str), strtolower($needle)); 
  2042.  
  2043. ?> 
.