https://www.mapsmarker.com/path-error for more details'); } include( 'wp-load.php' ); //info: check if plugin is active (didnt use is_plugin_active() due to problems reported by users) function lmm_is_plugin_active( $plugin ) { $active_plugins = get_option('active_plugins'); $active_plugins = array_flip($active_plugins); if ( isset($active_plugins[$plugin]) || lmm_is_plugin_active_for_network( $plugin ) ) { return true; } } function lmm_is_plugin_active_for_network( $plugin ) { if ( !is_multisite() ) return false; $plugins = get_site_option( 'active_sitewide_plugins'); if ( isset($plugins[$plugin]) ) return true; return false; } if (!lmm_is_plugin_active('leaflet-maps-marker/leaflet-maps-marker.php') ) { echo sprintf(__('The plugin "Leaflet Maps Marker" is inactive on this site and therefore this API link is not working.

Please contact the site owner (%1s) who can activate this plugin again.','lmm'), antispambot(get_bloginfo('admin_email')) ); } else { global $wpdb, $allowedtags, $locale; $table_name_markers = $wpdb->prefix.'leafletmapsmarker_markers'; $table_name_layers = $wpdb->prefix.'leafletmapsmarker_layers'; $lmm_options = get_option( 'leafletmapsmarker_options' ); //info: set marker shadow url if ( $lmm_options['defaults_marker_icon_shadow_url_status'] == 'default' ) { if ( $lmm_options['defaults_marker_icon_shadow_url'] == NULL ) { $marker_shadow_url = ''; } else { $marker_shadow_url = LEAFLET_PLUGIN_URL . 'leaflet-dist/images/marker-shadow.png'; } } else { $marker_shadow_url = htmlspecialchars($lmm_options['defaults_marker_icon_shadow_url']); } $plugin_version = get_option('leafletmapsmarker_version'); if (isset($_GET['layer'])) { $layer = intval($_GET['layer']); $uid = substr(md5(''.rand()), 0, 8); $table_name_layers = $wpdb->prefix.'leafletmapsmarker_layers'; $row = $wpdb->get_row($wpdb->prepare('SELECT `id`,`name`,`basemap`,`mapwidth`,`mapheight`,`mapwidthunit`,`panel`,`layerzoom`,`layerviewlat`,`layerviewlon`,`controlbox`,`overlays_custom`,`overlays_custom2`,`overlays_custom3`,`overlays_custom4`,`wms`,`wms2`,`wms3`,`wms4`,`wms5`,`wms6`,`wms7`,`wms8`,`wms9`,`wms10`,`multi_layer_map`,`multi_layer_map_list` FROM `'.$table_name_layers.'` WHERE `id` = %d',$layer), ARRAY_A); $id = $row['id']; $layername = $row['name']; $basemap = $row['basemap']; $lat = $row['layerviewlat']; $lon = $row['layerviewlon']; $zoom = $row['layerzoom']; $mapwidth = $row['mapwidth']; $mapheight = $row['mapheight']; $mapwidthunit = $row['mapwidthunit']; $panel = $row['panel']; $paneltext = ($row['name'] == NULL) ? ' ' : htmlspecialchars(stripslashes($row['name'])); $controlbox = $row['controlbox']; $overlays_custom = $row['overlays_custom']; $overlays_custom2 = $row['overlays_custom2']; $overlays_custom3 = $row['overlays_custom3']; $overlays_custom4 = $row['overlays_custom4']; $wms = $row['wms']; $wms2 = $row['wms2']; $wms3 = $row['wms3']; $wms4 = $row['wms4']; $wms5 = $row['wms5']; $wms6 = $row['wms6']; $wms7 = $row['wms7']; $wms8 = $row['wms8']; $wms9 = $row['wms9']; $wms10 = $row['wms10']; $mapname = 'mapsmarker_'.$uid; $multi_layer_map = $row['multi_layer_map']; $multi_layer_map_list = $row['multi_layer_map_list']; //info: check if layer/marker ID exists if ($row == NULL) { $error_layer_not_exists = sprintf( esc_attr__('Error: a layer with the ID %1$s does not exist!','lmm'), $layer); echo $error_layer_not_exists . '
'; echo '
'; } else { //info: starting output on frontend $lmm_out = ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; if ($layername == '') { $title_layername = get_bloginfo('name'); } else { $title_layername = htmlspecialchars(stripslashes($layername)); } $lmm_out .= '' . $title_layername . ' ' . __('powered by','lmm') . ' MapsMarker.com - ' . get_bloginfo('name') . ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; if ( function_exists( 'is_rtl' ) && is_rtl() ) { $lmm_out .= ''.PHP_EOL; } else { $lmm_out .= ''.PHP_EOL; } $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: Google API key if ( isset($lmm_options['google_maps_api_key']) && ($lmm_options['google_maps_api_key'] != NULL) ) { $google_maps_api_key = $lmm_options['google_maps_api_key']; } else { $google_maps_api_key = ''; } $lmm_out .= ''.PHP_EOL; //info: Google language localization (JSON API) if ($lmm_options['google_maps_language_localization'] == 'browser_setting') { $google_language = ''; } else if ($lmm_options['google_maps_language_localization'] == 'wordpress_setting') { if ( $locale != NULL ) { $google_language = "&language=" . substr($locale, 0, 2); } else { $google_language = '&language=en'; } } else { $google_language = "&language=" . $lmm_options['google_maps_language_localization']; } if ($lmm_options['google_maps_base_domain_custom'] == 'maps.google.com') { $gmaps_base_domain = "&base_domain=" . $lmm_options['google_maps_base_domain']; } else { $gmaps_base_domain = "&base_domain=" . htmlspecialchars($lmm_options['google_maps_base_domain_custom']); } if ( is_admin() ) { $gmaps_libraries = '&libraries=places'; } else { $gmaps_libraries = ''; } //info: Bing culture code if ($lmm_options['bingmaps_culture'] == 'automatic') { if ( $locale != NULL ) { $bing_culture = str_replace("_","-", $locale); } else { $bing_culture = 'en_us'; } } else { $bing_culture = $lmm_options['bingmaps_culture']; } $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: for layer controlbox $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: panel for layer/marker name and API URLs if ($panel == 1) { if ( function_exists( 'is_rtl' ) && is_rtl() ) { $panel_fullscreen_text = 'text-align:right;'; } else { $panel_fullscreen_text = 'text-align:left;'; } $lmm_out .= '
'.PHP_EOL; $lmm_out .= '' . $paneltext . ''; if ( (isset($lmm_options[ 'defaults_layer_panel_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_kml' ] == 1 ) ) { $lmm_out .= 'KML-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_fullscreen' ] == 1 ) ) { $lmm_out .= 'Fullscreen-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_qr_code' ] == 1 ) ) { $lmm_out .= 'QR-code-logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_geojson' ] == 1 ) ) { if ($multi_layer_map == 0 ) { $geojson_api_link = $id; } else { $geojson_api_link = $multi_layer_map_list; } $lmm_out .= 'GeoJSON-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_georss' ] == 1 ) ) { $lmm_out .= 'GeoRSS-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_wikitude' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_wikitude' ] == 1 ) ) { $lmm_out .= 'Wikitude-Logo'; } $lmm_out .= '
'.PHP_EOL; } //info: if panel enabled, only 94% height as otherwise attribution wont be visible if ($panel == 1) { $lmm_out .= '
'. PHP_EOL; } else { $lmm_out .= '
'. PHP_EOL; } //info: add geo microformats $layermarklist = $wpdb->get_results($wpdb->prepare('SELECT l.id as lid,l.name as lname, m.lon as mlon, m.lat as mlat, m.markername as markername,m.id as markerid FROM `'.$table_name_layers.'` as l INNER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer WHERE l.id = %d LIMIT 1000',$layer), ARRAY_A); if (count($layermarklist) < 1) { $lmm_out .= '
' . $paneltext . ': ' . $lat . ', ' . $lon . '
'.PHP_EOL; } else { foreach ($layermarklist as $row){ $lmm_out .= '
' . htmlspecialchars($row['markername']) . ': ' . $row['mlat'] . ', ' . $row['mlon'] . '
'.PHP_EOL; } } $lmm_out .= ''; $lmm_out .= ''; $lmm_out .= ''; echo $lmm_out; } //info: end check if marker/layer exists } //info: end isset($_GET['layer']) elseif (isset($_GET['marker'])) { $markerid = intval($_GET['marker']); $uid = substr(md5(''.rand()), 0, 8); $table_name_markers = $wpdb->prefix.'leafletmapsmarker_markers'; $row = $wpdb->get_row($wpdb->prepare('SELECT `id`,`markername`,`basemap`,`layer`,`lat`,`lon`,`icon`,`popuptext`,`zoom`,`openpopup`,`mapwidth`,`mapwidthunit`,`mapheight`,`panel`,`controlbox`,`overlays_custom`,`overlays_custom2`,`overlays_custom3`,`overlays_custom4`,`wms`,`wms2`,`wms3`,`wms4`,`wms5`,`wms6`,`wms7`,`wms8`,`wms9`,`wms10`,`address` FROM `'.$table_name_markers.'` WHERE `id` = %d',$markerid), ARRAY_A); if(!empty($row)) { $id = $row['id']; $markername = esc_js($row['markername']); $basemap = $row['basemap']; $lon = $row['lon']; $lat = $row['lat']; $coords = $lat.', '.$lon; $icon = $row['icon']; $popuptext = $row['popuptext']; $zoom = $row['zoom']; $openpopup = ($row['openpopup'] == 1) ? '.openPopup()' : ''; $mopenpopup = $openpopup; $layer = $row['layer']; $mlat = $lat; $mlon = $lon; $mpopuptext = $popuptext; $micon = $icon; $mapwidth = $row['mapwidth']; $mapwidthunit = $row['mapwidthunit']; $mapheight = $row['mapheight']; $panel = $row['panel']; $paneltext = ($row['markername'] == NULL) ? ' ' : htmlspecialchars(stripslashes($row['markername'])); $controlbox = $row['controlbox']; $overlays_custom = $row['overlays_custom']; $overlays_custom2 = $row['overlays_custom2']; $overlays_custom3 = $row['overlays_custom3']; $overlays_custom4 = $row['overlays_custom4']; $wms = $row['wms']; $wms2 = $row['wms2']; $wms3 = $row['wms3']; $wms4 = $row['wms4']; $wms5 = $row['wms5']; $wms6 = $row['wms6']; $wms7 = $row['wms7']; $wms8 = $row['wms8']; $wms9 = $row['wms9']; $wms10 = $row['wms10']; $address = $row['address']; $mapname = 'mapsmarker_'.$uid; } //info: check if layer/marker ID exists if ($row == NULL) { $error_marker_not_exists = sprintf( esc_attr__('Error: a marker with the ID %1$s does not exist!','lmm'), $markerid); echo $error_marker_not_exists . '
'; echo '
'; } else { //info: starting output on frontend $lmm_out = ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; if ($markername == '') { $title_markername = get_bloginfo('name'); } else { $title_markername = htmlspecialchars(stripslashes($markername)); } $lmm_out .= '' . $title_markername . ' ' . __('powered by','lmm') . ' MapsMarker.com - ' . get_bloginfo('name') . ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; if ( function_exists( 'is_rtl' ) && is_rtl() ) { $lmm_out .= ''.PHP_EOL; } else { $lmm_out .= ''.PHP_EOL; } $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: Google API key if ( isset($lmm_options['google_maps_api_key']) && ($lmm_options['google_maps_api_key'] != NULL) ) { $google_maps_api_key = $lmm_options['google_maps_api_key']; } else { $google_maps_api_key = ''; } $lmm_out .= ''.PHP_EOL; //info: Google language localization (JSON API) if ($lmm_options['google_maps_language_localization'] == 'browser_setting') { $google_language = ''; } else if ($lmm_options['google_maps_language_localization'] == 'wordpress_setting') { if ( $locale != NULL ) { $google_language = "&language=" . substr($locale, 0, 2); } else { $google_language = '&language=en'; } } else { $google_language = "&language=" . $lmm_options['google_maps_language_localization']; } if ($lmm_options['google_maps_base_domain_custom'] == 'maps.google.com') { $gmaps_base_domain = "&base_domain=" . $lmm_options['google_maps_base_domain']; } else { $gmaps_base_domain = "&base_domain=" . htmlspecialchars($lmm_options['google_maps_base_domain_custom']); } if ( is_admin() ) { $gmaps_libraries = '&libraries=places'; } else { $gmaps_libraries = ''; } //info: Bing culture code if ($lmm_options['bingmaps_culture'] == 'automatic') { if ( $locale != NULL ) { $bing_culture = str_replace("_","-", $locale); } else { $bing_culture = 'en_us'; } } else { $bing_culture = $lmm_options['bingmaps_culture']; } $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: for layer controlbox $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; $lmm_out .= ''.PHP_EOL; //info: panel for layer/marker name and API URLs if ($panel == 1) { if ( function_exists( 'is_rtl' ) && is_rtl() ) { $panel_fullscreen_text = 'text-align:right;'; } else { $panel_fullscreen_text = 'text-align:left;'; } $lmm_out .= '
'.PHP_EOL; $lmm_out .= '' . $paneltext . ''; if ( (isset($lmm_options[ 'defaults_marker_panel_directions' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_directions' ] == 1 ) ) { //info: Google language localization (directions) if ($lmm_options['google_maps_language_localization'] == 'browser_setting') { $google_language = ''; } else if ($lmm_options['google_maps_language_localization'] == 'wordpress_setting') { if ( $locale != NULL ) { $google_language = '&hl=' . substr($locale, 0, 2); } else { $google_language = '&hl=en'; } } else { $google_language = '&hl=' . $lmm_options['google_maps_language_localization']; } //info: build directions provider links if ($lmm_options['directions_provider'] == 'googlemaps') { if ( isset($lmm_options['google_maps_base_domain_custom']) && ($lmm_options['google_maps_base_domain_custom'] == NULL) ) { $gmaps_base_domain_directions = $lmm_options['google_maps_base_domain']; } else { $gmaps_base_domain_directions = htmlspecialchars($lmm_options['google_maps_base_domain_custom']); } if ((isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 )) { $yours_transport_type_icon = 'icon-walk.png'; } else { $yours_transport_type_icon = 'icon-car.png'; } if ( $address != NULL ) { $google_from = urlencode($address); } else { $google_from = $lat . ',' . $lon; } $avoidhighways = (isset($lmm_options[ 'directions_googlemaps_route_type_highways' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_highways' ] == 1 ) ? '&dirflg=h' : ''; $avoidtolls = (isset($lmm_options[ 'directions_googlemaps_route_type_tolls' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_tolls' ] == 1 ) ? '&dirflg=t' : ''; $publictransport = (isset($lmm_options[ 'directions_googlemaps_route_type_public_transport' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_public_transport' ] == 1 ) ? '&dirflg=r' : ''; $walking = (isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 ) ? '&dirflg=w' : ''; $lmm_out .= '' . $yours_transport_type_icon . ''; } else if ($lmm_options['directions_provider'] == 'yours') { if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'motorcar') { $yours_transport_type_icon = 'icon-car.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'bicycle') { $yours_transport_type_icon = 'icon-bicycle.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'foot') { $yours_transport_type_icon = 'icon-walk.png'; } $lmm_out .= '' . $yours_transport_type_icon . ''; } else if ($lmm_options['directions_provider'] == 'osrm') { $lmm_out .= 'icon-car'; } else if ($lmm_options['directions_provider'] == 'ors') { if ($lmm_options[ 'directions_ors_route_preferences' ] == 'Pedestrian') { $yours_transport_type_icon = 'icon-walk.png'; } else if ($lmm_options[ 'directions_ors_route_preferences' ] == 'Bicycle') { $yours_transport_type_icon = 'icon-bicycle.png'; } else { $yours_transport_type_icon = 'icon-car.png'; } $lmm_out .= '' . $yours_transport_type_icon . ''; } else if ($lmm_options['directions_provider'] == 'bingmaps') { if ( $address != NULL ) { $bing_to = '_' . urlencode($address); } else { $bing_to = ''; } $lmm_out .= 'icon-car'; } } if ( (isset($lmm_options[ 'defaults_marker_panel_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_kml' ] == 1 ) ) { $lmm_out .= 'KML-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_fullscreen' ] == 1 ) ) { $lmm_out .= 'Fullscreen-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_qr_code' ] == 1 ) ) { $lmm_out .= 'QR-code-logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_geojson' ] == 1 ) ) { $lmm_out .= 'GeoJSON-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_georss' ] == 1 ) ) { $lmm_out .= 'GeoRSS-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_wikitude' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_wikitude' ] == 1 ) ) { $lmm_out .= 'Wikitude-Logo'; } $lmm_out .= '
'.PHP_EOL; } //info: if panel enabled, only 94% height as otherwise attribution wont be visible if ($panel == 1) { $lmm_out .= '
'. PHP_EOL; } else { $lmm_out .= '
'. PHP_EOL; } //info: add geo microformats $lmm_out .= '
' . $paneltext . ': ' . $lat . ', ' . $lon . '
'.PHP_EOL; $lmm_out .= ''; $lmm_out .= ''; $lmm_out .= ''; echo $lmm_out; } //info: end check if marker/layer exists } //info: end isset($_GET['marker']) } //info: end plugin active check ?>