logIt Log Around The Clock

Write WordPress Plugins to Play Freemind Mind-Map File

The first version main goal is to embed the *.mm file which is a Freemind file. I found similarity of embedding this kind of file in flash-video-player plugins (I used version 3.1.8). So, I tried to reverse engineer by mind-mapping how it works first and how to hook plugins to WordPress. Here is version 1.1 of the fremind-wp-browser. The final mind-map and plugin in-use in this post looks crowded, but you can find highlighted pointers below the mind-map.

Get the Flash Player to see this player.

Embedding with SWFObject

The *.mm file is projected over visorFreemind.swf player with the help of javascript.

Using javascript from SWFObject, the idea of flash embedding is to create an SWFObject and then write() that inside certain part of page body, i.e. div.

<script type="text/javascript"> 
   var s0 = new SWFObject("visorFreemind.swf","n0","800","400","7");
   s0.write("video0") ;

Parsing a Post

In general, the plugins will parse a post content to find [freemind file="path-to.mm" /] shortcode that will finally be replaced by the above javascript with respect to *.mm file that will be played over visorFreemind.swf.

Hooking the Plugins to WordPress

The above javascript needs to be loaded in every head part of each WordPress page, this action will call a function that will insert that script

add_action('wp_head', 'FreemindMap_head');

Hence, we get

<script type="text/javascript" src="http://lakm.us/logit/wp-content/plugins/freemind-wp-browser/swfobject.js"></script>

on the header source of every page.

To deal with content parsing looking for the shortcode, add the following filter

add_filter('the_content', 'FreemindMap_Parse');

Activation/deactivation of the plugin is via the hook registration where it also create an option panel when activated by adding

add_options_page('Freemind Options', 'Freemind', '8', 'freemind-wp-browser.php', 'FreemindOptions');

This initial version has limited options though; enough to set the width and height of the mind-map projection.

2 thoughts on “Write WordPress Plugins to Play Freemind Mind-Map File

  1. Laurent

    First I want to thank you for your plugin : its really great, It allows me to perform my website. Then, users gave me some feedback : the plugin is really ‘sensitive’ (especially the zoom) and isn’t very easy to use for the macbook touchpad. I wanted to know if some code exist in order to decrease this ‘sensitivity’ of the zoom in/zoom out.
    Thank you a lot

  2. Arif Post author

    Hi Laurent,
    Thank you for using the plugin, what the plugin does is really simple: embedding mind map file to the flash projector. The behavior is controlled by the flash projector (visorFreemind.swf). I remember once that the author of that flash shared the code somewhere over the internet, but probably not worth the effort modifying this since flash support has been dropped from most future browser. However, I haven’t found HTML5 replacement for the projector. I’m sorry that I can’t be of any help with this.

    I’ll let you know if there is new development going on.

    btw, I have always dream of having something like “Carte : la philosophie” that you’ve started there. Je ne parles pas francais but it’s a great work there.

Leave a Reply