Google Map Shortcode - Version 2.2.1

Version Description

  • allow_url_fopen exception added.
    • get excerpt bug fixed.
Download this release

Release Info

Developer alaingg
Plugin Icon wp plugin Google Map Shortcode
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.2 to 2.2.1

google-map-shortcode.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Google Map Shortcode
4
  Plugin URI: http://web-argument.com/google-map-shortcode-2-0-total-solution/
5
  Description: Include Google Map in your blogs with just one click.
6
- Version: 2.2
7
  Author: Alain Gonzalez
8
  Author URI: http://web-argument.com/
9
  */
@@ -390,7 +390,7 @@ function gmshc_tab_process(){
390
  <strong><?php _e("Thumbnail: "); ?></strong><?php _e("If you want to attach an image to the point you need to upload it first to the post gallery"); ?>
391
  </div>
392
  <?php } ?>
393
- <p align="left"><a class="button" href = "?post_id=<?php echo $post_id ?>&type=image" title="Upload Images"><?php _e("Upload Images") ?></a></p>
394
  </td>
395
  </tr>
396
  <?php if ($post_points->points_number > 0) { ?>
@@ -467,8 +467,8 @@ function gmshc_tab_process(){
467
  </table>
468
 
469
  <p>
470
- <input class="button-primary" value="<?php _e("Add Point") ?>" name="add_point" type="submit">
471
- <?php if ($post_points->points_number > 0) { ?>
472
  <input class="button-primary insert_map" value="<?php _e('Insert Map'); ?>" type="button" \>
473
  <?php echo $post_points->points_number.__(" Points Added") ?>
474
  <?php } ?>
@@ -485,7 +485,7 @@ function gmshc_tab_process(){
485
  <th><?php _e("Marker"); ?></th>
486
  <th><?php _e("Thumbnail"); ?></th>
487
  <th><?php _e("Title/Description"); ?></th>
488
- <th><?php _e("Address/LtLg"); ?></th>
489
  </tr>
490
  </thead>
491
  <tbody class="media-item-info">
3
  Plugin Name: Google Map Shortcode
4
  Plugin URI: http://web-argument.com/google-map-shortcode-2-0-total-solution/
5
  Description: Include Google Map in your blogs with just one click.
6
+ Version: 2.2.1
7
  Author: Alain Gonzalez
8
  Author URI: http://web-argument.com/
9
  */
390
  <strong><?php _e("Thumbnail: "); ?></strong><?php _e("If you want to attach an image to the point you need to upload it first to the post gallery"); ?>
391
  </div>
392
  <?php } ?>
393
+ <p align="left"><a class="button" href = "?post_id=<?php echo $post_id ?>&type=image" title="Upload Images"><?php _e("Upload Images") ?></a></p> <p align="left"><input class="button-primary" value="<?php _e("Add Point") ?>" name="add_point" type="submit"></p>
394
  </td>
395
  </tr>
396
  <?php if ($post_points->points_number > 0) { ?>
467
  </table>
468
 
469
  <p>
470
+ <?php if ($post_points->points_number > 0) { ?>
471
+ <input class="button-primary" value="<?php _e("Add Point") ?>" name="add_point" type="submit">
472
  <input class="button-primary insert_map" value="<?php _e('Insert Map'); ?>" type="button" \>
473
  <?php echo $post_points->points_number.__(" Points Added") ?>
474
  <?php } ?>
485
  <th><?php _e("Marker"); ?></th>
486
  <th><?php _e("Thumbnail"); ?></th>
487
  <th><?php _e("Title/Description"); ?></th>
488
+ <th width="140"><?php _e("Address/LtLg"); ?></th>
489
  </tr>
490
  </thead>
491
  <tbody class="media-item-info">
include/functions.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Google Map Shortcode
4
- * Version: 2.2
5
  * Author: Alain Gonzalez
6
  * Author URI: http://web-argument.com/
7
  */
@@ -104,7 +104,7 @@ function gmshc_get_windowhtml(&$point) {
104
  if (($point->post_id) > 0) $point_link = get_permalink($point->post_id);
105
  else $point_link = "";
106
  $point_img_url = ($point->thumbnail != "")? $point->thumbnail : gmshc_post_img($point->post_id);
107
- $point_excerpt = gmshc_get_excerpt($post_id);
108
  $point_description = ($point->description != "") ? $point->description : $point_excerpt;
109
  $point_address = $point->address;
110
 
@@ -339,8 +339,22 @@ function gmshc_point ($address,$ltlg){
339
 
340
  $options = get_gmshc_options();
341
  $api_url = "http://maps.googleapis.com/maps/api/geocode/json?".$type."=".$query."&sensor=false&language=".$options['language'];
342
-
343
- $json_answ = file_get_contents($api_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  $answ_arr = json_decode($json_answ,true);
345
 
346
  if (isset($answ_arr["status"]) && $answ_arr["status"] == "OK"){
1
  <?php
2
  /**
3
  * Google Map Shortcode
4
+ * Version: 2.2.1
5
  * Author: Alain Gonzalez
6
  * Author URI: http://web-argument.com/
7
  */
104
  if (($point->post_id) > 0) $point_link = get_permalink($point->post_id);
105
  else $point_link = "";
106
  $point_img_url = ($point->thumbnail != "")? $point->thumbnail : gmshc_post_img($point->post_id);
107
+ $point_excerpt = gmshc_get_excerpt($point->post_id);
108
  $point_description = ($point->description != "") ? $point->description : $point_excerpt;
109
  $point_address = $point->address;
110
 
339
 
340
  $options = get_gmshc_options();
341
  $api_url = "http://maps.googleapis.com/maps/api/geocode/json?".$type."=".$query."&sensor=false&language=".$options['language'];
342
+
343
+ $json_answ = @file_get_contents($api_url);
344
+
345
+ if (empty($json_answ)) {
346
+ if(function_exists('curl_init')){
347
+ $ch = curl_init();
348
+ curl_setopt ($ch, CURLOPT_URL, $api_url);
349
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
350
+ $json_answ = curl_exec($ch);
351
+ curl_close($ch);
352
+ } else {
353
+ echo "<div class='error'><p>".__("The Point can't be added, <strong>php_curl.dll</strong> is not installed on your server and <strong>allow_url_fopen</strong> is disabled.")."</p></div>";
354
+ return false;
355
+ }
356
+ }
357
+
358
  $answ_arr = json_decode($json_answ,true);
359
 
360
  if (isset($answ_arr["status"]) && $answ_arr["status"] == "OK"){
js/gmshc-admin.js CHANGED
@@ -14,9 +14,9 @@
14
  $(".gmshc_icon,.gmshc_thumb").click(function(){
15
  gmshc_switchImg($(this));
16
  }).mouseover(function(){
17
- $(this).css({"border":"solid #cccccc 1px"})
18
  }).mouseout(function(){
19
- $(this).css({"border":"solid #ffffff 1px"})
20
  });
21
 
22
  $(".insert_map").click(function(){
14
  $(".gmshc_icon,.gmshc_thumb").click(function(){
15
  gmshc_switchImg($(this));
16
  }).mouseover(function(){
17
+ $(this).css({"border":"solid #BBBBBB 1px"})
18
  }).mouseout(function(){
19
+ $(this).css({"border":"solid #F9F9F9 1px"})
20
  });
21
 
22
  $(".insert_map").click(function(){
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=suppo
4
  Tags: google maps, shortcode, map, maps, categories, widget, post map, point, marker, list, location, address, images, geocoder, google maps, animation
5
  Requires at least: 2.5
6
  Tested up to: 3.2.1
7
- Stable tag: 2.2
8
 
9
  Real Friendly integration of Google Map instances into your blogs. The plugin allows to display multiple maps on your pages.
10
  == Description ==
@@ -44,6 +44,10 @@ Special Features:
44
 
45
  == Changelog ==
46
 
 
 
 
 
47
  = 2.2 =
48
  * Map type added.
49
  * Marker animation option added.
@@ -89,9 +93,8 @@ Special Features:
89
 
90
  == Upgrade Notice ==
91
 
92
- = 2.2 =
93
- This new version includes markers focus and animations and improves the performance.
94
- __Note:__ Before upgrade save the custom HTML info because the new version will overwrite it.
95
 
96
  == How to use ==
97
  Visit the [How To Use](http://web-argument.com/google-map-shortcode-how-to-use/) section.
4
  Tags: google maps, shortcode, map, maps, categories, widget, post map, point, marker, list, location, address, images, geocoder, google maps, animation
5
  Requires at least: 2.5
6
  Tested up to: 3.2.1
7
+ Stable tag: 2.2.1
8
 
9
  Real Friendly integration of Google Map instances into your blogs. The plugin allows to display multiple maps on your pages.
10
  == Description ==
44
 
45
  == Changelog ==
46
 
47
+ = 2.2.1 =
48
+ * allow_url_fopen exception added.
49
+ * get excerpt bug fixed.
50
+
51
  = 2.2 =
52
  * Map type added.
53
  * Marker animation option added.
93
 
94
  == Upgrade Notice ==
95
 
96
+ = 2.2.1 =
97
+ Upgrade is recommended to handled allow_url_fopen exception.
 
98
 
99
  == How to use ==
100
  Visit the [How To Use](http://web-argument.com/google-map-shortcode-how-to-use/) section.
styles/gmshc-admin-styles.css CHANGED
@@ -1,10 +1,14 @@
1
  /**
2
  * Google Map Shortcode
3
- * Version: 2.1
4
  * Author: Alain Gonzalez
5
  * Author URI: http://web-argument.com/
6
  */
7
 
 
 
 
 
8
  #gmshc_icon_cont {
9
  width:578px;
10
  height:126px;
@@ -26,7 +30,7 @@
26
  cursor:pointer;
27
  margin:1px;
28
  padding:1px;
29
- border:solid 1px #ffffff;
30
  cursor:pointer;
31
  text-align:center;
32
  }
@@ -44,7 +48,7 @@
44
 
45
  .gmshc_selected {
46
  border:solid #CCC 1px !important;
47
- background-color:#EEE;
48
  }
49
 
50
  .gmshc_label {
1
  /**
2
  * Google Map Shortcode
3
+ * Version: 2.2.1
4
  * Author: Alain Gonzalez
5
  * Author URI: http://web-argument.com/
6
  */
7
 
8
+ body {
9
+ background-color: #F9F9F9 !important;
10
+ }
11
+
12
  #gmshc_icon_cont {
13
  width:578px;
14
  height:126px;
30
  cursor:pointer;
31
  margin:1px;
32
  padding:1px;
33
+ border:solid 1px #F9F9F9;
34
  cursor:pointer;
35
  text-align:center;
36
  }
48
 
49
  .gmshc_selected {
50
  border:solid #CCC 1px !important;
51
+ background-color:#BBBBBB;
52
  }
53
 
54
  .gmshc_label {