Flash Text Formatter plugin for WordPress
Posted by Lon Hosford on May 9th, 2007 at 11:01am
Because I have had poor results with Flash Text Formatter I no longer use it. Rather I suggest CodeColorer. Flash Text Formatter suffers from a lack of maintenance and good web site support information. For CodeColorer be sure you change the css file name as noted in install instructions or you may need to clear your web cache if you already started using it.
The rest of this post is historical only.
I stumbled on the Flash Text Formatter v0.6 plugin for WordPress while studying some mxml examples. I had no luck with Scott Reilly' Preserve Code Formatting plug-in and had to turn it off. It may have problems with different themes.
In any case the Flash Text Formatter works with XML files that stylize the code and place it in Flash movies that are part of the blog post. Once installed there is a simple open and close tag that will enclose the code. The open tag has width and height attributes. The readme file claims a file parameter for reading external code.
One drawback is that you may find problems in preserving indenting and using file parameter for external files. The latter item required changing the plug-in PHP code to get it to work. See comments at end of post for more on this important change.
You can get it at flashtexteditor.com. It will cost you subscribing and providing an email address.
You find some additional examples at play.ground.gr. You also will find an unanswered blog inquiry about the file parameter.
Simple one liner embedded code.
Loading a local file. Indenting preserved.
Loading a cross domain file. Indenting preserved. Also it has mxml that looks real good.
Pasted from Flash editor; that is, embedded in post. Note loss of indenting.
Modifying the FlashTextFormatter.php plugin code.
There are some fancy (too fancy) regular expressions that filter out any entry that uses an external file. I made some modifications to the regular expressions to get around that and find that if I load an external file the indenting is preserved.
You need to add :\/ (backslash forwardslash) between the space and " in 9= " part of all regular expressions.
Ex: \[ftf([A-Za-z0-9= "._]*)\] to \[ftf([A-Za-z0-9= :\/"._]*)\]
This allows for the / in paths and the : in http:.
You also need to remove the line
$ftf_props[ $ftf_counter ][ 'file' ] = "index.php";
in the ftf_insert($arr) function.
I also added the line
$ftf_props['default']['file']="index.php";
to the ftf_init() function.
Finally I republished the ftf_wp.fla in Flash 8.
One more change coming out of comments involves the content disappearing when in comment view of the post.
The partial solution here was not sexy but works. This line needs changing from
$ftf_path=”./wp-content/plugins/FlashTextFormatter/”;
to a hard coded path from the site root.
This may only be needed if you have PermaLinks in use for your WordPress.
This still leaves open a relative file path for content. So you will need to use a full http: url for external files until I find the right code we need for $ftf_path.
Under Flash+ General stuff
3 Comments for Flash Text Formatter plugin for WordPress
1. Igor | May 10th, 2007 at 2:43 am
Thanks Lon!
I am sorry that I don’t have enough free time to improve FTF.
BTW, FTF is not appearing in post view at your blog, only at WordPress homepage.
2. Lon Hosford | May 10th, 2007 at 7:23 am
Thanks for the observation Igor.
Since I am not a WordPress plugin expert, I am not sure why when viewing comments the FTF will not show. I sort of hacked my way through the FlashTextFormatter.php to get the file load which I knew would preserve the indenting.
Any help to identify why you cannot see this would be appreciated.
Great tool. Unless there is something out there better, this is a very useful tool for folks in IT now that Flash is permeating so many web projects.
3. Lon Hosford | May 10th, 2007 at 10:18 am
Fixed the comment edit view.
Solution is to change FlashTextFormatter.php
$ftf_path=”./wp-content/plugins/FlashTextFormatter/”;
to a hard coded path from the site root.
This problem must be with the Premalinks and Apache rewrites.
Leave a Comment for Flash Text Formatter plugin for WordPress
You must be logged in to post a comment.
Trackback this post | Subscribe to the comments via RSS Feed