WP Google Maps - Version 5.01

Version Description

  • Added the functionality to list your markers below the map
  • Added more advanced directions functionality
  • Fixed small bugs
  • Fixed a bug that caused a fatal error when trying to activate the plugin on some hosts.
Download this release

Release Info

Developer WPGMaps
Plugin Icon 128x128 WP Google Maps
Version 5.01
Comparing to
See all releases

Code changes from version 5.0 to 5.01

Files changed (3) hide show
  1. css/wpgmza_style.css +37 -0
  2. readme.txt +2 -1
  3. wpGoogleMaps.php +54 -27
css/wpgmza_style.css CHANGED
@@ -1,3 +1,7 @@
1
#wpgmza_map img {
2
border: none !important;
3
background-color:transparent !important;
@@ -10,4 +14,37 @@
10
}
11
#wpgmaps_directions_edit {
12
padding-top:20px;
13
}
1
+ .wpgmza_map {
2
+ border:0;
3
+ margin:5px !important;
4
+ }
5
#wpgmza_map img {
6
border: none !important;
7
background-color:transparent !important;
14
}
15
#wpgmaps_directions_edit {
16
padding-top:20px;
17
+ }
18
+ .wpgmza_markerbox {
19
+ color:#000 !important;
20
+ }
21
+ .wpgmza_markerbox a {
22
+ color:#1982D1 !important;
23
+ }
24
+ .wpgmaps_mlist_table {
25
+ width:42px;
26
+ }
27
+
28
+ .wpgmaps_mlist_marker {
29
+ width:32px;
30
+ height:32px;
31
+ vertical-align:top;
32
+ padding:0 !important;
33
+ }
34
+
35
+ .wpgmaps_mlist_info {
36
+ text-align:left;
37
+ padding:0 !important;
38
+
39
+ }
40
+ .wpgmaps_mlist_row:hover {
41
+ background-color: #EEEEEE;
42
+ }
43
+ .wpgmaps_directions_outer_div {
44
+ padding-top:30px;
45
+ padding-bottom:5px;
46
+ }
47
+
48
+ .wpgmaps_directions_outer_div table, wpgmza_marker_list_class {
49
+ margin-bottom:0px !important;
50
}
readme.txt CHANGED
@@ -78,7 +78,8 @@ Previous versions may cause your blog to slow down. Upgrading to 4.5 will get ri
78
79
== Changelog ==
80
81
- = 5.1 =
82
* Added the functionality to list your markers below the map
83
* Added more advanced directions functionality
84
* Fixed small bugs
78
79
== Changelog ==
80
81
+
82
+ = 5.01 =
83
* Added the functionality to list your markers below the map
84
* Added more advanced directions functionality
85
* Fixed small bugs
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
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: 5.0
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
*/
@@ -28,8 +28,8 @@ $wpgmza_p = false;
28
$wpgmza_g = false;
29
$wpgmza_tblname = $wpdb->prefix . "wpgmza";
30
$wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
31
- $wpgmza_version = "5.0";
32
- $wpgmza_p_version = "5.0";
33
$wpgmza_t = "basic";
34
35
add_action('admin_head', 'wpgmaps_head');
@@ -76,8 +76,11 @@ function wpgmaps_activate() {
76
"styling_json" => "",
77
"active" => "0",
78
"type" => "1",
79
- "bicycle" => "1",
80
- "traffic" => "1")
81
); }
82
} else {
83
$rows_affected = $wpdb->insert( $table_name_maps, array( "map_start_lat" => "".$wpgmza_data['map_start_lat']."",
@@ -95,7 +98,11 @@ function wpgmaps_activate() {
95
"active" => "0",
96
"directions_enabled" => "".$wpgmza_data['directions_enabled']."",
97
"bicycle" => "".$wpgmza_data['bicycle']."",
98
- "traffic" => "".$wpgmza_data['traffic'].""
99
) );
100
delete_option("WPGMZA");
101
@@ -122,7 +129,7 @@ function wpgmaps_init() {
122
function wpgmaps_reload_map_on_post() {
123
wpgmaps_debugger("reload_map_start");
124
if (isset($_POST['wpgmza_savemap'])){
125
-
126
$res = wpgmza_get_map_data($_GET['map_id']);
127
$wpgmza_lat = $res->map_start_lat;
128
$wpgmza_lng = $res->map_start_lng;
@@ -606,7 +613,6 @@ function wpgmaps_user_javascript_basic() {
606
607
?>
608
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
609
- <link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
610
<script type="text/javascript" >
611
612
@@ -752,6 +758,7 @@ function wpgmaps_update_xml_file($mapid = false) {
752
753
foreach ( $results as $result )
754
{
755
$address = $result->address;
756
$description = $result->desc;
757
$pic = $result->pic;
@@ -768,6 +775,8 @@ function wpgmaps_update_xml_file($mapid = false) {
768
$map_id = $result->map_id;
769
770
$channel = $channel_main->appendChild($dom->createElement('marker'));
771
$title = $channel->appendChild($dom->createElement('map_id'));
772
$title->appendChild($dom->CreateTextNode($map_id));
773
$title = $channel->appendChild($dom->createElement('title'));
@@ -925,7 +934,7 @@ function wpgmaps_head() {
925
if (isset($_POST['wpgmza_savemap'])){
926
global $wpdb;
927
928
-
929
930
$map_id = attribute_escape($_POST['wpgmza_id']);
931
$map_title = attribute_escape($_POST['wpgmza_title']);
@@ -938,7 +947,12 @@ function wpgmaps_head() {
938
$directions_enabled = intval($_POST['wpgmza_directions']);
939
$bicycle_enabled = intval($_POST['wpgmza_bicycle']);
940
$traffic_enabled = intval($_POST['wpgmza_traffic']);
941
-
942
$gps = explode(",",$map_start_location);
943
$map_start_lat = $gps[0];
944
$map_start_lng = $gps[1];
@@ -955,6 +969,9 @@ function wpgmaps_head() {
955
$data['map_default_directions'] = $directions_enabled;
956
$data['map_default_bicycle'] = $bicycle_enabled;
957
$data['map_default_traffic'] = $traffic_enabled;
958
$data['map_default_marker'] = $map_default_marker;
959
960
@@ -974,7 +991,10 @@ function wpgmaps_head() {
974
directions_enabled = %d,
975
kml = %s,
976
bicycle = %d,
977
- traffic = %d
978
WHERE id = %d",
979
980
$map_title,
@@ -991,6 +1011,9 @@ function wpgmaps_head() {
991
$kml,
992
$bicycle_enabled,
993
$traffic_enabled,
994
$map_id)
995
);
996
@@ -1115,8 +1138,9 @@ function wpgmaps_menu_layout() {
1115
1116
$prov = get_option("WPGMZA_PRO");
1117
$wpgmza_pro_version = $prov['version'];
1118
- if (floatval($wpgmza_pro_version) < 3 || $wpgmza_pro_version == null) {
1119
wpgmaps_upgrade_notice();
1120
} else {
1121
wpgmza_pro_menu();
1122
}
@@ -1568,6 +1592,9 @@ function wpgmaps_admin_scripts() {
1568
wpgmaps_debugger("admin_scripts_end");
1569
1570
}
1571
1572
function wpgmaps_admin_styles() {
1573
wp_enqueue_style('thickbox');
@@ -1581,6 +1608,7 @@ if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
1581
wpgmaps_debugger("load_scripts_styles_end");
1582
}
1583
1584
1585
1586
@@ -1844,6 +1872,9 @@ function wpgmaps_handle_db() {
1844
`kml` VARCHAR(700) NOT NULL,
1845
`bicycle` INT(10) NOT NULL,
1846
`traffic` INT(10) NOT NULL,
1847
PRIMARY KEY (`id`)
1848
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1849
";
@@ -1887,30 +1918,26 @@ function wpgmza_get_marker_data($mid) {
1887
1888
}
1889
function wpgmaps_upgrade_notice() {
1890
echo "<div class='error below-h1'>
1891
<big><big>
1892
- <p>Dear Pro User. <br /></p>
1893
1894
- <p>We recently upgraded the WP Google Maps plugin to include functionality for <strong>multiple maps.</strong>
1895
- You need to upgrade your Pro version to the <strong>latest version</strong> in order for the plugin to continue
1896
- working. We apologise for the inconvenience but would urge you to consider that we are attempting to make this
1897
- the best map plugin available on the market. There was a big need for multiple maps and the only way we could
1898
- achieve this was to make major changes to the code, thus resulting in the need for the latest version!<br /></p>
1899
1900
<p>You should have already received an email with the download link for the latest version, if not please
1901
- <big><a href='http://www.wpgmaps.com/d/wp-google-maps-pro.zip' target='_blank'>download it here</a></big>! (This link will only be available
1902
- for 1 week, thereafter please <a href='http://www.wpgmaps.com/contact-us/'>contact us</a>)<br /><br /></p>
1903
-
1904
<p><strong>Installation Instructions:</strong><br />
1905
<ul>
1906
- <li>- Once downloaded, please <strong>deactivate</strong> and <strong>delete</strong> your old Pro plugin (your marker information wont be affected at all).</li>
1907
<li>- <a href=\"".get_option('siteurl')."/wp-admin/plugin-install.php?tab=upload\" target=\"_BLANK\">Upload the new</a> plugin ZIP file.</li>
1908
- <li>- You will notice the left hand navigation has now changed from \"WP Google Maps\" to just \"Maps\".</li>
1909
- <li>- Enjoy creating multiple maps!</li>
1910
-
1911
</p>
1912
-
1913
- <p>If you run into any bugs, please let me know so that I can get it sorted out ASAP</p>
1914
1915
<p>Kind regards,<br /><a href='http://www.wpgmaps.com/'>WP Google Maps</a></p>
1916
</big></big>
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: 5.01
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
*/
28
$wpgmza_g = false;
29
$wpgmza_tblname = $wpdb->prefix . "wpgmza";
30
$wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
31
+ $wpgmza_version = "5.01";
32
+ $wpgmza_p_version = "5.01";
33
$wpgmza_t = "basic";
34
35
add_action('admin_head', 'wpgmaps_head');
76
"styling_json" => "",
77
"active" => "0",
78
"type" => "1",
79
+ "bicycle" => "2",
80
+ "traffic" => "2",
81
+ "dbox" => "1",
82
+ "dbox_width" => "250",
83
+ "listmarkers" => "0")
84
); }
85
} else {
86
$rows_affected = $wpdb->insert( $table_name_maps, array( "map_start_lat" => "".$wpgmza_data['map_start_lat']."",
98
"active" => "0",
99
"directions_enabled" => "".$wpgmza_data['directions_enabled']."",
100
"bicycle" => "".$wpgmza_data['bicycle']."",
101
+ "traffic" => "".$wpgmza_data['traffic']."",
102
+ "dbox" => "".$wpgmza_data['dbox']."",
103
+ "dbox_width" => "".$wpgmza_data['dbox_width']."",
104
+ "listmarkers" => "".$wpgmza_data['listmarkers'].""
105
+
106
) );
107
delete_option("WPGMZA");
108
129
function wpgmaps_reload_map_on_post() {
130
wpgmaps_debugger("reload_map_start");
131
if (isset($_POST['wpgmza_savemap'])){
132
+
133
$res = wpgmza_get_map_data($_GET['map_id']);
134
$wpgmza_lat = $res->map_start_lat;
135
$wpgmza_lng = $res->map_start_lng;
613
614
?>
615
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
616
<script type="text/javascript" >
617
618
758
759
foreach ( $results as $result )
760
{
761
+ $id = $result->id;
762
$address = $result->address;
763
$description = $result->desc;
764
$pic = $result->pic;
775
$map_id = $result->map_id;
776
777
$channel = $channel_main->appendChild($dom->createElement('marker'));
778
+ $title = $channel->appendChild($dom->createElement('marker_id'));
779
+ $title->appendChild($dom->CreateTextNode($id));
780
$title = $channel->appendChild($dom->createElement('map_id'));
781
$title->appendChild($dom->CreateTextNode($map_id));
782
$title = $channel->appendChild($dom->createElement('title'));
934
if (isset($_POST['wpgmza_savemap'])){
935
global $wpdb;
936
937
+ //var_dump($_POST);
938
939
$map_id = attribute_escape($_POST['wpgmza_id']);
940
$map_title = attribute_escape($_POST['wpgmza_title']);
947
$directions_enabled = intval($_POST['wpgmza_directions']);
948
$bicycle_enabled = intval($_POST['wpgmza_bicycle']);
949
$traffic_enabled = intval($_POST['wpgmza_traffic']);
950
+ $dbox = intval($_POST['wpgmza_dbox']);
951
+ $dbox_width = attribute_escape($_POST['wpgmza_dbox_width']);
952
+ $listmarkers = intval($_POST['wpgmza_listmarkers']);
953
+ echo "LISTMARKERS: $listmarkers";
954
+
955
+
956
$gps = explode(",",$map_start_location);
957
$map_start_lat = $gps[0];
958
$map_start_lng = $gps[1];
969
$data['map_default_directions'] = $directions_enabled;
970
$data['map_default_bicycle'] = $bicycle_enabled;
971
$data['map_default_traffic'] = $traffic_enabled;
972
+ $data['map_default_dbox'] = $dbox;
973
+ $data['map_default_dbox_width'] = $dbox_width;
974
+ $data['map_default_listmarkers'] = $listmarkers;
975
$data['map_default_marker'] = $map_default_marker;
976
977
991
directions_enabled = %d,
992
kml = %s,
993
bicycle = %d,
994
+ traffic = %d,
995
+ dbox = %d,
996
+ dbox_width = %s,
997
+ listmarkers = %d
998
WHERE id = %d",
999
1000
$map_title,
1011
$kml,
1012
$bicycle_enabled,
1013
$traffic_enabled,
1014
+ $dbox,
1015
+ $dbox_width,
1016
+ $listmarkers,
1017
$map_id)
1018
);
1019
1138
1139
$prov = get_option("WPGMZA_PRO");
1140
$wpgmza_pro_version = $prov['version'];
1141
+ if (floatval($wpgmza_pro_version) < 4.01 || $wpgmza_pro_version == null) {
1142
wpgmaps_upgrade_notice();
1143
+ wpgmza_pro_menu();
1144
} else {
1145
wpgmza_pro_menu();
1146
}
1592
wpgmaps_debugger("admin_scripts_end");
1593
1594
}
1595
+ function wpgmaps_user_styles() {
1596
+ wp_register_style( 'wpgmaps-style', plugins_url('/css/wpgmza_style.css', __FILE__) );
1597
+ wp_enqueue_style( 'wpgmaps-style' );}
1598
1599
function wpgmaps_admin_styles() {
1600
wp_enqueue_style('thickbox');
1608
wpgmaps_debugger("load_scripts_styles_end");
1609
}
1610
1611
+ add_action('wp_print_styles', 'wpgmaps_user_styles');
1612
1613
1614
1872
`kml` VARCHAR(700) NOT NULL,
1873
`bicycle` INT(10) NOT NULL,
1874
`traffic` INT(10) NOT NULL,
1875
+ `dbox` INT(10) NOT NULL,
1876
+ `dbox_width` varchar(10) NOT NULL,
1877
+ `listmarkers` INT(10) NOT NULL,
1878
PRIMARY KEY (`id`)
1879
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1880
";
1918
1919
}
1920
function wpgmaps_upgrade_notice() {
1921
+ global $wpgmza_pro_version;
1922
echo "<div class='error below-h1'>
1923
<big><big>
1924
+ <p>Dear Pro User<br /></p>
1925
1926
+ <p>We have recently added new functionality to the Pro version of this plugin. You are currently using the latest
1927
+ Basic version which needs the latest Pro version for all functionality to work. Your current Pro version is
1928
+ $wpgmza_pro_version - The latest Pro version is 4.01<br /></p>
1929
1930
<p>You should have already received an email with the download link for the latest version, if not please
1931
+ <a href='http://www.wpgmaps.com/contact-us/'>contact us</a><br /><br /></p>
1932
+ <small>
1933
<p><strong>Installation Instructions:</strong><br />
1934
<ul>
1935
+ <li>- Once downloaded, please <strong>deactivate</strong> and <strong>delete</strong> your old Pro plugin (your marker and map information wont be affected at all).</li>
1936
<li>- <a href=\"".get_option('siteurl')."/wp-admin/plugin-install.php?tab=upload\" target=\"_BLANK\">Upload the new</a> plugin ZIP file.</li>
1937
+ </ul>
1938
</p>
1939
+ </small>
1940
+ <p>If you experience into any bugs, please let me know so that I can get it sorted out ASAP</p>
1941
1942
<p>Kind regards,<br /><a href='http://www.wpgmaps.com/'>WP Google Maps</a></p>
1943
</big></big>