• I have patched a version of this plugin to work with WP 3.2.1 and wp in a subdir.

    Index: wp-freemind.php
    ===================================================================
    --- wp-freemind.php	(revision 469913)
    +++ wp-freemind.php	(working copy)
    @@ -27,10 +27,10 @@
    
     function freemind_init() {
         //Register the flashobject JS library
    -    wp_enqueue_script('flashobject', '/wp-content/plugins/wp-freemind/flashobject.js', array(), true);
    +    wp_enqueue_script('flashobject', plugins_url('flashobject.js', __FILE__), array(), true);
     }
    
    -add_action('plugins_loaded', 'freemind_init');
    +add_action('init', 'freemind_init');
    
     //Function to replace the [mindmap] shortcode
     function handle_freemind_shortcode($atts, $content) {
    @@ -40,14 +40,14 @@
        );
     //Generate unique id for DIV to be replaced
     $id = 'wpf'.time().rand(0,1000);
    -if ($content == '') $content = '/wp-content/plugins/wp-freemind/wp-freemind.mm';
    +if ($content == '') $content = plugins_url('wp-freemind.mm', __FILE__);
     $a = shortcode_atts($defaults_array, $atts);
     $height = 'height:'.$a['height'];
     $width = ($a['width'])?(';width:'.$a['width']):'';
     return '<div id="'.$id.'" style="'.$height.$width.'">JavaScript or Flash plugin need to be activated in your browser.</div>
     <script type="text/javascript">
     <!--
    -var fo = new FlashObject("/wp-content/plugins/wp-freemind/visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#9999ff");
    +var fo = new FlashObject("' . plugins_url('visorFreemind.swf', __FILE__) . '", "visorFreeMind", "100%", "100%", 6, "#9999ff");
     fo.addVariable("initLoadFile","'.$content.'");
     fo.write("'.$id.'");
     //-->

    https://www.ads-software.com/extend/plugins/wp-freemind/

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

    (@lancehudson)

    One cause of the bluescreens is if wordpress is in a subdir.

    Thread Starter lancehudson

    (@lancehudson)

    Updated patched version to allow upload of mm files

    <?php
    /*
    Plugin Name: Freemind Viewer
    Plugin URI: https://www.semeteys.org/wp-freemind
    Description: Integration of Freemind Flash viewer into WordPress
    Version: 1.0
    Author: Rapha??l Semeteys
    Author URI: https://www.semeteys.org
    
    Copyright 2009  Rapha??l Semeteys  (email: [email protected])
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
    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
    
    */
    
    function freemind_init() {
        //Register the flashobject JS library
        wp_enqueue_script('flashobject', '/wp-content/plugins/wp-freemind/flashobject.js', array(), true);
    }
    
    add_action('init', 'freemind_init');
    add_filter('upload_mimes', 'freemind_mime_types');
    
    //Function to allow mm files to be uploaded
    function freemind_mime_types( $mime_types = array() ) {
    
    	$mime_types['mm'] = 'application/freemind';
    
    	return $mime_types;
    }
    
    //Function to replace the [mindmap] shortcode
    function handle_freemind_shortcode($atts, $content) {
    $defaults_array = array(
       'width' => false,
       'height' => '600px',
       );
    //Generate unique id for DIV to be replaced
    $id = 'wpf'.time().rand(0,1000);
    if ($content == '') $content = plugins_url('wp-freemind.mm', __FILE__);
    $a = shortcode_atts($defaults_array, $atts);
    $height = 'height:'.$a['height'];
    $width = ($a['width'])?(';width:'.$a['width']):'';
    return '<div id="'.$id.'" style="'.$height.$width.'">JavaScript or Flash plugin need to be activated in your browser.</div>
    <script type="text/javascript">
    <!--
    var fo = new FlashObject("'.plugins_url('visorFreemind.swf', __FILE__).'", "visorFreeMind", "100%", "100%", 6, "#9999ff");
    fo.addVariable("initLoadFile","'.$content.'");
    fo.write("'.$id.'");
    //-->
    </script>';
    }
    
    add_shortcode('freemind', 'handle_freemind_shortcode');
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Patched version of wp-freemind’ is closed to new replies.