Version Description
- Maps now automatically work in Tabs without having to add any code
- Added a "zoom level" slider to the Google map settings
- Added a check for GoDaddy Wordpress hosting and the APC object cache due to the issues that arise while using it
- Fixed a polyline bug
- Added "stroke opacity" options to polygons
- Added a warning when users want to use % for the map height
Download this release
Release Info
Developer | WPGMaps |
Plugin | WP Google Maps |
Version | 6.0.9 |
Comparing to | |
See all releases |
Code changes from version 6.0.8 to 6.0.9
- base/classes/WPGM_templates.php +1 -1
- base/includes/wp-google-maps-polygons.php +12 -1
- base/includes/wp-google-maps-polylines.php +2 -2
- cache/wpgmaps.tmp +0 -1
- js/wpgmaps_tabs.js +20 -0
- languages/wp-google-maps-de_DE.po +2 -2
- languages/wp-google-maps-default.po +1 -1
- readme.txt +9 -0
- wpGoogleMaps.php +324 -74
base/classes/WPGM_templates.php
CHANGED
@@ -99,7 +99,7 @@ class WPGMAPS_templates {
|
|
99 |
|
100 |
|
101 |
|
102 |
-
<a class="button-primary" href="admin.php?page=wp-google-maps-menu"><?php echo __("OK! Let's start","wp-google-maps"); ?></a>
|
103 |
|
104 |
</div>
|
105 |
</div>
|
99 |
|
100 |
|
101 |
|
102 |
+
<a class="button-primary" href="admin.php?page=wp-google-maps-menu&override=1"><?php echo __("OK! Let's start","wp-google-maps"); ?></a>
|
103 |
|
104 |
</div>
|
105 |
</div>
|
base/includes/wp-google-maps-polygons.php
CHANGED
@@ -26,6 +26,7 @@ function wpgmza_b_pro_add_poly($mid) {
|
|
26 |
<form action='?page=wp-google-maps-menu&action=edit&map_id=".$mid."' method='post' id='wpgmaps_add_poly_form'>
|
27 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
28 |
<p>Line Color:<input id=\"poly_line\" name=\"poly_line\" type=\"text\" class=\"color\" value=\"000000\" /></p>
|
|
|
29 |
<p>Fill Color:<input id=\"poly_fill\" name=\"poly_fill\" type=\"text\" class=\"color\" value=\"66ff00\" /></p>
|
30 |
<p>Opacity:<input id=\"poly_opacity\" name=\"poly_opacity\" type=\"text\" value=\"0.5\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
31 |
<div id=\"wpgmza_map\"> </div>
|
@@ -75,6 +76,7 @@ function wpgmza_b_pro_edit_poly($mid) {
|
|
75 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
76 |
<input type='hidden' name='wpgmaps_poly_id' id='wpgmaps_poly_id' value='".$_GET['poly_id']."' />
|
77 |
<p>Line Color:<input id=\"poly_line\" name=\"poly_line\" type=\"text\" class=\"color\" value=\"".$pol->linecolor."\" /></p>
|
|
|
78 |
<p>Fill Color:<input id=\"poly_fill\" name=\"poly_fill\" type=\"text\" class=\"color\" value=\"".$pol->fillcolor."\" /></p>
|
79 |
<p>Opacity:<input id=\"poly_opacity\" name=\"poly_opacity\" type=\"text\" value=\"".$pol->opacity."\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
80 |
<div id=\"wpgmza_map\"> </div>
|
@@ -152,6 +154,9 @@ function wpgmaps_b_admin_add_poly_javascript($mapid) {
|
|
152 |
jQuery("#poly_fill").focusout(function() {
|
153 |
poly.setOptions({ fillColor: "#"+jQuery("#poly_fill").val() });
|
154 |
});
|
|
|
|
|
|
|
155 |
jQuery("#poly_opacity").keyup(function() {
|
156 |
poly.setOptions({ fillOpacity: jQuery("#poly_opacity").val() });
|
157 |
});
|
@@ -300,6 +305,9 @@ function wpgmaps_b_admin_edit_poly_javascript($mapid,$polyid) {
|
|
300 |
jQuery("#poly_opacity").keyup(function() {
|
301 |
poly.setOptions({ fillOpacity: jQuery("#poly_opacity").val() });
|
302 |
});
|
|
|
|
|
|
|
303 |
});
|
304 |
|
305 |
|
@@ -332,11 +340,13 @@ function wpgmaps_b_admin_edit_poly_javascript($mapid,$polyid) {
|
|
332 |
|
333 |
$polyoptions = wpgmza_b_return_poly_options($polyid);
|
334 |
$linecolor = $polyoptions->linecolor;
|
|
|
335 |
$fillcolor = $polyoptions->fillcolor;
|
336 |
$fillopacity = $polyoptions->opacity;
|
337 |
if (!$linecolor) { $linecolor = "000000"; }
|
338 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
339 |
-
if (
|
|
|
340 |
$linecolor = "#".$linecolor;
|
341 |
$fillcolor = "#".$fillcolor;
|
342 |
|
@@ -359,6 +369,7 @@ function wpgmaps_b_admin_edit_poly_javascript($mapid,$polyid) {
|
|
359 |
poly = new google.maps.Polygon({
|
360 |
strokeWeight: 3,
|
361 |
strokeColor: "<?php echo $linecolor; ?>",
|
|
|
362 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
363 |
fillColor: "<?php echo $fillcolor; ?>"
|
364 |
});
|
26 |
<form action='?page=wp-google-maps-menu&action=edit&map_id=".$mid."' method='post' id='wpgmaps_add_poly_form'>
|
27 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
28 |
<p>Line Color:<input id=\"poly_line\" name=\"poly_line\" type=\"text\" class=\"color\" value=\"000000\" /></p>
|
29 |
+
<p>Line Opacity:<input id=\"poly_line_opacity\" name=\"poly_line_opacity\" type=\"text\" value=\"0.5\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
30 |
<p>Fill Color:<input id=\"poly_fill\" name=\"poly_fill\" type=\"text\" class=\"color\" value=\"66ff00\" /></p>
|
31 |
<p>Opacity:<input id=\"poly_opacity\" name=\"poly_opacity\" type=\"text\" value=\"0.5\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
32 |
<div id=\"wpgmza_map\"> </div>
|
76 |
<input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='".$mid."' />
|
77 |
<input type='hidden' name='wpgmaps_poly_id' id='wpgmaps_poly_id' value='".$_GET['poly_id']."' />
|
78 |
<p>Line Color:<input id=\"poly_line\" name=\"poly_line\" type=\"text\" class=\"color\" value=\"".$pol->linecolor."\" /></p>
|
79 |
+
<p>Line Opacity:<input id=\"poly_line_opacity\" name=\"poly_line_opacity\" type=\"text\" value=\"".$pol->lineopacity."\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
80 |
<p>Fill Color:<input id=\"poly_fill\" name=\"poly_fill\" type=\"text\" class=\"color\" value=\"".$pol->fillcolor."\" /></p>
|
81 |
<p>Opacity:<input id=\"poly_opacity\" name=\"poly_opacity\" type=\"text\" value=\"".$pol->opacity."\" /> (0 - 1.0) example: 0.5 for 50%</p>
|
82 |
<div id=\"wpgmza_map\"> </div>
|
154 |
jQuery("#poly_fill").focusout(function() {
|
155 |
poly.setOptions({ fillColor: "#"+jQuery("#poly_fill").val() });
|
156 |
});
|
157 |
+
jQuery("#poly_line_opacity").focusout(function() {
|
158 |
+
poly.setOptions({ strokeOpacity: jQuery("#poly_line_opacity").val() });
|
159 |
+
});
|
160 |
jQuery("#poly_opacity").keyup(function() {
|
161 |
poly.setOptions({ fillOpacity: jQuery("#poly_opacity").val() });
|
162 |
});
|
305 |
jQuery("#poly_opacity").keyup(function() {
|
306 |
poly.setOptions({ fillOpacity: jQuery("#poly_opacity").val() });
|
307 |
});
|
308 |
+
jQuery("#poly_line_opacity").keyup(function() {
|
309 |
+
poly.setOptions({ strokeOpacity: jQuery("#poly_line_opacity").val() });
|
310 |
+
});
|
311 |
});
|
312 |
|
313 |
|
340 |
|
341 |
$polyoptions = wpgmza_b_return_poly_options($polyid);
|
342 |
$linecolor = $polyoptions->linecolor;
|
343 |
+
$lineopacity = $polyoptions->lineopacity;
|
344 |
$fillcolor = $polyoptions->fillcolor;
|
345 |
$fillopacity = $polyoptions->opacity;
|
346 |
if (!$linecolor) { $linecolor = "000000"; }
|
347 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
348 |
+
if ($fillopacity == "") { $fillopacity = "0.5"; }
|
349 |
+
if ($lineopacity == "") { $lineopacity = "1"; }
|
350 |
$linecolor = "#".$linecolor;
|
351 |
$fillcolor = "#".$fillcolor;
|
352 |
|
369 |
poly = new google.maps.Polygon({
|
370 |
strokeWeight: 3,
|
371 |
strokeColor: "<?php echo $linecolor; ?>",
|
372 |
+
strokeOpacity: "<?php echo $lineopacity; ?>",
|
373 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
374 |
fillColor: "<?php echo $fillcolor; ?>"
|
375 |
});
|
base/includes/wp-google-maps-polylines.php
CHANGED
@@ -357,9 +357,9 @@ function wpgmaps_b_admin_edit_polyline_javascript($mapid,$polyid) {
|
|
357 |
|
358 |
|
359 |
<?php
|
360 |
-
$poly_array =
|
361 |
|
362 |
-
$polyoptions =
|
363 |
$linecolor = $polyoptions->linecolor;
|
364 |
$fillopacity = $polyoptions->opacity;
|
365 |
if (!$linecolor) { $linecolor = "000000"; }
|
357 |
|
358 |
|
359 |
<?php
|
360 |
+
$poly_array = wpgmza_b_return_polyline_array($polyid);
|
361 |
|
362 |
+
$polyoptions = wpgmza_b_return_polyline_options($polyid);
|
363 |
$linecolor = $polyoptions->linecolor;
|
364 |
$fillopacity = $polyoptions->opacity;
|
365 |
if (!$linecolor) { $linecolor = "000000"; }
|
cache/wpgmaps.tmp
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
Permission Check
|
|
js/wpgmaps_tabs.js
CHANGED
@@ -1,4 +1,24 @@
|
|
1 |
jQuery("document").ready(function() {
|
2 |
jQuery("#wpgmaps_tabs").tabs();
|
3 |
jQuery("#wpgmaps_tabs_markers").tabs();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
});
|
1 |
jQuery("document").ready(function() {
|
2 |
jQuery("#wpgmaps_tabs").tabs();
|
3 |
jQuery("#wpgmaps_tabs_markers").tabs();
|
4 |
+
|
5 |
+
jQuery( "#slider-range-max" ).slider({
|
6 |
+
range: "max",
|
7 |
+
min: 1,
|
8 |
+
max: 21,
|
9 |
+
value: jQuery( "#amount" ).val(),
|
10 |
+
slide: function( event, ui ) {
|
11 |
+
jQuery("#wpgmza_start_zoom").val(ui.value);
|
12 |
+
MYMAP.map.setZoom(ui.value);
|
13 |
+
|
14 |
+
|
15 |
+
}
|
16 |
+
});
|
17 |
+
|
18 |
+
jQuery('#wpgmza_map_height_type').on('change', function() {
|
19 |
+
if (this.value === "%") {
|
20 |
+
jQuery("#wpgmza_height_warning").show();
|
21 |
+
}
|
22 |
+
});
|
23 |
+
|
24 |
});
|
languages/wp-google-maps-de_DE.po
CHANGED
@@ -683,12 +683,12 @@ msgstr "Straßenverkehr aktivieren?"
|
|
683 |
msgid ""
|
684 |
"Get the rest of these advanced features with the Pro version for only <a "
|
685 |
"href=\"http://www.wpgmaps.com/purchase-professional-version/?"
|
686 |
-
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$
|
687 |
"a>. Support and updates included forever."
|
688 |
msgstr ""
|
689 |
"Erhalten Sie weitere Funktionen mit der Pro Version <a href=\"http://www."
|
690 |
"wpgmaps.com/purchase-professional-version/?"
|
691 |
-
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$
|
692 |
"a>. Beinhaltet alle updates und Support auf Lebenszeit. "
|
693 |
|
694 |
#: C:\wamp\www\wordpress38\wp-content\plugins\wp-google-maps/wpGoogleMaps.php:2982
|
683 |
msgid ""
|
684 |
"Get the rest of these advanced features with the Pro version for only <a "
|
685 |
"href=\"http://www.wpgmaps.com/purchase-professional-version/?"
|
686 |
+
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$19.99 once off</"
|
687 |
"a>. Support and updates included forever."
|
688 |
msgstr ""
|
689 |
"Erhalten Sie weitere Funktionen mit der Pro Version <a href=\"http://www."
|
690 |
"wpgmaps.com/purchase-professional-version/?"
|
691 |
+
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$19.99 einmalig</"
|
692 |
"a>. Beinhaltet alle updates und Support auf Lebenszeit. "
|
693 |
|
694 |
#: C:\wamp\www\wordpress38\wp-content\plugins\wp-google-maps/wpGoogleMaps.php:2982
|
languages/wp-google-maps-default.po
CHANGED
@@ -669,7 +669,7 @@ msgstr ""
|
|
669 |
msgid ""
|
670 |
"Get the rest of these advanced features with the Pro version for only <a "
|
671 |
"href=\"http://www.wpgmaps.com/purchase-professional-version/?"
|
672 |
-
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$
|
673 |
"a>. Support and updates included forever."
|
674 |
msgstr ""
|
675 |
|
669 |
msgid ""
|
670 |
"Get the rest of these advanced features with the Pro version for only <a "
|
671 |
"href=\"http://www.wpgmaps.com/purchase-professional-version/?"
|
672 |
+
"utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$19.99 once off</"
|
673 |
"a>. Support and updates included forever."
|
674 |
msgstr ""
|
675 |
|
readme.txt
CHANGED
@@ -98,6 +98,15 @@ Previous versions may cause your blog to slow down. Upgrading to 4.5 will get ri
|
|
98 |
|
99 |
|
100 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
= 6.0.8 =
|
102 |
* Fixed a Mac Firefox style issue with the WP Google Maps Store Locator
|
103 |
* Fixed a function error in the polyline functions file
|
98 |
|
99 |
|
100 |
== Changelog ==
|
101 |
+
|
102 |
+
= 6.0.9 =
|
103 |
+
* Maps now automatically work in Tabs without having to add any code
|
104 |
+
* Added a "zoom level" slider to the Google map settings
|
105 |
+
* Added a check for GoDaddy Wordpress hosting and the APC object cache due to the issues that arise while using it
|
106 |
+
* Fixed a polyline bug
|
107 |
+
* Added "stroke opacity" options to polygons
|
108 |
+
* Added a warning when users want to use % for the map height
|
109 |
+
|
110 |
= 6.0.8 =
|
111 |
* Fixed a Mac Firefox style issue with the WP Google Maps Store Locator
|
112 |
* Fixed a function error in the polyline functions file
|
wpGoogleMaps.php
CHANGED
@@ -3,12 +3,20 @@
|
|
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.0.
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
* 6.0.8
|
13 |
* Fixed a Mac Firefox style issue with the Store Locator
|
14 |
* Fixed a function error in the polyline functions file
|
@@ -79,8 +87,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
|
|
79 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
80 |
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
|
81 |
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
|
82 |
-
$wpgmza_version = "6.0.
|
83 |
-
$wpgmza_p_version = "6.0.
|
84 |
$wpgmza_t = "basic";
|
85 |
define("WPGMAPS", $wpgmza_version);
|
86 |
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
|
@@ -226,14 +234,28 @@ function wpgmaps_init() {
|
|
226 |
|
227 |
/* handle first time users and updates */
|
228 |
if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
|
229 |
-
|
230 |
-
if
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
}
|
239 |
|
@@ -466,12 +488,21 @@ function wpgmaps_admin_javascript_basic() {
|
|
466 |
else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
|
467 |
|
468 |
if (!$_GET['map_id']) { return; }
|
469 |
-
wpgmaps_update_xml_file($_GET['map_id']);
|
|
|
|
|
|
|
470 |
//$wpgmza_data = get_option('WPGMZA');
|
471 |
|
472 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
473 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
474 |
|
|
|
|
|
|
|
|
|
|
|
|
|
475 |
|
476 |
$wpgmza_lat = $res->map_start_lat;
|
477 |
$wpgmza_lng = $res->map_start_lng;
|
@@ -483,6 +514,7 @@ function wpgmaps_admin_javascript_basic() {
|
|
483 |
$wpgmza_traffic = $res->traffic;
|
484 |
$wpgmza_bicycle = $res->bicycle;
|
485 |
|
|
|
486 |
$wpgmza_open_infowindow_by = $wpgmza_settings['wpgmza_settings_map_open_marker_by'];
|
487 |
if ($wpgmza_open_infowindow_by == null || !isset($wpgmza_open_infowindow_by)) { $wpgmza_open_infowindow_by = '1'; }
|
488 |
|
@@ -502,10 +534,24 @@ function wpgmaps_admin_javascript_basic() {
|
|
502 |
|
503 |
|
504 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
<script type="text/javascript">
|
506 |
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
507 |
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
508 |
</script>
|
|
|
|
|
509 |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
|
510 |
|
511 |
<link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
|
@@ -835,9 +881,11 @@ function wpgmaps_admin_javascript_basic() {
|
|
835 |
$linecolor = $polyoptions->linecolor;
|
836 |
$fillcolor = $polyoptions->fillcolor;
|
837 |
$fillopacity = $polyoptions->opacity;
|
|
|
838 |
if (!$linecolor) { $linecolor = "000000"; }
|
839 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
840 |
-
if (
|
|
|
841 |
$linecolor = "#".$linecolor;
|
842 |
$fillcolor = "#".$fillcolor;
|
843 |
|
@@ -867,6 +915,7 @@ function wpgmaps_admin_javascript_basic() {
|
|
867 |
path: WPGM_PathData_<?php echo $poly_id; ?>,
|
868 |
strokeColor: "<?php echo $linecolor; ?>",
|
869 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
|
|
870 |
fillColor: "<?php echo $fillcolor; ?>",
|
871 |
strokeWeight: 2
|
872 |
});
|
@@ -933,11 +982,23 @@ function wpgmaps_admin_javascript_basic() {
|
|
933 |
|
934 |
<?php if ($wpgmza_bicycle == "1") { ?>
|
935 |
var bikeLayer = new google.maps.BicyclingLayer();
|
936 |
-
bikeLayer.setMap(
|
937 |
<?php } ?>
|
938 |
<?php if ($wpgmza_traffic == "1") { ?>
|
939 |
var trafficLayer = new google.maps.TrafficLayer();
|
940 |
-
trafficLayer.setMap(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
<?php } ?>
|
942 |
|
943 |
|
@@ -1049,6 +1110,12 @@ function wpgmaps_user_javascript_basic() {
|
|
1049 |
$res = wpgmza_get_map_data($wpgmza_current_map_id);
|
1050 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
1051 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1052 |
$wpgmza_lat = $res->map_start_lat;
|
1053 |
$wpgmza_lng = $res->map_start_lng;
|
1054 |
$wpgmza_width = $res->map_width;
|
@@ -1071,12 +1138,27 @@ function wpgmaps_user_javascript_basic() {
|
|
1071 |
if (!$wpgmza_lat || !$wpgmza_lng) { $wpgmza_lat = "51.5081290"; $wpgmza_lng = "-0.1280050"; }
|
1072 |
|
1073 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
1074 |
<script type="text/javascript">
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
|
|
|
|
|
|
|
|
|
|
1079 |
</script>
|
|
|
|
|
|
|
|
|
1080 |
<script type="text/javascript" >
|
1081 |
|
1082 |
if ('undefined' == typeof window.jQuery) {
|
@@ -1102,7 +1184,7 @@ function wpgmaps_user_javascript_basic() {
|
|
1102 |
UniqueCode=Math.round(Math.random()*10000);
|
1103 |
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
|
1104 |
|
1105 |
-
jQuery('body').on('
|
1106 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
1107 |
UniqueCode=Math.round(Math.random()*10000);
|
1108 |
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
|
@@ -1145,11 +1227,13 @@ function wpgmaps_user_javascript_basic() {
|
|
1145 |
foreach ($total_poly_array as $poly_id) {
|
1146 |
$polyoptions = wpgmza_b_return_poly_options($poly_id);
|
1147 |
$linecolor = $polyoptions->linecolor;
|
|
|
1148 |
$fillcolor = $polyoptions->fillcolor;
|
1149 |
$fillopacity = $polyoptions->opacity;
|
1150 |
if (!$linecolor) { $linecolor = "000000"; }
|
1151 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
1152 |
-
if (
|
|
|
1153 |
$linecolor = "#".$linecolor;
|
1154 |
$fillcolor = "#".$fillcolor;
|
1155 |
|
@@ -1178,6 +1262,7 @@ function wpgmaps_user_javascript_basic() {
|
|
1178 |
var WPGM_Path_<?php echo $poly_id; ?> = new google.maps.Polygon({
|
1179 |
path: WPGM_PathData_<?php echo $poly_id; ?>,
|
1180 |
strokeColor: "<?php echo $linecolor; ?>",
|
|
|
1181 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
1182 |
fillColor: "<?php echo $fillcolor; ?>",
|
1183 |
strokeWeight: 2
|
@@ -1243,7 +1328,18 @@ function wpgmaps_user_javascript_basic() {
|
|
1243 |
var trafficLayer = new google.maps.TrafficLayer();
|
1244 |
trafficLayer.setMap(this.map);
|
1245 |
<?php } ?>
|
1246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1247 |
|
1248 |
google.maps.event.addListener(MYMAP.map, 'click', function() {
|
1249 |
infoWindow.close();
|
@@ -1570,7 +1666,9 @@ function wpgmaps_update_xml_file($mapid = false) {
|
|
1570 |
|
1571 |
if (is_multisite()) {
|
1572 |
global $blog_id;
|
1573 |
-
$dom->save($upload_dir['basedir'].'/wp-google-maps/'.$blog_id.'-'.$mapid.'markers.xml')
|
|
|
|
|
1574 |
} else {
|
1575 |
|
1576 |
|
@@ -1578,18 +1676,21 @@ function wpgmaps_update_xml_file($mapid = false) {
|
|
1578 |
if (function_exists('wpgmza_register_pro_version')) {
|
1579 |
$prov = get_option("WPGMZA_PRO");
|
1580 |
$wpgmza_pro_version = $prov['version'];
|
1581 |
-
$dom->save($upload_dir['basedir'].'/wp-google-maps/'.$mapid.'markers.xml')
|
|
|
|
|
1582 |
}
|
1583 |
else {
|
1584 |
-
$dom->save($upload_dir['basedir'].'/wp-google-maps/'.$mapid.'markers.xml')
|
|
|
|
|
1585 |
}
|
1586 |
-
|
1587 |
}
|
1588 |
-
|
|
|
1589 |
}
|
1590 |
|
1591 |
|
1592 |
-
|
1593 |
function wpgmaps_update_all_xml_file() {
|
1594 |
global $wpdb;
|
1595 |
$table_name = $wpdb->prefix . "wpgmza_maps";
|
@@ -1597,7 +1698,8 @@ function wpgmaps_update_all_xml_file() {
|
|
1597 |
|
1598 |
foreach ( $results as $result ) {
|
1599 |
$map_id = $result->id;
|
1600 |
-
wpgmaps_update_xml_file($map_id);
|
|
|
1601 |
}
|
1602 |
}
|
1603 |
|
@@ -1616,13 +1718,16 @@ function wpgmaps_action_callback_basic() {
|
|
1616 |
|
1617 |
if ($_POST['action'] == "add_marker") {
|
1618 |
$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'] ) );
|
1619 |
-
wpgmaps_update_xml_file($_POST['map_id']);
|
|
|
|
|
1620 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1621 |
}
|
1622 |
if ($_POST['action'] == "edit_marker") {
|
1623 |
$cur_id = $_POST['edit_id'];
|
1624 |
$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) );
|
1625 |
-
wpgmaps_update_xml_file($_POST['map_id']);
|
|
|
1626 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1627 |
}
|
1628 |
if ($_POST['action'] == "delete_marker") {
|
@@ -1634,7 +1739,8 @@ function wpgmaps_action_callback_basic() {
|
|
1634 |
LIMIT 1
|
1635 |
"
|
1636 |
);
|
1637 |
-
wpgmaps_update_xml_file($_POST['map_id']);
|
|
|
1638 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1639 |
|
1640 |
}
|
@@ -1694,6 +1800,7 @@ function wpgmaps_tag_basic( $atts ) {
|
|
1694 |
|
1695 |
|
1696 |
wpgmza_check_if_marker_file_exists($wpgmza_current_map_id);
|
|
|
1697 |
|
1698 |
$map_width_type = stripslashes($res->map_width_type);
|
1699 |
$map_height_type = stripslashes($res->map_height_type);
|
@@ -1738,7 +1845,10 @@ function wpgmza_check_if_marker_file_exists($mapid) {
|
|
1738 |
if (file_exists($upload_dir['path'].'/wp-google-maps/'.$blog_id.'-'.$mapid.'markers.xml')) {
|
1739 |
/* all OK */
|
1740 |
} else {
|
1741 |
-
|
|
|
|
|
|
|
1742 |
|
1743 |
}
|
1744 |
}
|
@@ -1746,7 +1856,9 @@ function wpgmza_check_if_marker_file_exists($mapid) {
|
|
1746 |
if (file_exists($upload_dir['path'].'/wp-google-maps/'.$mapid.'markers.xml')) {
|
1747 |
|
1748 |
} else {
|
1749 |
-
wpgmaps_update_xml_file($mapid);
|
|
|
|
|
1750 |
}
|
1751 |
}
|
1752 |
}
|
@@ -1770,8 +1882,8 @@ function wpgmaps_sl_user_output_basic($map_id) {
|
|
1770 |
$ret_msg .= " <div style=\"display:block; width:".$map_width.$map_width_type."; height:30px; margin-top:10px; clear:both;\">";
|
1771 |
$ret_msg .= " <div style=\"display:block; float:left; width:150px;\">".__("Radius","wp-google-maps").":</div>";
|
1772 |
$ret_msg .= " <div style=\"display:block; float:left; width:250px;\">";
|
1773 |
-
$ret_msg .= " <
|
1774 |
-
$ret_msg .= "
|
1775 |
|
1776 |
if ($map_other_settings['store_locator_distance'] == 1) {
|
1777 |
$ret_msg .= " <option value=\"1\">".__("1mi","wp-google-maps")."</option>";
|
@@ -1797,11 +1909,11 @@ function wpgmaps_sl_user_output_basic($map_id) {
|
|
1797 |
$ret_msg .= " <option value=\"300\">".__("300km","wp-google-maps")."</option>";
|
1798 |
}
|
1799 |
|
1800 |
-
$ret_msg .= " </select
|
1801 |
$ret_msg .= " </div>";
|
1802 |
$ret_msg .= " </div>";
|
1803 |
|
1804 |
-
if (function_exists("wpgmza_register_pro_version")) {
|
1805 |
$ret_msg .= " <div style=\"display:block; width:".$map_width.$map_width_type."; clear:both; height:auto; overflow:auto; margin-top:10px; margin-bottom:10px; clear:both;\">";
|
1806 |
$ret_msg .= " <div style=\"display:block; float:left; width:150px;\">".__("Category","wp-google-maps").":</div>";
|
1807 |
$ret_msg .= " <div style=\"display:block; float:left; \">";
|
@@ -1857,6 +1969,10 @@ function wpgmaps_head() {
|
|
1857 |
$other_settings['store_locator_enabled'] = intval($_POST['wpgmza_store_locator']);
|
1858 |
$other_settings['store_locator_distance'] = intval($_POST['wpgmza_store_locator_distance']);
|
1859 |
|
|
|
|
|
|
|
|
|
1860 |
$other_settings_data = maybe_serialize($other_settings);
|
1861 |
|
1862 |
$data['map_default_starting_lat'] = $map_start_lat;
|
@@ -1943,12 +2059,14 @@ function wpgmaps_head() {
|
|
1943 |
$linecolor = esc_attr($_POST['poly_line']);
|
1944 |
$fillcolor = esc_attr($_POST['poly_fill']);
|
1945 |
$opacity = esc_attr($_POST['poly_opacity']);
|
|
|
1946 |
|
1947 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1948 |
"INSERT INTO $wpgmza_tblname_poly SET
|
1949 |
map_id = %d,
|
1950 |
polydata = %s,
|
1951 |
linecolor = %s,
|
|
|
1952 |
fillcolor = %s,
|
1953 |
opacity = %s
|
1954 |
",
|
@@ -1956,6 +2074,7 @@ function wpgmaps_head() {
|
|
1956 |
$mid,
|
1957 |
$wpgmaps_polydata,
|
1958 |
$linecolor,
|
|
|
1959 |
$fillcolor,
|
1960 |
$opacity
|
1961 |
)
|
@@ -1975,11 +2094,13 @@ function wpgmaps_head() {
|
|
1975 |
$linecolor = esc_attr($_POST['poly_line']);
|
1976 |
$fillcolor = esc_attr($_POST['poly_fill']);
|
1977 |
$opacity = esc_attr($_POST['poly_opacity']);
|
|
|
1978 |
|
1979 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1980 |
"UPDATE $wpgmza_tblname_poly SET
|
1981 |
polydata = %s,
|
1982 |
linecolor = %s,
|
|
|
1983 |
fillcolor = %s,
|
1984 |
opacity = %s
|
1985 |
WHERE `id` = %d"
|
@@ -1987,6 +2108,7 @@ function wpgmaps_head() {
|
|
1987 |
|
1988 |
$wpgmaps_polydata,
|
1989 |
$linecolor,
|
|
|
1990 |
$fillcolor,
|
1991 |
$opacity,
|
1992 |
$pid
|
@@ -2678,6 +2800,15 @@ function wpgmaps_settings_page_basic() {
|
|
2678 |
|
2679 |
|
2680 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2681 |
";
|
2682 |
|
2683 |
echo "</div>";
|
@@ -2700,7 +2831,7 @@ function wpgmza_map_page() {
|
|
2700 |
}
|
2701 |
else {
|
2702 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("My Maps","wp-google-maps")."</h2>";
|
2703 |
-
echo"<p><i><a href='http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=mappage_1' title='".__("Pro Version","wp-google-maps")."'>".__("Create unlimited maps","wp-google-maps")."</a> ".__("with the","wp-google-maps")." <a href='http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=mappage_2' title='Pro Version'>".__("Pro Version","wp-google-maps")."</a> ".__("of WP Google Maps for only","wp-google-maps")." <strong>$
|
2704 |
wpgmaps_list_maps();
|
2705 |
|
2706 |
|
@@ -2842,6 +2973,14 @@ function wpgmza_basic_menu() {
|
|
2842 |
|
2843 |
|
2844 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2845 |
|
2846 |
|
2847 |
if ($res->map_start_zoom) { $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED"; } else { $wpgmza_zoom[8] = "SELECTED"; }
|
@@ -2850,7 +2989,6 @@ function wpgmza_basic_menu() {
|
|
2850 |
if ($res->bicycle) { $wpgmza_bicycle[intval($res->bicycle)] = "SELECTED"; } else { $wpgmza_bicycle[2] = "SELECTED"; }
|
2851 |
if ($res->traffic) { $wpgmza_traffic[intval($res->traffic)] = "SELECTED"; } else { $wpgmza_traffic[2] = "SELECTED"; }
|
2852 |
|
2853 |
-
|
2854 |
if (stripslashes($res->map_width_type) == "%") { $wpgmza_map_width_type_percentage = "SELECTED"; $wpgmza_map_width_type_px = ""; } else { $wpgmza_map_width_type_px = "SELECTED"; $wpgmza_map_width_type_percentage = ""; }
|
2855 |
if (stripslashes($res->map_height_type) == "%") { $wpgmza_map_height_type_percentage = "SELECTED"; $wpgmza_map_height_type_px = ""; } else { $wpgmza_map_height_type_px = "SELECTED"; $wpgmza_map_height_type_percentage = ""; }
|
2856 |
|
@@ -2870,18 +3008,15 @@ function wpgmza_basic_menu() {
|
|
2870 |
if (!isset($wpgmza_traffic[$i])) { $wpgmza_traffic[$i] = ""; }
|
2871 |
}
|
2872 |
|
2873 |
-
$other_settings_data = maybe_unserialize($res->other_settings);
|
2874 |
-
$wpgmza_store_locator_enabled = $other_settings_data['store_locator_enabled'];
|
2875 |
-
$wpgmza_store_locator_distance = $other_settings_data['store_locator_distance'];
|
2876 |
|
2877 |
|
2878 |
$wpgmza_store_locator_enabled_checked[0] = '';
|
2879 |
$wpgmza_store_locator_enabled_checked[1] = '';
|
2880 |
$wpgmza_store_locator_distance_checked[0] = '';
|
2881 |
$wpgmza_store_locator_distance_checked[1] = '';
|
|
|
2882 |
if ($wpgmza_store_locator_enabled == 1) {
|
2883 |
$wpgmza_store_locator_enabled_checked[0] = 'selected';
|
2884 |
-
|
2885 |
} else {
|
2886 |
$wpgmza_store_locator_enabled_checked[1] = 'selected';
|
2887 |
}
|
@@ -2890,10 +3025,34 @@ function wpgmza_basic_menu() {
|
|
2890 |
} else {
|
2891 |
$wpgmza_store_locator_distance_checked[1] = 'selected';
|
2892 |
}
|
|
|
2893 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2894 |
|
2895 |
$wpgmza_act = "disabled readonly";
|
2896 |
-
$wpgmza_act_msg = "<div class=\"update-nag\" style=\"padding:5px; \">".__("Add custom icons, titles, descriptions, pictures and links to your markers with the","wp-google-maps")." \"<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=below_marker\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a>\" ".__("of this plugin for just","wp-google-maps")." <strong>$
|
2897 |
$wpgmza_csv = "<p><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=csv_link\" title=\"".__("Pro Edition","wp-google-maps")."\">".__("Purchase the Pro Edition","wp-google-maps")."</a> ".__("of WP Google Maps and save your markers to a CSV file!","wp-google-maps")."</p>";
|
2898 |
}
|
2899 |
|
@@ -2946,29 +3105,29 @@ function wpgmza_basic_menu() {
|
|
2946 |
<input type='hidden' name='http_referer' value='".$_SERVER['PHP_SELF']."' />
|
2947 |
<input type='hidden' name='wpgmza_id' id='wpgmza_id' value='".$res->id."' />
|
2948 |
<input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='".$res->map_start_location."' />
|
2949 |
-
<select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
<table>
|
2973 |
<tr>
|
2974 |
<td>".__("Short code","wp-google-maps").":</td>
|
@@ -2995,10 +3154,16 @@ function wpgmza_basic_menu() {
|
|
2995 |
<select id='wpgmza_map_height_type' name='wpgmza_map_height_type'>
|
2996 |
<option value=\"px\" $wpgmza_map_height_type_px>px</option>
|
2997 |
<option value=\"%\" $wpgmza_map_height_type_percentage>%</option>
|
2998 |
-
</select>
|
2999 |
|
3000 |
</td>
|
3001 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
3002 |
<tr>
|
3003 |
<td>".__("Map Alignment","wp-google-maps").":</td>
|
3004 |
<td><select id='wpgmza_map_align' name='wpgmza_map_align'>
|
@@ -3027,7 +3192,7 @@ function wpgmza_basic_menu() {
|
|
3027 |
<div class=\"wpgm_notice_message\">
|
3028 |
<ul>
|
3029 |
<li>
|
3030 |
-
<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=directions\">Enable directions</a> with the Pro version for only $
|
3031 |
</li>
|
3032 |
</ul>
|
3033 |
</div>
|
@@ -3113,12 +3278,36 @@ function wpgmza_basic_menu() {
|
|
3113 |
<option value=\"2\" ".$wpgmza_traffic[2].">".__("No","wp-google-maps")."</option>
|
3114 |
</select></td>
|
3115 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3116 |
</table>
|
3117 |
|
3118 |
<div class=\"wpgm_notice_message\">
|
3119 |
<ul>
|
3120 |
<li>
|
3121 |
-
".__("Get the rest of these advanced features with the Pro version for only <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$
|
3122 |
</li>
|
3123 |
</ul>
|
3124 |
</div>
|
@@ -3278,8 +3467,8 @@ function wpgmza_basic_menu() {
|
|
3278 |
</div>
|
3279 |
</div>
|
3280 |
|
3281 |
-
<br /><p>Get all of this and more for only $
|
3282 |
-
<br /><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=upgradenow\" title=\"Upgrade now for only $
|
3283 |
<br /><br />
|
3284 |
<a href=\"http://www.wpgmaps.com/demo/\" target=\"_BLANK\">View the demos</a>.<br /><br />
|
3285 |
Have a sales question? Contact either Nick or Mark on <a href=\"mailto:nick@wpgmaps.com\">nick@wpgmaps.com</a> or use our <a href=\"http://www.wpgmaps.com/contact-us/\" target=\"_BLANK\">contact form</a>. <br /><br />
|
@@ -3463,7 +3652,7 @@ function wpgmza_basic_menu() {
|
|
3463 |
<table style='clear:both;'>
|
3464 |
<tr>
|
3465 |
<td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_markers.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
|
3466 |
-
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add detailed information to your markers for only","wp-google-maps")." <strong>$
|
3467 |
</tr>
|
3468 |
<tr>
|
3469 |
<td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_marker_icons.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add custom markers to your map!","wp-google-maps")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
|
@@ -3560,6 +3749,7 @@ function wpgmza_edit_marker($mid) {
|
|
3560 |
function wpgmaps_admin_scripts() {
|
3561 |
wp_enqueue_script( 'jquery' );
|
3562 |
wp_enqueue_script('jquery-ui-core');
|
|
|
3563 |
|
3564 |
if (function_exists('wp_enqueue_media')) {
|
3565 |
wp_enqueue_media();
|
@@ -3581,6 +3771,8 @@ function wpgmaps_admin_scripts() {
|
|
3581 |
wp_enqueue_script( 'jquery-ui-tabs');
|
3582 |
wp_register_script('my-wpgmaps-tabs', plugins_url('js/wpgmaps_tabs.js',__FILE__), array('jquery-ui-core'), '1.0.1', true);
|
3583 |
wp_enqueue_script('my-wpgmaps-tabs');
|
|
|
|
|
3584 |
}
|
3585 |
}
|
3586 |
}
|
@@ -3964,6 +4156,7 @@ function wpgmaps_handle_db() {
|
|
3964 |
map_id int(11) NOT NULL,
|
3965 |
polydata LONGTEXT NOT NULL,
|
3966 |
linecolor VARCHAR(7) NOT NULL,
|
|
|
3967 |
fillcolor VARCHAR(7) NOT NULL,
|
3968 |
opacity VARCHAR(3) NOT NULL,
|
3969 |
PRIMARY KEY (id)
|
@@ -4176,4 +4369,61 @@ function wpgmza_get_category_icon($cat_id) {
|
|
4176 |
return $result;
|
4177 |
}
|
4178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.0.9
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
+
* 6.0.9
|
13 |
+
* Maps now automatically work in Tabs without having to add any code
|
14 |
+
* Added a "zoom level" slider to the Google map settings
|
15 |
+
* Added a check for GoDaddy Wordpress hosting and the APC object cache due to the issues that arise while using it
|
16 |
+
* Fixed a polyline bug
|
17 |
+
* Added "stroke opacity" options to polygons
|
18 |
+
* Added a warning when users want to use % for the map height
|
19 |
+
*
|
20 |
* 6.0.8
|
21 |
* Fixed a Mac Firefox style issue with the Store Locator
|
22 |
* Fixed a function error in the polyline functions file
|
87 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
88 |
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
|
89 |
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
|
90 |
+
$wpgmza_version = "6.0.9";
|
91 |
+
$wpgmza_p_version = "6.0.9";
|
92 |
$wpgmza_t = "basic";
|
93 |
define("WPGMAPS", $wpgmza_version);
|
94 |
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
|
234 |
|
235 |
/* handle first time users and updates */
|
236 |
if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
|
237 |
+
|
238 |
+
/* check if their using APC object cache, if yes, do nothing with the welcome page as it causes issues when caching the DB options */
|
239 |
+
if (class_exists("WP_Object_Cache")) {
|
240 |
+
/* do nothing here as this caches the "first time" option and the welcome page just loads over and over again. quite annoying really... */
|
241 |
+
} else {
|
242 |
+
if (isset($_GET['override']) && $_GET['override'] == "1") {
|
243 |
+
$wpgmza_first_time = $wpgmza_version;
|
244 |
+
update_option("WPGMZA_FIRST_TIME",$wpgmza_first_time);
|
245 |
+
} else {
|
246 |
+
|
247 |
+
$wpgmza_first_time = get_option("WPGMZA_FIRST_TIME");
|
248 |
+
if (!isset($wpgmza_first_time) || $wpgmza_first_time != $wpgmza_version) {
|
249 |
+
/* show welcome screen */
|
250 |
+
|
251 |
+
$wpgmza_first_time = $wpgmza_version;
|
252 |
+
update_option("WPGMZA_FIRST_TIME",$wpgmza_first_time);
|
253 |
+
|
254 |
+
wp_redirect(get_option('siteurl')."/wp-admin/admin.php?page=wp-google-maps-menu&action=welcome_page");
|
255 |
+
exit();
|
256 |
+
//echo "<script>window.location = \"".get_option('siteurl')."/wp-admin/admin.php?page=wp-google-maps-menu&action=welcome_page\"</script>";
|
257 |
+
}
|
258 |
+
}
|
259 |
}
|
260 |
}
|
261 |
|
488 |
else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
|
489 |
|
490 |
if (!$_GET['map_id']) { return; }
|
491 |
+
$wpgmza_check = wpgmaps_update_xml_file($_GET['map_id']);
|
492 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
493 |
+
|
494 |
+
|
495 |
//$wpgmza_data = get_option('WPGMZA');
|
496 |
|
497 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
498 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
499 |
|
500 |
+
$map_other_settings = maybe_unserialize($res->other_settings);
|
501 |
+
$weather_layer = $map_other_settings['weather_layer'];
|
502 |
+
$cloud_layer = $map_other_settings['cloud_layer'];
|
503 |
+
$transport_layer = $map_other_settings['transport_layer'];
|
504 |
+
|
505 |
+
|
506 |
|
507 |
$wpgmza_lat = $res->map_start_lat;
|
508 |
$wpgmza_lng = $res->map_start_lng;
|
514 |
$wpgmza_traffic = $res->traffic;
|
515 |
$wpgmza_bicycle = $res->bicycle;
|
516 |
|
517 |
+
|
518 |
$wpgmza_open_infowindow_by = $wpgmza_settings['wpgmza_settings_map_open_marker_by'];
|
519 |
if ($wpgmza_open_infowindow_by == null || !isset($wpgmza_open_infowindow_by)) { $wpgmza_open_infowindow_by = '1'; }
|
520 |
|
534 |
|
535 |
|
536 |
?>
|
537 |
+
|
538 |
+
<?php
|
539 |
+
|
540 |
+
if ($cloud_layer == 1 || $weather_layer == 1) { ?>
|
541 |
+
|
542 |
+
<script type="text/javascript">
|
543 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
544 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false&libraries=weather' type='text/javascript'%3E%3C/script%3E"));
|
545 |
+
</script>
|
546 |
+
|
547 |
+
<?php } else { ?>
|
548 |
+
|
549 |
<script type="text/javascript">
|
550 |
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
551 |
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
552 |
</script>
|
553 |
+
|
554 |
+
<?php } ?>
|
555 |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
|
556 |
|
557 |
<link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
|
881 |
$linecolor = $polyoptions->linecolor;
|
882 |
$fillcolor = $polyoptions->fillcolor;
|
883 |
$fillopacity = $polyoptions->opacity;
|
884 |
+
$lineopacity = $polyoptions->lineopacity;
|
885 |
if (!$linecolor) { $linecolor = "000000"; }
|
886 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
887 |
+
if ($fillopacity == "") { $fillopacity = "0.5"; }
|
888 |
+
if ($lineopacity == "") { $lineopacity = "1.0"; }
|
889 |
$linecolor = "#".$linecolor;
|
890 |
$fillcolor = "#".$fillcolor;
|
891 |
|
915 |
path: WPGM_PathData_<?php echo $poly_id; ?>,
|
916 |
strokeColor: "<?php echo $linecolor; ?>",
|
917 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
918 |
+
strokeOpacity: "<?php echo $lineopacity; ?>",
|
919 |
fillColor: "<?php echo $fillcolor; ?>",
|
920 |
strokeWeight: 2
|
921 |
});
|
982 |
|
983 |
<?php if ($wpgmza_bicycle == "1") { ?>
|
984 |
var bikeLayer = new google.maps.BicyclingLayer();
|
985 |
+
bikeLayer.setMap(MYMAP.map);
|
986 |
<?php } ?>
|
987 |
<?php if ($wpgmza_traffic == "1") { ?>
|
988 |
var trafficLayer = new google.maps.TrafficLayer();
|
989 |
+
trafficLayer.setMap(MYMAP.map);
|
990 |
+
<?php } ?>
|
991 |
+
<?php if ($weather_layer == 1) { ?>
|
992 |
+
var weatherLayer = new google.maps.weather.WeatherLayer();
|
993 |
+
weatherLayer.setMap(MYMAP.map);
|
994 |
+
<?php } ?>
|
995 |
+
<?php if ($cloud_layer == 1) { ?>
|
996 |
+
var cloudLayer = new google.maps.weather.CloudLayer();
|
997 |
+
cloudLayer.setMap(MYMAP.map);
|
998 |
+
<?php } ?>
|
999 |
+
<?php if ($transport_layer == 1) { ?>
|
1000 |
+
var transitLayer = new google.maps.TransitLayer();
|
1001 |
+
transitLayer.setMap(MYMAP.map);
|
1002 |
<?php } ?>
|
1003 |
|
1004 |
|
1110 |
$res = wpgmza_get_map_data($wpgmza_current_map_id);
|
1111 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
1112 |
|
1113 |
+
|
1114 |
+
$map_other_settings = maybe_unserialize($res->other_settings);
|
1115 |
+
$weather_layer = $map_other_settings['weather_layer'];
|
1116 |
+
$cloud_layer = $map_other_settings['cloud_layer'];
|
1117 |
+
$transport_layer = $map_other_settings['transport_layer'];
|
1118 |
+
|
1119 |
$wpgmza_lat = $res->map_start_lat;
|
1120 |
$wpgmza_lng = $res->map_start_lng;
|
1121 |
$wpgmza_width = $res->map_width;
|
1138 |
if (!$wpgmza_lat || !$wpgmza_lng) { $wpgmza_lat = "51.5081290"; $wpgmza_lng = "-0.1280050"; }
|
1139 |
|
1140 |
?>
|
1141 |
+
|
1142 |
+
|
1143 |
+
<?php
|
1144 |
+
|
1145 |
+
if ($cloud_layer == 1 || $weather_layer == 1) { ?>
|
1146 |
+
|
1147 |
<script type="text/javascript">
|
1148 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
1149 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false&libraries=weather' type='text/javascript'%3E%3C/script%3E"));
|
1150 |
+
</script>
|
1151 |
+
|
1152 |
+
<?php } else { ?>
|
1153 |
+
|
1154 |
+
<script type="text/javascript">
|
1155 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
1156 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
1157 |
</script>
|
1158 |
+
|
1159 |
+
<?php } ?>
|
1160 |
+
|
1161 |
+
|
1162 |
<script type="text/javascript" >
|
1163 |
|
1164 |
if ('undefined' == typeof window.jQuery) {
|
1184 |
UniqueCode=Math.round(Math.random()*10000);
|
1185 |
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
|
1186 |
|
1187 |
+
jQuery('body').on('tabsactivate', function(event, ui) {
|
1188 |
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
1189 |
UniqueCode=Math.round(Math.random()*10000);
|
1190 |
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
|
1227 |
foreach ($total_poly_array as $poly_id) {
|
1228 |
$polyoptions = wpgmza_b_return_poly_options($poly_id);
|
1229 |
$linecolor = $polyoptions->linecolor;
|
1230 |
+
$lineopacity = $polyoptions->lineopacity;
|
1231 |
$fillcolor = $polyoptions->fillcolor;
|
1232 |
$fillopacity = $polyoptions->opacity;
|
1233 |
if (!$linecolor) { $linecolor = "000000"; }
|
1234 |
if (!$fillcolor) { $fillcolor = "66FF00"; }
|
1235 |
+
if ($lineopacity == "") { $lineopacity = "1.0"; }
|
1236 |
+
if ($fillopacity == "") { $fillopacity = "0.5"; }
|
1237 |
$linecolor = "#".$linecolor;
|
1238 |
$fillcolor = "#".$fillcolor;
|
1239 |
|
1262 |
var WPGM_Path_<?php echo $poly_id; ?> = new google.maps.Polygon({
|
1263 |
path: WPGM_PathData_<?php echo $poly_id; ?>,
|
1264 |
strokeColor: "<?php echo $linecolor; ?>",
|
1265 |
+
strokeOpacity: "<?php echo $lineopacity; ?>",
|
1266 |
fillOpacity: "<?php echo $fillopacity; ?>",
|
1267 |
fillColor: "<?php echo $fillcolor; ?>",
|
1268 |
strokeWeight: 2
|
1328 |
var trafficLayer = new google.maps.TrafficLayer();
|
1329 |
trafficLayer.setMap(this.map);
|
1330 |
<?php } ?>
|
1331 |
+
<?php if ($weather_layer == 1) { ?>
|
1332 |
+
var weatherLayer = new google.maps.weather.WeatherLayer();
|
1333 |
+
weatherLayer.setMap(MYMAP.map);
|
1334 |
+
<?php } ?>
|
1335 |
+
<?php if ($cloud_layer == 1) { ?>
|
1336 |
+
var cloudLayer = new google.maps.weather.CloudLayer();
|
1337 |
+
cloudLayer.setMap(MYMAP.map);
|
1338 |
+
<?php } ?>
|
1339 |
+
<?php if ($transport_layer == 1) { ?>
|
1340 |
+
var transitLayer = new google.maps.TransitLayer();
|
1341 |
+
transitLayer.setMap(MYMAP.map);
|
1342 |
+
<?php } ?>
|
1343 |
|
1344 |
google.maps.event.addListener(MYMAP.map, 'click', function() {
|
1345 |
infoWindow.close();
|
1666 |
|
1667 |
if (is_multisite()) {
|
1668 |
global $blog_id;
|
1669 |
+
if ($dom->save($upload_dir['basedir'].'/wp-google-maps/'.$blog_id.'-'.$mapid.'markers.xml') == FALSE) {
|
1670 |
+
return new WP_Error( 'db_query_error', __( 'Could not save XML file' ), "Could not save marker XML file (".$upload_dir['basedir']."/wp-google-maps/".$blog_id."-".$mapid."markers.xml) for Map ID $mapid" );
|
1671 |
+
}
|
1672 |
} else {
|
1673 |
|
1674 |
|
1676 |
if (function_exists('wpgmza_register_pro_version')) {
|
1677 |
$prov = get_option("WPGMZA_PRO");
|
1678 |
$wpgmza_pro_version = $prov['version'];
|
1679 |
+
if ($dom->save($upload_dir['basedir'].'/wp-google-maps/'.$mapid.'markers.xml') == FALSE) {
|
1680 |
+
return new WP_Error( 'db_query_error', __( 'Could not save XML file' ), "Could not save marker XML file (".$upload_dir['basedir']."/wp-google-maps/".$mapid."markers.xml) for Map ID $mapid" );
|
1681 |
+
}
|
1682 |
}
|
1683 |
else {
|
1684 |
+
if ($dom->save($upload_dir['basedir'].'/wp-google-maps/'.$mapid.'markers.xml') == FALSE) {
|
1685 |
+
return new WP_Error( 'db_query_error', __( 'Could not save XML file' ), "Could not save marker XML file (".$upload_dir['basedir']."/wp-google-maps/".$mapid."markers.xml) for Map ID $mapid" );
|
1686 |
+
}
|
1687 |
}
|
|
|
1688 |
}
|
1689 |
+
return true;
|
1690 |
+
|
1691 |
}
|
1692 |
|
1693 |
|
|
|
1694 |
function wpgmaps_update_all_xml_file() {
|
1695 |
global $wpdb;
|
1696 |
$table_name = $wpdb->prefix . "wpgmza_maps";
|
1698 |
|
1699 |
foreach ( $results as $result ) {
|
1700 |
$map_id = $result->id;
|
1701 |
+
$wpgmza_check = wpgmaps_update_xml_file($map_id);
|
1702 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1703 |
}
|
1704 |
}
|
1705 |
|
1718 |
|
1719 |
if ($_POST['action'] == "add_marker") {
|
1720 |
$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'] ) );
|
1721 |
+
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
1722 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1723 |
+
|
1724 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1725 |
}
|
1726 |
if ($_POST['action'] == "edit_marker") {
|
1727 |
$cur_id = $_POST['edit_id'];
|
1728 |
$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) );
|
1729 |
+
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
1730 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1731 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1732 |
}
|
1733 |
if ($_POST['action'] == "delete_marker") {
|
1739 |
LIMIT 1
|
1740 |
"
|
1741 |
);
|
1742 |
+
$wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
|
1743 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1744 |
echo wpgmza_return_marker_list($_POST['map_id']);
|
1745 |
|
1746 |
}
|
1800 |
|
1801 |
|
1802 |
wpgmza_check_if_marker_file_exists($wpgmza_current_map_id);
|
1803 |
+
|
1804 |
|
1805 |
$map_width_type = stripslashes($res->map_width_type);
|
1806 |
$map_height_type = stripslashes($res->map_height_type);
|
1845 |
if (file_exists($upload_dir['path'].'/wp-google-maps/'.$blog_id.'-'.$mapid.'markers.xml')) {
|
1846 |
/* all OK */
|
1847 |
} else {
|
1848 |
+
|
1849 |
+
$wpgmza_check = wpgmaps_update_xml_file($mapid);
|
1850 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1851 |
+
|
1852 |
|
1853 |
}
|
1854 |
}
|
1856 |
if (file_exists($upload_dir['path'].'/wp-google-maps/'.$mapid.'markers.xml')) {
|
1857 |
|
1858 |
} else {
|
1859 |
+
$wpgmza_check = wpgmaps_update_xml_file($mapid);
|
1860 |
+
if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
|
1861 |
+
|
1862 |
}
|
1863 |
}
|
1864 |
}
|
1882 |
$ret_msg .= " <div style=\"display:block; width:".$map_width.$map_width_type."; height:30px; margin-top:10px; clear:both;\">";
|
1883 |
$ret_msg .= " <div style=\"display:block; float:left; width:150px;\">".__("Radius","wp-google-maps").":</div>";
|
1884 |
$ret_msg .= " <div style=\"display:block; float:left; width:250px;\">";
|
1885 |
+
$ret_msg .= " <select id=\"radiusSelect\">";
|
1886 |
+
$ret_msg .= " ";
|
1887 |
|
1888 |
if ($map_other_settings['store_locator_distance'] == 1) {
|
1889 |
$ret_msg .= " <option value=\"1\">".__("1mi","wp-google-maps")."</option>";
|
1909 |
$ret_msg .= " <option value=\"300\">".__("300km","wp-google-maps")."</option>";
|
1910 |
}
|
1911 |
|
1912 |
+
$ret_msg .= " </select><input type='hidden' value='".$map_other_settings['store_locator_distance']."' name='wpgmza_distance_type' id='wpgmza_distance_type' style='display:none;' />";
|
1913 |
$ret_msg .= " </div>";
|
1914 |
$ret_msg .= " </div>";
|
1915 |
|
1916 |
+
if (function_exists("wpgmza_register_pro_version") && $map_other_settings['store_locator_category'] == "1") {
|
1917 |
$ret_msg .= " <div style=\"display:block; width:".$map_width.$map_width_type."; clear:both; height:auto; overflow:auto; margin-top:10px; margin-bottom:10px; clear:both;\">";
|
1918 |
$ret_msg .= " <div style=\"display:block; float:left; width:150px;\">".__("Category","wp-google-maps").":</div>";
|
1919 |
$ret_msg .= " <div style=\"display:block; float:left; \">";
|
1969 |
$other_settings['store_locator_enabled'] = intval($_POST['wpgmza_store_locator']);
|
1970 |
$other_settings['store_locator_distance'] = intval($_POST['wpgmza_store_locator_distance']);
|
1971 |
|
1972 |
+
$other_settings['weather_layer'] = intval($_POST['wpgmza_weather']);
|
1973 |
+
$other_settings['cloud_layer'] = intval($_POST['wpgmza_cloud']);
|
1974 |
+
$other_settings['transport_layer'] = intval($_POST['wpgmza_transport']);
|
1975 |
+
|
1976 |
$other_settings_data = maybe_serialize($other_settings);
|
1977 |
|
1978 |
$data['map_default_starting_lat'] = $map_start_lat;
|
2059 |
$linecolor = esc_attr($_POST['poly_line']);
|
2060 |
$fillcolor = esc_attr($_POST['poly_fill']);
|
2061 |
$opacity = esc_attr($_POST['poly_opacity']);
|
2062 |
+
$line_opacity = esc_attr($_POST['poly_line_opacity']);
|
2063 |
|
2064 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
2065 |
"INSERT INTO $wpgmza_tblname_poly SET
|
2066 |
map_id = %d,
|
2067 |
polydata = %s,
|
2068 |
linecolor = %s,
|
2069 |
+
lineopacity = %s,
|
2070 |
fillcolor = %s,
|
2071 |
opacity = %s
|
2072 |
",
|
2074 |
$mid,
|
2075 |
$wpgmaps_polydata,
|
2076 |
$linecolor,
|
2077 |
+
$line_opacity,
|
2078 |
$fillcolor,
|
2079 |
$opacity
|
2080 |
)
|
2094 |
$linecolor = esc_attr($_POST['poly_line']);
|
2095 |
$fillcolor = esc_attr($_POST['poly_fill']);
|
2096 |
$opacity = esc_attr($_POST['poly_opacity']);
|
2097 |
+
$line_opacity = esc_attr($_POST['poly_line_opacity']);
|
2098 |
|
2099 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
2100 |
"UPDATE $wpgmza_tblname_poly SET
|
2101 |
polydata = %s,
|
2102 |
linecolor = %s,
|
2103 |
+
lineopacity = %s,
|
2104 |
fillcolor = %s,
|
2105 |
opacity = %s
|
2106 |
WHERE `id` = %d"
|
2108 |
|
2109 |
$wpgmaps_polydata,
|
2110 |
$linecolor,
|
2111 |
+
$line_opacity,
|
2112 |
$fillcolor,
|
2113 |
$opacity,
|
2114 |
$pid
|
2800 |
|
2801 |
|
2802 |
</form>
|
2803 |
+
|
2804 |
+
|
2805 |
+
<h3>".__("WP Google Maps Error log","wp-google-maps")."</h3>
|
2806 |
+
<p>".__("Having issues? Perhaps something below can give you a clue as to what's wrong. Alternatively, email this through to nick@wpgmaps.com for help!","wp-google-maps")."</p>
|
2807 |
+
<textarea style='width:100%; height:600px;' readonly>
|
2808 |
+
".wpgmza_return_error_log()."
|
2809 |
+
</textarea>
|
2810 |
+
|
2811 |
+
|
2812 |
";
|
2813 |
|
2814 |
echo "</div>";
|
2831 |
}
|
2832 |
else {
|
2833 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("My Maps","wp-google-maps")."</h2>";
|
2834 |
+
echo"<p><i><a href='http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=mappage_1' title='".__("Pro Version","wp-google-maps")."'>".__("Create unlimited maps","wp-google-maps")."</a> ".__("with the","wp-google-maps")." <a href='http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=mappage_2' title='Pro Version'>".__("Pro Version","wp-google-maps")."</a> ".__("of WP Google Maps for only","wp-google-maps")." <strong>$19.99!</strong></i></p>";
|
2835 |
wpgmaps_list_maps();
|
2836 |
|
2837 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
+
$other_settings_data = maybe_unserialize($res->other_settings);
|
2977 |
+
$wpgmza_store_locator_enabled = $other_settings_data['store_locator_enabled'];
|
2978 |
+
$wpgmza_store_locator_distance = $other_settings_data['store_locator_distance'];
|
2979 |
+
|
2980 |
+
$wpgmza_weather_option = $other_settings_data['weather_layer'];
|
2981 |
+
$wpgmza_cloud_option = $other_settings_data['cloud_layer'];
|
2982 |
+
$wpgmza_transport_option = $other_settings_data['transport_layer'];
|
2983 |
+
|
2984 |
|
2985 |
|
2986 |
if ($res->map_start_zoom) { $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED"; } else { $wpgmza_zoom[8] = "SELECTED"; }
|
2989 |
if ($res->bicycle) { $wpgmza_bicycle[intval($res->bicycle)] = "SELECTED"; } else { $wpgmza_bicycle[2] = "SELECTED"; }
|
2990 |
if ($res->traffic) { $wpgmza_traffic[intval($res->traffic)] = "SELECTED"; } else { $wpgmza_traffic[2] = "SELECTED"; }
|
2991 |
|
|
|
2992 |
if (stripslashes($res->map_width_type) == "%") { $wpgmza_map_width_type_percentage = "SELECTED"; $wpgmza_map_width_type_px = ""; } else { $wpgmza_map_width_type_px = "SELECTED"; $wpgmza_map_width_type_percentage = ""; }
|
2993 |
if (stripslashes($res->map_height_type) == "%") { $wpgmza_map_height_type_percentage = "SELECTED"; $wpgmza_map_height_type_px = ""; } else { $wpgmza_map_height_type_px = "SELECTED"; $wpgmza_map_height_type_percentage = ""; }
|
2994 |
|
3008 |
if (!isset($wpgmza_traffic[$i])) { $wpgmza_traffic[$i] = ""; }
|
3009 |
}
|
3010 |
|
|
|
|
|
|
|
3011 |
|
3012 |
|
3013 |
$wpgmza_store_locator_enabled_checked[0] = '';
|
3014 |
$wpgmza_store_locator_enabled_checked[1] = '';
|
3015 |
$wpgmza_store_locator_distance_checked[0] = '';
|
3016 |
$wpgmza_store_locator_distance_checked[1] = '';
|
3017 |
+
|
3018 |
if ($wpgmza_store_locator_enabled == 1) {
|
3019 |
$wpgmza_store_locator_enabled_checked[0] = 'selected';
|
|
|
3020 |
} else {
|
3021 |
$wpgmza_store_locator_enabled_checked[1] = 'selected';
|
3022 |
}
|
3025 |
} else {
|
3026 |
$wpgmza_store_locator_distance_checked[1] = 'selected';
|
3027 |
}
|
3028 |
+
|
3029 |
|
3030 |
+
$wpgmza_weather_layer_checked[0] = '';
|
3031 |
+
$wpgmza_weather_layer_checked[1] = '';
|
3032 |
+
$wpgmza_cloud_layer_checked[0] = '';
|
3033 |
+
$wpgmza_cloud_layer_checked[1] = '';
|
3034 |
+
$wpgmza_transport_layer_checked[0] = '';
|
3035 |
+
$wpgmza_transport_layer_checked[1] = '';
|
3036 |
+
|
3037 |
+
|
3038 |
+
if ($wpgmza_weather_option == 1) {
|
3039 |
+
$wpgmza_weather_layer_checked[0] = 'selected';
|
3040 |
+
} else {
|
3041 |
+
$wpgmza_weather_layer_checked[1] = 'selected';
|
3042 |
+
}
|
3043 |
+
if ($wpgmza_cloud_option == 1) {
|
3044 |
+
$wpgmza_cloud_layer_checked[0] = 'selected';
|
3045 |
+
} else {
|
3046 |
+
$wpgmza_cloud_layer_checked[1] = 'selected';
|
3047 |
+
}
|
3048 |
+
if ($wpgmza_transport_option == 1) {
|
3049 |
+
$wpgmza_transport_layer_checked[0] = 'selected';
|
3050 |
+
} else {
|
3051 |
+
$wpgmza_transport_layer_checked[1] = 'selected';
|
3052 |
+
}
|
3053 |
|
3054 |
$wpgmza_act = "disabled readonly";
|
3055 |
+
$wpgmza_act_msg = "<div class=\"update-nag\" style=\"padding:5px; \">".__("Add custom icons, titles, descriptions, pictures and links to your markers with the","wp-google-maps")." \"<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=below_marker\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a>\" ".__("of this plugin for just","wp-google-maps")." <strong>$19.99</strong></div>";
|
3056 |
$wpgmza_csv = "<p><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=csv_link\" title=\"".__("Pro Edition","wp-google-maps")."\">".__("Purchase the Pro Edition","wp-google-maps")."</a> ".__("of WP Google Maps and save your markers to a CSV file!","wp-google-maps")."</p>";
|
3057 |
}
|
3058 |
|
3105 |
<input type='hidden' name='http_referer' value='".$_SERVER['PHP_SELF']."' />
|
3106 |
<input type='hidden' name='wpgmza_id' id='wpgmza_id' value='".$res->id."' />
|
3107 |
<input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='".$res->map_start_location."' />
|
3108 |
+
<select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style='display:none;' >
|
3109 |
+
<option value=\"1\" ".$wpgmza_zoom[1].">1</option>
|
3110 |
+
<option value=\"2\" ".$wpgmza_zoom[2].">2</option>
|
3111 |
+
<option value=\"3\" ".$wpgmza_zoom[3].">3</option>
|
3112 |
+
<option value=\"4\" ".$wpgmza_zoom[4].">4</option>
|
3113 |
+
<option value=\"5\" ".$wpgmza_zoom[5].">5</option>
|
3114 |
+
<option value=\"6\" ".$wpgmza_zoom[6].">6</option>
|
3115 |
+
<option value=\"7\" ".$wpgmza_zoom[7].">7</option>
|
3116 |
+
<option value=\"8\" ".$wpgmza_zoom[8].">8</option>
|
3117 |
+
<option value=\"9\" ".$wpgmza_zoom[9].">9</option>
|
3118 |
+
<option value=\"10\" ".$wpgmza_zoom[10].">10</option>
|
3119 |
+
<option value=\"11\" ".$wpgmza_zoom[11].">11</option>
|
3120 |
+
<option value=\"12\" ".$wpgmza_zoom[12].">12</option>
|
3121 |
+
<option value=\"13\" ".$wpgmza_zoom[13].">13</option>
|
3122 |
+
<option value=\"14\" ".$wpgmza_zoom[14].">14</option>
|
3123 |
+
<option value=\"15\" ".$wpgmza_zoom[15].">15</option>
|
3124 |
+
<option value=\"16\" ".$wpgmza_zoom[16].">16</option>
|
3125 |
+
<option value=\"17\" ".$wpgmza_zoom[17].">17</option>
|
3126 |
+
<option value=\"18\" ".$wpgmza_zoom[18].">18</option>
|
3127 |
+
<option value=\"19\" ".$wpgmza_zoom[19].">19</option>
|
3128 |
+
<option value=\"20\" ".$wpgmza_zoom[20].">20</option>
|
3129 |
+
<option value=\"21\" ".$wpgmza_zoom[21].">21</option>
|
3130 |
+
</select>
|
3131 |
<table>
|
3132 |
<tr>
|
3133 |
<td>".__("Short code","wp-google-maps").":</td>
|
3154 |
<select id='wpgmza_map_height_type' name='wpgmza_map_height_type'>
|
3155 |
<option value=\"px\" $wpgmza_map_height_type_px>px</option>
|
3156 |
<option value=\"%\" $wpgmza_map_height_type_percentage>%</option>
|
3157 |
+
</select><span style='display:none; width:200px; font-size:10px;' id='wpgmza_height_warning'>".__("We recommend that you leave your height in PX. Depending on your theme, using % for the height may break your map.","wp-google-maps")."</span>
|
3158 |
|
3159 |
</td>
|
3160 |
</tr>
|
3161 |
+
<tr>
|
3162 |
+
<td>".__("Zoom Level","wp-google-maps").":</td>
|
3163 |
+
<td>
|
3164 |
+
<input type=\"text\" id=\"amount\" style=\"display:none;\" value=\"$res->map_start_zoom\"><div id=\"slider-range-max\"></div>
|
3165 |
+
</td>
|
3166 |
+
</tr>
|
3167 |
<tr>
|
3168 |
<td>".__("Map Alignment","wp-google-maps").":</td>
|
3169 |
<td><select id='wpgmza_map_align' name='wpgmza_map_align'>
|
3192 |
<div class=\"wpgm_notice_message\">
|
3193 |
<ul>
|
3194 |
<li>
|
3195 |
+
<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=directions\">Enable directions</a> with the Pro version for only $19.99 once off. Support and updates included forever.
|
3196 |
</li>
|
3197 |
</ul>
|
3198 |
</div>
|
3278 |
<option value=\"2\" ".$wpgmza_traffic[2].">".__("No","wp-google-maps")."</option>
|
3279 |
</select></td>
|
3280 |
</tr>
|
3281 |
+
<tr>
|
3282 |
+
<td width='320'>".__("Enable Weather Layer?","wp-google-maps").":</td>
|
3283 |
+
<td><select id='wpgmza_weather' name='wpgmza_weather' class='postform'>
|
3284 |
+
<option value=\"1\" ".$wpgmza_weather_layer_checked[0].">".__("Yes","wp-google-maps")."</option>
|
3285 |
+
<option value=\"2\" ".$wpgmza_weather_layer_checked[1].">".__("No","wp-google-maps")."</option>
|
3286 |
+
</select>
|
3287 |
+
</td>
|
3288 |
+
</tr>
|
3289 |
+
<tr>
|
3290 |
+
<td width='320'>".__("Enable Cloud Layer?","wp-google-maps").":</td>
|
3291 |
+
<td><select id='wpgmza_cloud' name='wpgmza_cloud' class='postform'>
|
3292 |
+
<option value=\"1\" ".$wpgmza_cloud_layer_checked[0].">".__("Yes","wp-google-maps")."</option>
|
3293 |
+
<option value=\"2\" ".$wpgmza_cloud_layer_checked[1].">".__("No","wp-google-maps")."</option>
|
3294 |
+
</select>
|
3295 |
+
</td>
|
3296 |
+
</tr>
|
3297 |
+
<tr>
|
3298 |
+
<td width='320'>".__("Enable Public Transport Layer?","wp-google-maps").":</td>
|
3299 |
+
<td><select id='wpgmza_transport' name='wpgmza_transport' class='postform'>
|
3300 |
+
<option value=\"1\" ".$wpgmza_transport_layer_checked[0].">".__("Yes","wp-google-maps")."</option>
|
3301 |
+
<option value=\"2\" ".$wpgmza_transport_layer_checked[1].">".__("No","wp-google-maps")."</option>
|
3302 |
+
</select>
|
3303 |
+
</td>
|
3304 |
+
</tr>
|
3305 |
</table>
|
3306 |
|
3307 |
<div class=\"wpgm_notice_message\">
|
3308 |
<ul>
|
3309 |
<li>
|
3310 |
+
".__("Get the rest of these advanced features with the Pro version for only <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$19.99 once off</a>. Support and updates included forever.","wp-google-maps")."
|
3311 |
</li>
|
3312 |
</ul>
|
3313 |
</div>
|
3467 |
</div>
|
3468 |
</div>
|
3469 |
|
3470 |
+
<br /><p>Get all of this and more for only $19.99 once off</p>
|
3471 |
+
<br /><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=upgradenow\" title=\"Upgrade now for only $19.99 once off\" class=\"button-primary\" style=\"font-size:20px; display:block; width:150px; text-align:center; height:30px; line-height:26px;\">Upgrade Now</a>
|
3472 |
<br /><br />
|
3473 |
<a href=\"http://www.wpgmaps.com/demo/\" target=\"_BLANK\">View the demos</a>.<br /><br />
|
3474 |
Have a sales question? Contact either Nick or Mark on <a href=\"mailto:nick@wpgmaps.com\">nick@wpgmaps.com</a> or use our <a href=\"http://www.wpgmaps.com/contact-us/\" target=\"_BLANK\">contact form</a>. <br /><br />
|
3652 |
<table style='clear:both;'>
|
3653 |
<tr>
|
3654 |
<td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_markers.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
|
3655 |
+
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add detailed information to your markers for only","wp-google-maps")." <strong>$19.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=image1\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
|
3656 |
</tr>
|
3657 |
<tr>
|
3658 |
<td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_marker_icons.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add custom markers to your map!","wp-google-maps")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
|
3749 |
function wpgmaps_admin_scripts() {
|
3750 |
wp_enqueue_script( 'jquery' );
|
3751 |
wp_enqueue_script('jquery-ui-core');
|
3752 |
+
wp_enqueue_script('jquery-ui-slider');
|
3753 |
|
3754 |
if (function_exists('wp_enqueue_media')) {
|
3755 |
wp_enqueue_media();
|
3771 |
wp_enqueue_script( 'jquery-ui-tabs');
|
3772 |
wp_register_script('my-wpgmaps-tabs', plugins_url('js/wpgmaps_tabs.js',__FILE__), array('jquery-ui-core'), '1.0.1', true);
|
3773 |
wp_enqueue_script('my-wpgmaps-tabs');
|
3774 |
+
wp_register_script('my-wpgmaps-color', plugins_url('js/jscolor.js',__FILE__), false, '1.4.1', false);
|
3775 |
+
wp_enqueue_script('my-wpgmaps-color');
|
3776 |
}
|
3777 |
}
|
3778 |
}
|
4156 |
map_id int(11) NOT NULL,
|
4157 |
polydata LONGTEXT NOT NULL,
|
4158 |
linecolor VARCHAR(7) NOT NULL,
|
4159 |
+
lineopacity VARCHAR(7) NOT NULL,
|
4160 |
fillcolor VARCHAR(7) NOT NULL,
|
4161 |
opacity VARCHAR(3) NOT NULL,
|
4162 |
PRIMARY KEY (id)
|
4369 |
return $result;
|
4370 |
}
|
4371 |
|
4372 |
+
function wpgmza_return_error($data) {
|
4373 |
+
echo "<div id=\"message\" class=\"error\"><p><strong>".$data->get_error_message()."</strong><blockquote>".$data->get_error_data()."</blockquote></p></div>";
|
4374 |
+
wpgmza_write_to_error_log($data);
|
4375 |
+
}
|
4376 |
+
function wpgmza_write_to_error_log($data) {
|
4377 |
+
if (wpgmza_error_directory()) {
|
4378 |
+
if (is_multisite()) {
|
4379 |
+
$upload_dir = wp_upload_dir();
|
4380 |
+
$content = "\r\n".date("Y-m-d H:i:s").": ".$data->get_error_message() . " -> ". $data->get_error_data();
|
4381 |
+
$fp = fopen($upload_dir['basedir'].'/wp-google-maps'."/error_log.txt","a+");
|
4382 |
+
fwrite($fp,$content);
|
4383 |
+
} else {
|
4384 |
+
$content = "\r\n".date("Y-m-d H:i:s").": ".$data->get_error_message() . " -> ". $data->get_error_data();
|
4385 |
+
$fp = fopen(ABSPATH.'wp-content/uploads/wp-google-maps'."/error_log.txt","a+");
|
4386 |
+
fwrite($fp,$content);
|
4387 |
+
}
|
4388 |
+
}
|
4389 |
+
|
4390 |
+
error_log(date("Y-m-d H:i:s"). ": WP Google Maps : " . $data->get_error_message() . "->" . $data->get_error_data());
|
4391 |
+
|
4392 |
+
}
|
4393 |
+
function wpgmza_error_directory() {
|
4394 |
+
$upload_dir = wp_upload_dir();
|
4395 |
+
|
4396 |
+
if (is_multisite()) {
|
4397 |
+
if (!file_exists($upload_dir['basedir'].'/wp-google-maps')) {
|
4398 |
+
wp_mkdir_p($upload_dir['basedir'].'/wp-google-maps');
|
4399 |
+
$content = "Error log created";
|
4400 |
+
$fp = fopen($upload_dir['basedir'].'/wp-google-maps'."/error_log.txt","w+");
|
4401 |
+
fwrite($fp,$content);
|
4402 |
+
}
|
4403 |
+
} else {
|
4404 |
+
if (!file_exists(ABSPATH.'wp-content/uploads/wp-google-maps')) {
|
4405 |
+
wp_mkdir_p(ABSPATH.'wp-content/uploads/wp-google-maps');
|
4406 |
+
$content = "Error log created";
|
4407 |
+
$fp = fopen(ABSPATH.'wp-content/uploads/wp-google-maps'."/error_log.txt","w+");
|
4408 |
+
fwrite($fp,$content);
|
4409 |
+
}
|
4410 |
+
|
4411 |
+
}
|
4412 |
+
return true;
|
4413 |
+
|
4414 |
+
}
|
4415 |
|
4416 |
+
function wpgmza_return_error_log() {
|
4417 |
+
$fh = fopen(ABSPATH.'wp-content/uploads/wp-google-maps'."/error_log.txt","r");
|
4418 |
+
$ret = "";
|
4419 |
+
if ($fh) {
|
4420 |
+
for ($i=0;$i<10;$i++) {
|
4421 |
+
$visits = fread($fh,4096);
|
4422 |
+
$ret .= $visits;
|
4423 |
+
}
|
4424 |
+
} else {
|
4425 |
+
$ret .= "There was an error opening the log file. Please make sure it exists";
|
4426 |
+
}
|
4427 |
+
return $ret;
|
4428 |
+
|
4429 |
+
}
|