Markdown and the Flickr Photo Album for WordPress Plugin

Not one day after I [post](http://www.premagination.com/2006/03/22/wordpress-flickr-post-bar-and-markdown/) instructions on how to modify the *Wordpress Flickr Post Bar* Joe Tan releases a massive upgrade in the form of the [Flickr Photo Album for WordPress](http://tantannoodles.com/toolkit/photo-album/). After a receiving a helpful hint from Joe on where to start I’d like to share my hack that replaces the HTML inserted by the plugin with Markdown.

As before, we’re simply removing the hardcoded html and replacing it with Markdown. The function that performs this is named *silas_AddPhoto* and can be found in *”inline-photos.html”* file on line 22. Simply replace that function with the code below and replace the original file on the server with the modified version. That’s it!

*I have reformatted the original code to be easier to read*

function silas_addPhoto(photoUrl, sourceUrl, width, height, title)
{
/*var html =
‘ +
'+title+'‘ +
‘*/
var html = ‘[![' + title + '](‘ + sourceUrl + ‘)](‘ + photoUrl + ‘ “‘ + title + ‘”)’
if ( richedit )
{
win.tinyMCE.execCommand(‘mceInsertContent’, false, html);
}
else
{
win.edInsertContent(win.edCanvas, html);
}
return false;
}

Tags: , , , ,

This entry was posted on Thursday, March 23rd, 2006 at 8:04 pm and is filed under Wordpress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Responses to “Markdown and the Flickr Photo Album for WordPress Plugin”

PreMagination » Flickr Photo Album 0.85 and Markdown October 11th, 2006 at 10:03 pm

[...] Similarly tagged posts I’m BACK!Markdown and the Flickr Photo Album for WordPress PluginWordpress Flickr Post Bar and Markdown [...]

Rogier November 5th, 2006 at 4:28 am

What is different between the original code in this? Why should we use this code?

Drew Loika November 5th, 2006 at 9:03 am

Hey Rogier, this will cause the Flickr Photo Album to insert Markdown into a post instead of HTML. As I write all of my posts in Markdown this is of particular interest to me, but not so much for you. You can read more about Markdown at http://daringfireball.net/projects/markdown/. Cheers!

Billy December 12th, 2006 at 12:35 pm

What I want to do on my blog, is every few hours take the oldest post and move it to the
front of the queue, all automatically. Anyone know if there is a plugin that can do this or
a simple way to set up another plugin to do this (use my own feed perhaps)?
Thanks.

Drew Loika December 12th, 2006 at 5:22 pm

Good luck in your plugin search Billy, I’ve not seen or heard of anything like that.

Leave a Reply