Plugin Directory

Changeset 201975


Ignore:
Timestamp:
02/04/2010 09:59:40 PM (16 years ago)
Author:
cesperanc
Message:

tagging version 2.1

Location:
wp-gmaps2
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-gmaps2/tags/2.1/readme.txt

    r184177 r201975  
    11=== WP_GMaps2 ===
    22Contributors: cesperanc
    3 Tags: google maps, tinymce, post, page
     3Tags: google maps, tinymce, post, page, gmaps, maps, map
    44Requires at least: 2.8.4
    5 Tested up to: 2.9.0
    6 Stable tag: 2.0
     5Tested up to: 2.9.1
     6Stable tag: 2.1
    77
    88This plugin allows an easy integration of Google Maps on your pages or posts.
     
    1010== Description ==
    1111
    12 This plugin allows the inclusion of Google Maps on your pages or posts using just the WYSIWYG (TinyMCE) controls. You can now insert and use Maps with just your mouse. This plugins supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs and HTML support, etc.
     12This plugin allows the integration of Google Maps on your pages or posts using the Wordpress Editor (TinyMCE). It supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs with HTML support, etc. Give it a try.
    1313
    1414== Installation ==
     
    3737== Screenshots ==
    3838
    39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar e then press 2 (google maps) to open the Google Maps Window.
     391. To insert a map, press 1 (kitchen sink) to show the advanced bar and then press 2 (google maps) to open the Google Maps Window.
    40402. In the Google Maps window you can insert or update your map.
    41413. The final result.
    4242
    4343== Changelog ==
     44
     45= 2.1 =
     46* json_decode substitute for those that are using a PHP version bellow 5.2 (thanks to www at walidator dot info)
     47* Plugin URI updated to the new home
     48* Plugin validated for Wordpress 2.9.1
    4449
    4550= 2.0 =
  • wp-gmaps2/tags/2.1/wp_gmaps2.php

    r147909 r201975  
    22    /*
    33        Plugin Name: WP_GMaps2
    4         Plugin URI:  http://ued.ipleiria.pt
     4        Plugin URI:  http://sites.ipleiria.pt/labsUED/en/wordpress-en/plugins/wp-gmaps2/
    55        Description: WP_GMaps2 adds Maps to your pages and posts in Wordpress using the Google Maps API version 2.
    6         Version: 2.0
     6        Version: 2.1
    77        Author: Cláudio Esperança
    88        Author URI: http://ued.ipleiria.pt
    99    */
    10    
    11     /* 
     10
     11    /*
    1212        Copyright 2009  Cláudio Esperança ([email protected])
    13        
     13
    1414        This program is free software; you can redistribute it and/or modify
    1515        it under the terms of the GNU General Public License as published by
    1616        the Free Software Foundation; either version 3 of the License, or
    1717        (at your option) any later version.
    18    
     18
    1919        This program is distributed in the hope that it will be useful,
    2020        but WITHOUT ANY WARRANTY; without even the implied warranty of
    2121        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2222        GNU General Public License for more details.
    23    
     23
    2424        You should have received a copy of the GNU General Public License
    2525        along with this program; If not, see <http://www.gnu.org/licenses/>.
    26    
     26
    2727    */
    28    
     28
     29    /**
     30     * json_decode substitute for those that are using a PHP version bellow 5.2
     31     *
     32     * @author [email protected]
     33     * @see http://pt2.php.net/manual/en/function.json-decode.php#91216 for reference
     34     */
     35    if ( !function_exists('json_decode') ){
     36        function json_decode($json){
     37            $comment = false;
     38            $out = '$x=';
     39
     40            for ($i=0; $i<strlen($json); $i++){
     41                if (!$comment){
     42                    if ($json[$i] == '{')        $out .= ' array(';
     43                    else if ($json[$i] == '}')    $out .= ')';
     44                    else if ($json[$i] == ':')    $out .= '=>';
     45                    else                         $out .= $json[$i];
     46                }
     47                else $out .= $json[$i];
     48                if ($json[$i] == '"')    $comment = !$comment;
     49            }
     50            eval($out . ';');
     51            return $x;
     52        }
     53    }
     54
     55    /**
     56     * Some defines
     57     */
    2958    define('WP_GMaps', 'WP_GMaps2'); // should match the class name bellow
    3059    define('WP_GMaps_text_domain', 'wp_gmaps2');
    31    
     60
    3261    /**
    3362     * Class responsable for the Wordpress/TinyMCE/Google Maps integration
    34      * 
     63     *
    3564     * @author cesperanc
    36      * @version 2.0
     65     * @version 2.1
    3766     */
    3867    class WP_GMaps2 {
    3968        private $_content = "";
    40    
     69
    4170        function __construct($content=""){
    4271            $contents = array();
    4372            if(preg_match_all("(<!--(gmap|googlemap) ((\n|.)*?)-->)",$content,$contents)){
    4473                $js_addOnShowMaps='';
    45                
     74
    4675                foreach($contents[2] as $mapn=>$map){
    4776                    $result = '';
     
    5584                    $content = str_ireplace($contents[0][$mapn],$result,$content);
    5685                }
    57                
     86
    5887                $this->_content .= $content.'
    5988                        <script type="text/javascript">
     
    6493            }
    6594        }
    66        
     95
    6796        public function content(){
    6897            return $this->_content;
    6998        }
    70        
     99
    71100        public function filterContent($content){
    72101            if(!isset($this)){
     
    79108                $gmap = &$this;
    80109            }
    81            
     110
    82111            return $gmap->content();
    83112        }
    84        
     113
    85114        public function appendToHeader(){
    86115            ?>
    87116                <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?php echo(get_option('GOOGLE_MAPS_KEY','')); ?>"></script>
    88117                <script type="text/javascript" src="<?php echo(plugin_dir_url(__FILE__)); ?>js/client.js"></script>
    89             <?php 
    90         }
    91        
     118            <?php
     119        }
     120
    92121        /**
    93          * Adds a button to TinyMCE buttons list 
     122         * Adds a button to TinyMCE buttons list
    94123         */
    95124        public function tinymceRegisterButton($buttons) {
     
    97126           return $buttons;
    98127        }
    99          
     128
    100129        /**
    101130         * Set the URL to the plugin for TinyMCE
     
    105134           return $plugin_array;
    106135        }
    107        
     136
    108137        /**
    109138         * Set the URL to the plugin for TinyMCE
     
    113142            return $init;
    114143        }
    115        
     144
    116145        /**
    117146         * Add the necessary filters for the TinyMCE plugin
     
    143172            }
    144173        }
    145        
     174
    146175        /**
    147176         * Register the plugin options
     
    150179            register_setting('WP_GMaps2_options', 'GOOGLE_MAPS_KEY');
    151180        }
    152        
     181
    153182        /**
    154183         * Output the options page and save the changes
     
    159188                if(isset($_POST[$key_name])){
    160189                    update_option('GOOGLE_MAPS_KEY', $_POST[$key_name]);
    161                     ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 
     190                    ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php
    162191                }
    163192                ?>
     
    172201                    </form>
    173202                </div>
    174                 <?php 
    175             }
    176         }
    177        
     203                <?php
     204            }
     205        }
     206
    178207        /**
    179208         * Output the missing config warnings
     
    185214                        <p><?php printf(__('You must <a %1$s>enter your Google Maps API key</a> for <strong>WP GMaps</strong> to work.', WP_GMaps_text_domain), 'href="plugins.php?page=WP_GMaps_pluginOptionsPage"'); ?></p>
    186215                    </div>
    187                 <?php 
     216                <?php
    188217            }
    189218        }
    190219    }
    191    
     220
    192221    // load the plugin translations
    193222    load_plugin_textdomain(WP_GMaps_text_domain, false, dirname(plugin_basename(__FILE__)).'/langs');
    194    
     223
    195224    // insert the necessary javascript
    196225    add_action('wp_head', array(WP_GMaps, 'appendToHeader'));
  • wp-gmaps2/trunk/readme.txt

    r184177 r201975  
    11=== WP_GMaps2 ===
    22Contributors: cesperanc
    3 Tags: google maps, tinymce, post, page
     3Tags: google maps, tinymce, post, page, gmaps, maps, map
    44Requires at least: 2.8.4
    5 Tested up to: 2.9.0
    6 Stable tag: 2.0
     5Tested up to: 2.9.1
     6Stable tag: 2.1
    77
    88This plugin allows an easy integration of Google Maps on your pages or posts.
     
    1010== Description ==
    1111
    12 This plugin allows the inclusion of Google Maps on your pages or posts using just the WYSIWYG (TinyMCE) controls. You can now insert and use Maps with just your mouse. This plugins supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs and HTML support, etc.
     12This plugin allows the integration of Google Maps on your pages or posts using the Wordpress Editor (TinyMCE). It supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs with HTML support, etc. Give it a try.
    1313
    1414== Installation ==
     
    3737== Screenshots ==
    3838
    39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar e then press 2 (google maps) to open the Google Maps Window.
     391. To insert a map, press 1 (kitchen sink) to show the advanced bar and then press 2 (google maps) to open the Google Maps Window.
    40402. In the Google Maps window you can insert or update your map.
    41413. The final result.
    4242
    4343== Changelog ==
     44
     45= 2.1 =
     46* json_decode substitute for those that are using a PHP version bellow 5.2 (thanks to www at walidator dot info)
     47* Plugin URI updated to the new home
     48* Plugin validated for Wordpress 2.9.1
    4449
    4550= 2.0 =
  • wp-gmaps2/trunk/wp_gmaps2.php

    r147909 r201975  
    22    /*
    33        Plugin Name: WP_GMaps2
    4         Plugin URI:  http://ued.ipleiria.pt
     4        Plugin URI:  http://sites.ipleiria.pt/labsUED/en/wordpress-en/plugins/wp-gmaps2/
    55        Description: WP_GMaps2 adds Maps to your pages and posts in Wordpress using the Google Maps API version 2.
    6         Version: 2.0
     6        Version: 2.1
    77        Author: Cláudio Esperança
    88        Author URI: http://ued.ipleiria.pt
    99    */
    10    
    11     /* 
     10
     11    /*
    1212        Copyright 2009  Cláudio Esperança ([email protected])
    13        
     13
    1414        This program is free software; you can redistribute it and/or modify
    1515        it under the terms of the GNU General Public License as published by
    1616        the Free Software Foundation; either version 3 of the License, or
    1717        (at your option) any later version.
    18    
     18
    1919        This program is distributed in the hope that it will be useful,
    2020        but WITHOUT ANY WARRANTY; without even the implied warranty of
    2121        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2222        GNU General Public License for more details.
    23    
     23
    2424        You should have received a copy of the GNU General Public License
    2525        along with this program; If not, see <http://www.gnu.org/licenses/>.
    26    
     26
    2727    */
    28    
     28
     29    /**
     30     * json_decode substitute for those that are using a PHP version bellow 5.2
     31     *
     32     * @author [email protected]
     33     * @see http://pt2.php.net/manual/en/function.json-decode.php#91216 for reference
     34     */
     35    if ( !function_exists('json_decode') ){
     36        function json_decode($json){
     37            $comment = false;
     38            $out = '$x=';
     39
     40            for ($i=0; $i<strlen($json); $i++){
     41                if (!$comment){
     42                    if ($json[$i] == '{')        $out .= ' array(';
     43                    else if ($json[$i] == '}')    $out .= ')';
     44                    else if ($json[$i] == ':')    $out .= '=>';
     45                    else                         $out .= $json[$i];
     46                }
     47                else $out .= $json[$i];
     48                if ($json[$i] == '"')    $comment = !$comment;
     49            }
     50            eval($out . ';');
     51            return $x;
     52        }
     53    }
     54
     55    /**
     56     * Some defines
     57     */
    2958    define('WP_GMaps', 'WP_GMaps2'); // should match the class name bellow
    3059    define('WP_GMaps_text_domain', 'wp_gmaps2');
    31    
     60
    3261    /**
    3362     * Class responsable for the Wordpress/TinyMCE/Google Maps integration
    34      * 
     63     *
    3564     * @author cesperanc
    36      * @version 2.0
     65     * @version 2.1
    3766     */
    3867    class WP_GMaps2 {
    3968        private $_content = "";
    40    
     69
    4170        function __construct($content=""){
    4271            $contents = array();
    4372            if(preg_match_all("(<!--(gmap|googlemap) ((\n|.)*?)-->)",$content,$contents)){
    4473                $js_addOnShowMaps='';
    45                
     74
    4675                foreach($contents[2] as $mapn=>$map){
    4776                    $result = '';
     
    5584                    $content = str_ireplace($contents[0][$mapn],$result,$content);
    5685                }
    57                
     86
    5887                $this->_content .= $content.'
    5988                        <script type="text/javascript">
     
    6493            }
    6594        }
    66        
     95
    6796        public function content(){
    6897            return $this->_content;
    6998        }
    70        
     99
    71100        public function filterContent($content){
    72101            if(!isset($this)){
     
    79108                $gmap = &$this;
    80109            }
    81            
     110
    82111            return $gmap->content();
    83112        }
    84        
     113
    85114        public function appendToHeader(){
    86115            ?>
    87116                <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?php echo(get_option('GOOGLE_MAPS_KEY','')); ?>"></script>
    88117                <script type="text/javascript" src="<?php echo(plugin_dir_url(__FILE__)); ?>js/client.js"></script>
    89             <?php 
    90         }
    91        
     118            <?php
     119        }
     120
    92121        /**
    93          * Adds a button to TinyMCE buttons list 
     122         * Adds a button to TinyMCE buttons list
    94123         */
    95124        public function tinymceRegisterButton($buttons) {
     
    97126           return $buttons;
    98127        }
    99          
     128
    100129        /**
    101130         * Set the URL to the plugin for TinyMCE
     
    105134           return $plugin_array;
    106135        }
    107        
     136
    108137        /**
    109138         * Set the URL to the plugin for TinyMCE
     
    113142            return $init;
    114143        }
    115        
     144
    116145        /**
    117146         * Add the necessary filters for the TinyMCE plugin
     
    143172            }
    144173        }
    145        
     174
    146175        /**
    147176         * Register the plugin options
     
    150179            register_setting('WP_GMaps2_options', 'GOOGLE_MAPS_KEY');
    151180        }
    152        
     181
    153182        /**
    154183         * Output the options page and save the changes
     
    159188                if(isset($_POST[$key_name])){
    160189                    update_option('GOOGLE_MAPS_KEY', $_POST[$key_name]);
    161                     ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 
     190                    ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php
    162191                }
    163192                ?>
     
    172201                    </form>
    173202                </div>
    174                 <?php 
    175             }
    176         }
    177        
     203                <?php
     204            }
     205        }
     206
    178207        /**
    179208         * Output the missing config warnings
     
    185214                        <p><?php printf(__('You must <a %1$s>enter your Google Maps API key</a> for <strong>WP GMaps</strong> to work.', WP_GMaps_text_domain), 'href="plugins.php?page=WP_GMaps_pluginOptionsPage"'); ?></p>
    186215                    </div>
    187                 <?php 
     216                <?php
    188217            }
    189218        }
    190219    }
    191    
     220
    192221    // load the plugin translations
    193222    load_plugin_textdomain(WP_GMaps_text_domain, false, dirname(plugin_basename(__FILE__)).'/langs');
    194    
     223
    195224    // insert the necessary javascript
    196225    add_action('wp_head', array(WP_GMaps, 'appendToHeader'));
Note: See TracChangeset for help on using the changeset viewer.