Welcome to our new development blog Back from Brighton
Post by Phil / November 3rd, 2007

FlashTextFormatter plugin for WordPress

We' reusing the FTF wordpress-plugin to view code snippets/samples. It's a really nice plugin which automatically colors /highlights your ActionScript (and even more: js, php, python). Just put some [ ftf ] brackets around your code ... the plugin does the rest.

We're actually using this fix from zeuslab (FTF w/ SWFObject).

You can also include whole as-files - but my first attempts all failed. After debugging the script for a while, I found a small bug inside the FlashTextFormatter.php. To fix it you just have to change one line of code:

  1. // change line 86 from
  2. $ftf_props[$ftf_counter]['file'] = "index.php";
  3.  
  4. // to sth like this
  5. if(ftf_getProp('file', $ftf_counter) != "")
  6. $ftf_props[$ftf_counter]['file'] = ftf_getProp('file',$ftf_counter);

Now everything works fine :)

1 Comment

  1. Phil / April 9th, 2008 / 12:41

    UPDATE:
    we switch over to another great code highlighting plugin for wordpress:

    http://ideathinking.com/wiki/index.php/WordPress:CodeHighlighterPlugin

    but i also made some minor changes so we are now able to load external files to be shown and highlighted. additionally we can set the height of the container.

    *it looks like it only works w/ firefox … still fixing it for IE*