• I got a parse error after updating from version map-generator 1.1 to 1.2

    Parse error: syntax error, unexpected ‘}’ in /home/eamel/domains/nabeeld.nu/public_html/wp-content/plugins/map-generator/map-generator.php on line 85

    I’m no hero in php so I haven’t got a clue what this is about. The ting I do know is that I have got a serious problem here; i’ve been using the map-generator plugin for a while now and it gives an error on both sites.

    I’ve tried to find a subversion of this thing (1.1) but it’s no-whwere to find. I’ve mailed the author but it must be night over there.

    Is there anything I can do right now?

    Please help!

    https://www.ads-software.com/support/plugin/map-generator

    https://www.ads-software.com/extend/plugins/map-generator/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter eamel

    (@eamel)

    The code (map-generator.php: line 85 says: } else {

    <?php
    /*
    Plugin Name: Map-Generator
    Plugin URI: https://map-generator.net/de
    Description: This Plugin adds custom maps from map-generator.net to your blog. You can now add multible marker, change the Marker apperance, size, view the map as StreetView and much more.
    Version: 1.2
    Author: Map-Generator.net
    Author Email: [email protected]
    License:

    Copyright 2012 map-generator.net ([email protected])

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 3, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

    */

    class MapGenerator {

    /*——————————————–*
    * Constants
    *——————————————–*/
    const name = ‘MapGenerator’;
    const slug = ‘mapgenerator’;

    /**
    * Constructor
    */
    function __construct() {
    //Hook up to the init action
    add_action( ‘init’, array( &$this, ‘init_mapgenerator’ ) );
    }

    /**
    * Runs when the plugin is activated
    */
    function install_mapgenerator() {
    // do not generate any output here
    }

    /**
    * Runs when the plugin is initialized
    */
    function init_mapgenerator() {
    // Load JavaScript and stylesheets
    $this->register_scripts_and_styles();

    // Register the shortcode [MAP]
    add_shortcode(‘mapgen’, array( &$this, ‘render_shortcode’ ));

    }

    function render_shortcode($atts) {
    // Extract the attributes
    extract(shortcode_atts(array(
    ‘url’ => ‘https://map-generator.net/de/maps/12000&#8217;, //default url
    ‘width’ => ‘640px’, // default width
    ‘height’ => ‘350px’ // default height
    ), $atts));
    // you can now access the attribute values using $attr1 and $attr2

    // def regex for url
    $reg_exp = ‘/\d+/’;

    // extract the url from the link
    preg_match($reg_exp, $url, $map_gen_id, NULL, 0);

    // check if we got an url or just an id
    $pos = strpos($url, “https://&#8221;);

    if ($pos === false) {
    // we got just an id -> fall back to map-generator
    $map_path = “https://map-generator.net/de/maps/&#8221;.$map_gen_id[0].”.js”
    } else {
    // take the given url
    $map_path = $url.”.js”
    }

    // build include tag
    $tag = “<div id=\”map_canvas_custom_”.$map_gen_id[0].”\” style=\”width:”.$width.”; height:”.$height.”\” ></div><script type=\”text/javascript\”>(function(d, t) {var g = d.createElement(t),s = d.getElementsByTagName(t)[0];g.src = \””.$map_path.”\”;s.parentNode.insertBefore(g, s);}(document, \”script\”));</script>”;

    return $tag;
    }

    /**
    * Registers and enqueues stylesheets for the administration panel and the
    * public facing site.
    */
    private function register_scripts_and_styles() {
    if ( is_admin() ) {
    add_filter( ‘mce_buttons’, array( $this, ‘filter_mce_button’ ) );
    add_filter( ‘mce_external_plugins’, array( $this, ‘filter_mce_plugin’ ) );

    } else {

    } // end if/else
    } // end register_scripts_and_styles

    function filter_mce_button( $buttons ) {
    // add a separation before our button, here our button’s id is "mygallery_button"
    array_push( $buttons, ‘|’, ‘mapgen_button’ );
    return $buttons;
    }

    function filter_mce_plugin( $plugins ) {
    // this plugin file will work the magic of our button
    $plugins[‘mapgen’] = plugin_dir_url( __FILE__ ) . ‘js/map-generator.js’;
    return $plugins;
    }

    } // end class
    new MapGenerator();

    ?>

    Plugin Author MapGenerator

    (@mapgenerator)

    thanks for debugging.

    Just for the record:
    The issue was solved in version 1.3.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Map-Generator] Parse error after update 1.1 -> 1.2’ is closed to new replies.