Version Description
Please update WP Google Maps to version 6.1.10 to enable our latest security enhancements.
Download this release
Release Info
Developer | WPGMaps |
Plugin | WP Google Maps |
Version | 6.1.10 |
Comparing to | |
See all releases |
Code changes from version 6.1.9 to 6.1.10
- base/includes/wp-google-maps-polygons.php +6 -3
- images/marker_iw_type_1.png +0 -0
- images/marker_iw_type_2.png +0 -0
- images/marker_list_0.png +0 -0
- images/marker_list_1.png +0 -0
- images/marker_list_2.png +0 -0
- images/marker_list_3.png +0 -0
- images/marker_list_4.png +0 -0
- readme.txt +22 -1
- wpGoogleMaps.php +35 -27
base/includes/wp-google-maps-polygons.php
CHANGED
@@ -12,6 +12,7 @@ function wpgmza_b_pro_add_poly($mid) {
|
|
12 |
global $wpgmza_tblname_maps;
|
13 |
global $wpdb;
|
14 |
if ($_GET['action'] == "add_poly" && isset($mid)) {
|
|
|
15 |
$res = wpgmza_get_map_data($mid);
|
16 |
echo "
|
17 |
|
@@ -91,9 +92,11 @@ function wpgmza_b_pro_add_poly($mid) {
|
|
91 |
function wpgmza_b_pro_edit_poly($mid) {
|
92 |
global $wpgmza_tblname_maps;
|
93 |
global $wpdb;
|
|
|
94 |
if ($_GET['action'] == "edit_poly" && isset($mid)) {
|
|
|
95 |
$res = wpgmza_get_map_data($mid);
|
96 |
-
$pol = wpgmza_b_return_poly_options($_GET['poly_id']);
|
97 |
|
98 |
echo "
|
99 |
|
@@ -105,7 +108,7 @@ function wpgmza_b_pro_edit_poly($mid) {
|
|
105 |
<h2>".__("Edit Polygon","wp-google-maps")."</h2>
|
106 |
<form action='?page=wp-google-maps-menu&action=edit&map_id=".$mid."' method='post' id='wpgmaps_edit_poly_form'>
|
107 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
108 |
-
<input type='hidden' name='wpgmaps_poly_id' id='wpgmaps_poly_id' value='"
|
109 |
|
110 |
<table>
|
111 |
<tr>
|
@@ -170,7 +173,7 @@ function wpgmza_b_pro_edit_poly($mid) {
|
|
170 |
|
171 |
}
|
172 |
function wpgmaps_b_admin_add_poly_javascript($mapid) {
|
173 |
-
$res = wpgmza_get_map_data($_GET['map_id']);
|
174 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
175 |
|
176 |
|
12 |
global $wpgmza_tblname_maps;
|
13 |
global $wpdb;
|
14 |
if ($_GET['action'] == "add_poly" && isset($mid)) {
|
15 |
+
$mid = sanitize_text_field($mid);
|
16 |
$res = wpgmza_get_map_data($mid);
|
17 |
echo "
|
18 |
|
92 |
function wpgmza_b_pro_edit_poly($mid) {
|
93 |
global $wpgmza_tblname_maps;
|
94 |
global $wpdb;
|
95 |
+
|
96 |
if ($_GET['action'] == "edit_poly" && isset($mid)) {
|
97 |
+
$mid = sanitize_text_field($mid);;
|
98 |
$res = wpgmza_get_map_data($mid);
|
99 |
+
$pol = wpgmza_b_return_poly_options(sanitize_text_field($_GET['poly_id']));
|
100 |
|
101 |
echo "
|
102 |
|
108 |
<h2>".__("Edit Polygon","wp-google-maps")."</h2>
|
109 |
<form action='?page=wp-google-maps-menu&action=edit&map_id=".$mid."' method='post' id='wpgmaps_edit_poly_form'>
|
110 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
111 |
+
<input type='hidden' name='wpgmaps_poly_id' id='wpgmaps_poly_id' value='".sanitize_text_field($_GET['poly_id'])."' />
|
112 |
|
113 |
<table>
|
114 |
<tr>
|
173 |
|
174 |
}
|
175 |
function wpgmaps_b_admin_add_poly_javascript($mapid) {
|
176 |
+
$res = wpgmza_get_map_data(sanitize_text_field($_GET['map_id']));
|
177 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
178 |
|
179 |
|
images/marker_iw_type_1.png
ADDED
Binary file
|
images/marker_iw_type_2.png
ADDED
Binary file
|
images/marker_list_0.png
ADDED
Binary file
|
images/marker_list_1.png
ADDED
Binary file
|
images/marker_list_2.png
ADDED
Binary file
|
images/marker_list_3.png
ADDED
Binary file
|
images/marker_list_4.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -50,14 +50,15 @@ The [WP Google Maps Pro Version](http://www.wpgmaps.com/purchase-professional-ve
|
|
50 |
|
51 |
= Professional Edition =
|
52 |
* Create multiple Google maps!
|
|
|
53 |
* Add descriptions, links and images to your map markers.
|
54 |
* Add categories to your map markers
|
55 |
* Filter markers by category
|
56 |
* Mashup multiple Google maps
|
57 |
* Add different marker icons, or your own icons to make your map really stand out!
|
58 |
* List your Google Map markers in the four ways; basic list, basic table, carousel, advanced table
|
59 |
-
* Allow your visitors to get directions to your markers.
|
60 |
* Allow visitors to use their map location as the starting or ending point for the directions
|
|
|
61 |
* Export/Import your markers to a CSV file for quick editing.
|
62 |
* Link Fusion tables to your Google Maps
|
63 |
* Show your visitor's location on the Map
|
@@ -122,7 +123,19 @@ WP Google Maps Pro
|
|
122 |
* [Visitor Generated Markers](http://www.wpgmaps.com/demo/visitor-generated-markers/) - (WP Google Maps VGM Add-on)
|
123 |
* [Custom Map Styling](http://www.wpgmaps.com/demo/custom-map-styling/) (WP Google Maps Gold Add-on)
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
|
|
|
|
|
|
|
|
126 |
|
127 |
== Installation ==
|
128 |
|
@@ -169,6 +182,9 @@ Try [Nifty Maps](http://www.niftymaps.co) - Comprehensive Map Builder for all we
|
|
169 |
|
170 |
== Upgrade Notice ==
|
171 |
|
|
|
|
|
|
|
172 |
= 6.1.5 =
|
173 |
We no longer support timthumb and we have opted to remove it from WP Google Maps. Please update to 6.1.5 to ensure the removal of the timthumb script.
|
174 |
|
@@ -177,6 +193,11 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
|
|
177 |
|
178 |
== Changelog ==
|
179 |
|
|
|
|
|
|
|
|
|
|
|
180 |
= 6.1.9 - 2015-06-01 - Low priority =
|
181 |
* French translation bug fixed
|
182 |
|
50 |
|
51 |
= Professional Edition =
|
52 |
* Create multiple Google maps!
|
53 |
+
* Allow your visitors to get directions to your markers.
|
54 |
* Add descriptions, links and images to your map markers.
|
55 |
* Add categories to your map markers
|
56 |
* Filter markers by category
|
57 |
* Mashup multiple Google maps
|
58 |
* Add different marker icons, or your own icons to make your map really stand out!
|
59 |
* List your Google Map markers in the four ways; basic list, basic table, carousel, advanced table
|
|
|
60 |
* Allow visitors to use their map location as the starting or ending point for the directions
|
61 |
+
* Choose between the Default Google Maps Infowindow and the new Modern Infowindow
|
62 |
* Export/Import your markers to a CSV file for quick editing.
|
63 |
* Link Fusion tables to your Google Maps
|
64 |
* Show your visitor's location on the Map
|
123 |
* [Visitor Generated Markers](http://www.wpgmaps.com/demo/visitor-generated-markers/) - (WP Google Maps VGM Add-on)
|
124 |
* [Custom Map Styling](http://www.wpgmaps.com/demo/custom-map-styling/) (WP Google Maps Gold Add-on)
|
125 |
|
126 |
+
= Documentation =
|
127 |
+
* [Installing WP Google Maps](http://www.wpgmaps.com/documentation/installing-the-plugin/)
|
128 |
+
* [Creating your first map](http://www.wpgmaps.com/documentation/creating-your-first-map/)
|
129 |
+
* [Google Maps mashup (Pro)](http://www.wpgmaps.com/documentation/advanced-map-options/map-mashup/)
|
130 |
+
* [Exporting and importing map markers (Pro)](http://www.wpgmaps.com/documentation/exporting-and-importing-your-markers/)
|
131 |
+
* [Changing the Google Maps language](http://www.wpgmaps.com/documentation/changing-the-google-maps-language/)
|
132 |
+
* [Create a google map and marker using custom fields (Pro)](http://www.wpgmaps.com/introducing-maps-by-custom-fields/)
|
133 |
+
* [View all documentation](http://www.wpgmaps.com/documentation/)
|
134 |
|
135 |
+
= Troubleshooting =
|
136 |
+
* [My Google Map is not showing on my website](http://www.wpgmaps.com/documentation/troubleshooting/my-map-is-not-showing-on-my-website/)
|
137 |
+
* [My markers are not showing](http://www.wpgmaps.com/documentation/troubleshooting/my-markers-are-not-showing-on-my-map/)
|
138 |
+
* [View all troubleshooting articles](http://www.wpgmaps.com/documentation/troubleshooting/)
|
139 |
|
140 |
== Installation ==
|
141 |
|
182 |
|
183 |
== Upgrade Notice ==
|
184 |
|
185 |
+
= 6.1.10 =
|
186 |
+
Please update WP Google Maps to version 6.1.10 to enable our latest security enhancements.
|
187 |
+
|
188 |
= 6.1.5 =
|
189 |
We no longer support timthumb and we have opted to remove it from WP Google Maps. Please update to 6.1.5 to ensure the removal of the timthumb script.
|
190 |
|
193 |
|
194 |
== Changelog ==
|
195 |
|
196 |
+
= 6.1.10 - 2015-06-10 - High priority =
|
197 |
+
* XSS security patch
|
198 |
+
* Security enhancements
|
199 |
+
* Fixed a bug that didnt allow you to add a map marker if there were no markers to start with
|
200 |
+
|
201 |
= 6.1.9 - 2015-06-01 - Low priority =
|
202 |
* French translation bug fixed
|
203 |
|
wpGoogleMaps.php
CHANGED
@@ -3,13 +3,18 @@
|
|
3 |
Plugin Name: WP Google Maps
|
4 |
Plugin URI: http://www.wpgmaps.com
|
5 |
Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
|
6 |
-
Version: 6.1.
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
-
* 6.1.
|
|
|
|
|
|
|
|
|
|
|
13 |
* Fixed french translation bug
|
14 |
*
|
15 |
* 6.1.8 - 2015-05-27 - Low priority
|
@@ -158,8 +163,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
|
|
158 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
159 |
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
|
160 |
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
|
161 |
-
$wpgmza_version = "6.1.
|
162 |
-
$wpgmza_p_version = "6.1.
|
163 |
$wpgmza_t = "basic";
|
164 |
define("WPGMAPS", $wpgmza_version);
|
165 |
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
|
@@ -477,11 +482,11 @@ function wpgmaps_check_permissions_cache() {
|
|
477 |
function wpgmaps_reload_map_on_post() {
|
478 |
if (isset($_POST['wpgmza_savemap'])){
|
479 |
|
480 |
-
$res = wpgmza_get_map_data($_GET['map_id']);
|
481 |
$wpgmza_lat = $res->map_start_lat;
|
482 |
$wpgmza_lng = $res->map_start_lng;
|
483 |
-
$wpgmza_width = $res->map_width;
|
484 |
-
$wpgmza_height = $res->map_height;
|
485 |
$wpgmza_width_type = $res->map_width_type;
|
486 |
$wpgmza_height_type = $res->map_height_type;
|
487 |
$wpgmza_map_type = $res->type;
|
@@ -495,7 +500,7 @@ function wpgmaps_reload_map_on_post() {
|
|
495 |
if (!$wpgmza_lat || !$wpgmza_lng) { $wpgmza_lat = "51.5081290"; $wpgmza_lng = "-0.1280050"; }
|
496 |
|
497 |
?>
|
498 |
-
<script type="text/javascript"
|
499 |
jQuery(function() {
|
500 |
jQuery("#wpgmza_map").css({
|
501 |
height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
|
@@ -505,7 +510,7 @@ function wpgmaps_reload_map_on_post() {
|
|
505 |
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
506 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
507 |
UniqueCode=Math.round(Math.random()*10010);
|
508 |
-
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo $_GET['map_id']; ?>);
|
509 |
|
510 |
});
|
511 |
</script>
|
@@ -799,7 +804,7 @@ function wpgmaps_admin_javascript_basic() {
|
|
799 |
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
800 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
801 |
UniqueCode=Math.round(Math.random()*10000);
|
802 |
-
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo $_GET['map_id']; ?>);
|
803 |
}
|
804 |
|
805 |
jQuery("#wpgmza_map").css({
|
@@ -1404,6 +1409,7 @@ function wpgmaps_admin_javascript_basic() {
|
|
1404 |
});
|
1405 |
});
|
1406 |
} else {
|
|
|
1407 |
var dec_marker_array = jQuery.parseJSON(db_marker_array);
|
1408 |
jQuery.each(dec_marker_array, function(i, val) {
|
1409 |
|
@@ -1469,7 +1475,7 @@ function wpgmaps_admin_javascript_basic() {
|
|
1469 |
|
1470 |
});
|
1471 |
|
1472 |
-
|
1473 |
}
|
1474 |
}
|
1475 |
|
@@ -2600,25 +2606,25 @@ function wpgmaps_action_callback_basic() {
|
|
2600 |
if ($check == 1) {
|
2601 |
|
2602 |
if ($_POST['action'] == "add_marker") {
|
2603 |
-
$rows_affected = $wpdb->insert( $table_name, array( 'map_id' => $_POST['map_id'], 'address' => $_POST['address'], 'lat' => $_POST['lat'], 'lng' => $_POST['lng'], 'infoopen' => $_POST['infoopen'], 'description' => '', 'title' => '', 'anim' => $_POST['anim'], 'link' => '', 'icon' => '', 'pic' => '', 'infoopen' => $_POST['infoopen'], 'retina' => '0' ) );
|
2604 |
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
2605 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2606 |
$return_a = array(
|
2607 |
"marker_id" => $wpdb->insert_id,
|
2608 |
-
"marker_data" => wpgmaps_return_markers($_POST['map_id']),
|
2609 |
-
"table_html" => wpgmza_return_marker_list($_POST['map_id'])
|
2610 |
);
|
2611 |
echo json_encode($return_a);
|
2612 |
}
|
2613 |
if ($_POST['action'] == "edit_marker") {
|
2614 |
$cur_id = $_POST['edit_id'];
|
2615 |
-
$rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET address = %s, lat = %f, lng = %f, anim = %d, infoopen = %d WHERE id = %d", $_POST['address'], $_POST['lat'], $_POST['lng'], $_POST['anim'], $_POST['infoopen'], $cur_id) );
|
2616 |
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
2617 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2618 |
$return_a = array(
|
2619 |
"marker_id" => $cur_id,
|
2620 |
-
"marker_data" => wpgmaps_return_markers($_POST['map_id']),
|
2621 |
-
"table_html" => wpgmza_return_marker_list($_POST['map_id'])
|
2622 |
);
|
2623 |
echo json_encode($return_a);
|
2624 |
|
@@ -2632,19 +2638,19 @@ function wpgmaps_action_callback_basic() {
|
|
2632 |
LIMIT 1
|
2633 |
"
|
2634 |
);
|
2635 |
-
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
2636 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2637 |
$return_a = array(
|
2638 |
"marker_id" => $marker_id,
|
2639 |
-
"marker_data" => wpgmaps_return_markers($_POST['map_id']),
|
2640 |
-
"table_html" => wpgmza_return_marker_list($_POST['map_id'])
|
2641 |
);
|
2642 |
echo json_encode($return_a);
|
2643 |
|
2644 |
|
2645 |
}
|
2646 |
if ($_POST['action'] == "delete_poly") {
|
2647 |
-
$poly_id = $_POST['poly_id'];
|
2648 |
|
2649 |
$wpdb->query(
|
2650 |
"
|
@@ -2654,11 +2660,11 @@ function wpgmaps_action_callback_basic() {
|
|
2654 |
"
|
2655 |
);
|
2656 |
|
2657 |
-
echo wpgmza_b_return_polygon_list($_POST['map_id']);
|
2658 |
|
2659 |
}
|
2660 |
if ($_POST['action'] == "delete_polyline") {
|
2661 |
-
$poly_id = $_POST['poly_id'];
|
2662 |
|
2663 |
$wpdb->query(
|
2664 |
"
|
@@ -2668,7 +2674,7 @@ function wpgmaps_action_callback_basic() {
|
|
2668 |
"
|
2669 |
);
|
2670 |
|
2671 |
-
echo wpgmza_b_return_polyline_list($_POST['map_id']);
|
2672 |
|
2673 |
}
|
2674 |
|
@@ -3615,19 +3621,19 @@ function wpgmaps_menu_layout() {
|
|
3615 |
|
3616 |
if ($_GET['action'] == "trash" && isset($_GET['map_id'])) {
|
3617 |
if ($_GET['s'] == "1") {
|
3618 |
-
if (wpgmaps_trash_map($_GET['map_id'])) {
|
3619 |
echo "<script>window.location = \"".get_option('siteurl')."/wp-admin/admin.php?page=wp-google-maps-menu\"</script>";
|
3620 |
} else {
|
3621 |
_e("There was a problem deleting the map.","wp-google-maps");
|
3622 |
}
|
3623 |
} else {
|
3624 |
-
$res = wpgmza_get_map_data($_GET['map_id']);
|
3625 |
echo "<h2>".__("Delete your map","wp-google-maps")."</h2><p>".__("Are you sure you want to delete the map","wp-google-maps")." <strong>\"".$res->map_title."?\"</strong> <br /><a href='?page=wp-google-maps-menu&action=trash&map_id=".$_GET['map_id']."&s=1'>".__("Yes","wp-google-maps")."</a> | <a href='?page=wp-google-maps-menu'>".__("No","wp-google-maps")."</a></p>";
|
3626 |
}
|
3627 |
}
|
3628 |
if ($_GET['action'] == "duplicate" && isset($_GET['map_id'])) {
|
3629 |
if (function_exists('wpgmaps_duplicate_map')) {
|
3630 |
-
$new_id = wpgmaps_duplicate_map($_GET['map_id']);
|
3631 |
if ($new_id > 0) {
|
3632 |
wpgmza_map_page();
|
3633 |
} else {
|
@@ -5110,8 +5116,10 @@ function wpgmza_basic_menu() {
|
|
5110 |
|
5111 |
function wpgmza_edit_marker($mid) {
|
5112 |
global $wpgmza_tblname_maps;
|
|
|
5113 |
global $wpdb;
|
5114 |
if ($_GET['action'] == "edit_marker" && isset($mid)) {
|
|
|
5115 |
$res = wpgmza_get_marker_data($mid);
|
5116 |
echo "
|
5117 |
<div class='wrap'>
|
3 |
Plugin Name: WP Google Maps
|
4 |
Plugin URI: http://www.wpgmaps.com
|
5 |
Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
|
6 |
+
Version: 6.1.10
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
+
* 6.1.10 - 2015-06-10 - High priority
|
13 |
+
* XSS security patch
|
14 |
+
* Security enhancements
|
15 |
+
* Fixed a bug that didnt allow you to add a map marker if there were no markers to start with
|
16 |
+
*
|
17 |
+
* 6.1.9 - 2015-06-01 - Low priority
|
18 |
* Fixed french translation bug
|
19 |
*
|
20 |
* 6.1.8 - 2015-05-27 - Low priority
|
163 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
164 |
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
|
165 |
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
|
166 |
+
$wpgmza_version = "6.1.10";
|
167 |
+
$wpgmza_p_version = "6.1.10";
|
168 |
$wpgmza_t = "basic";
|
169 |
define("WPGMAPS", $wpgmza_version);
|
170 |
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
|
482 |
function wpgmaps_reload_map_on_post() {
|
483 |
if (isset($_POST['wpgmza_savemap'])){
|
484 |
|
485 |
+
$res = wpgmza_get_map_data(sanitize_text_field($_GET['map_id']));
|
486 |
$wpgmza_lat = $res->map_start_lat;
|
487 |
$wpgmza_lng = $res->map_start_lng;
|
488 |
+
$wpgmza_width = intval($res->map_width);
|
489 |
+
$wpgmza_height = intval($res->map_height);
|
490 |
$wpgmza_width_type = $res->map_width_type;
|
491 |
$wpgmza_height_type = $res->map_height_type;
|
492 |
$wpgmza_map_type = $res->type;
|
500 |
if (!$wpgmza_lat || !$wpgmza_lng) { $wpgmza_lat = "51.5081290"; $wpgmza_lng = "-0.1280050"; }
|
501 |
|
502 |
?>
|
503 |
+
<script type="text/javascript">
|
504 |
jQuery(function() {
|
505 |
jQuery("#wpgmza_map").css({
|
506 |
height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
|
510 |
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
511 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
512 |
UniqueCode=Math.round(Math.random()*10010);
|
513 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo sanitize_text_field($_GET['map_id']); ?>);
|
514 |
|
515 |
});
|
516 |
</script>
|
804 |
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
805 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
806 |
UniqueCode=Math.round(Math.random()*10000);
|
807 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo sanitize_text_field($_GET['map_id']); ?>);
|
808 |
}
|
809 |
|
810 |
jQuery("#wpgmza_map").css({
|
1409 |
});
|
1410 |
});
|
1411 |
} else {
|
1412 |
+
if (db_marker_array.length > 0) {
|
1413 |
var dec_marker_array = jQuery.parseJSON(db_marker_array);
|
1414 |
jQuery.each(dec_marker_array, function(i, val) {
|
1415 |
|
1475 |
|
1476 |
});
|
1477 |
|
1478 |
+
}
|
1479 |
}
|
1480 |
}
|
1481 |
|
2606 |
if ($check == 1) {
|
2607 |
|
2608 |
if ($_POST['action'] == "add_marker") {
|
2609 |
+
$rows_affected = $wpdb->insert( $table_name, array( 'map_id' => $_POST['map_id'], 'address' => sanitize_text_field($_POST['address']), 'lat' => $_POST['lat'], 'lng' => $_POST['lng'], 'infoopen' => $_POST['infoopen'], 'description' => '', 'title' => '', 'anim' => $_POST['anim'], 'link' => '', 'icon' => '', 'pic' => '', 'infoopen' => $_POST['infoopen'], 'retina' => '0' ) );
|
2610 |
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
2611 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2612 |
$return_a = array(
|
2613 |
"marker_id" => $wpdb->insert_id,
|
2614 |
+
"marker_data" => wpgmaps_return_markers(sanitize_text_field($_POST['map_id'])),
|
2615 |
+
"table_html" => wpgmza_return_marker_list(sanitize_text_field($_POST['map_id']))
|
2616 |
);
|
2617 |
echo json_encode($return_a);
|
2618 |
}
|
2619 |
if ($_POST['action'] == "edit_marker") {
|
2620 |
$cur_id = $_POST['edit_id'];
|
2621 |
+
$rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET address = %s, lat = %f, lng = %f, anim = %d, infoopen = %d WHERE id = %d", sanitize_text_field($_POST['address']), $_POST['lat'], $_POST['lng'], $_POST['anim'], $_POST['infoopen'], $cur_id) );
|
2622 |
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
2623 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2624 |
$return_a = array(
|
2625 |
"marker_id" => $cur_id,
|
2626 |
+
"marker_data" => wpgmaps_return_markers(sanitize_text_field($_POST['map_id'])),
|
2627 |
+
"table_html" => wpgmza_return_marker_list(sanitize_text_field($_POST['map_id']))
|
2628 |
);
|
2629 |
echo json_encode($return_a);
|
2630 |
|
2638 |
LIMIT 1
|
2639 |
"
|
2640 |
);
|
2641 |
+
$wpgmza_check = wpgmaps_update_xml_file(sanitize_text_field($_POST['map_id']));
|
2642 |
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
2643 |
$return_a = array(
|
2644 |
"marker_id" => $marker_id,
|
2645 |
+
"marker_data" => wpgmaps_return_markers(sanitize_text_field($_POST['map_id'])),
|
2646 |
+
"table_html" => wpgmza_return_marker_list(sanitize_text_field($_POST['map_id']))
|
2647 |
);
|
2648 |
echo json_encode($return_a);
|
2649 |
|
2650 |
|
2651 |
}
|
2652 |
if ($_POST['action'] == "delete_poly") {
|
2653 |
+
$poly_id = sanitize_text_field($_POST['poly_id']);
|
2654 |
|
2655 |
$wpdb->query(
|
2656 |
"
|
2660 |
"
|
2661 |
);
|
2662 |
|
2663 |
+
echo wpgmza_b_return_polygon_list(sanitize_text_field($_POST['map_id']));
|
2664 |
|
2665 |
}
|
2666 |
if ($_POST['action'] == "delete_polyline") {
|
2667 |
+
$poly_id = sanitize_text_field($_POST['poly_id']);
|
2668 |
|
2669 |
$wpdb->query(
|
2670 |
"
|
2674 |
"
|
2675 |
);
|
2676 |
|
2677 |
+
echo wpgmza_b_return_polyline_list(sanitize_text_field($_POST['map_id']));
|
2678 |
|
2679 |
}
|
2680 |
|
3621 |
|
3622 |
if ($_GET['action'] == "trash" && isset($_GET['map_id'])) {
|
3623 |
if ($_GET['s'] == "1") {
|
3624 |
+
if (wpgmaps_trash_map(sanitize_text_field($_GET['map_id']))) {
|
3625 |
echo "<script>window.location = \"".get_option('siteurl')."/wp-admin/admin.php?page=wp-google-maps-menu\"</script>";
|
3626 |
} else {
|
3627 |
_e("There was a problem deleting the map.","wp-google-maps");
|
3628 |
}
|
3629 |
} else {
|
3630 |
+
$res = wpgmza_get_map_data(sanitize_text_field($_GET['map_id']));
|
3631 |
echo "<h2>".__("Delete your map","wp-google-maps")."</h2><p>".__("Are you sure you want to delete the map","wp-google-maps")." <strong>\"".$res->map_title."?\"</strong> <br /><a href='?page=wp-google-maps-menu&action=trash&map_id=".$_GET['map_id']."&s=1'>".__("Yes","wp-google-maps")."</a> | <a href='?page=wp-google-maps-menu'>".__("No","wp-google-maps")."</a></p>";
|
3632 |
}
|
3633 |
}
|
3634 |
if ($_GET['action'] == "duplicate" && isset($_GET['map_id'])) {
|
3635 |
if (function_exists('wpgmaps_duplicate_map')) {
|
3636 |
+
$new_id = wpgmaps_duplicate_map(sanitize_text_field($_GET['map_id']));
|
3637 |
if ($new_id > 0) {
|
3638 |
wpgmza_map_page();
|
3639 |
} else {
|
5116 |
|
5117 |
function wpgmza_edit_marker($mid) {
|
5118 |
global $wpgmza_tblname_maps;
|
5119 |
+
|
5120 |
global $wpdb;
|
5121 |
if ($_GET['action'] == "edit_marker" && isset($mid)) {
|
5122 |
+
$mid = sanitize_text_field($mid);
|
5123 |
$res = wpgmza_get_marker_data($mid);
|
5124 |
echo "
|
5125 |
<div class='wrap'>
|