Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 09:03 pm EST

Flickr plugin

  • Sunday, January 08 2006 @ 05:45 am EST
  • Contributed by:
  • Views: 19,542
Plugins

The Flickr plugin displays thumbnails of Flickr photos on your site and links the thumbnails to their photo pages.

All the plugin does is to implement a [flickr:] autotag. You simply add the photo's id and it does all the rest. What is a photo id? When you view a photo on Flickr, the URL looks something like this:

http://www.flickr.com/photos/dhaun/71877803/

So here "71877803" is the photo's id. Now you simply add that id in the [flickr:] autotag after the colon:

[flickr:71877803]

When the story is displayed, it will show the photo's thumbnail instead of the autotag. Clicking on the thumbnail will take you to the photo page on Flickr (the above URL, in this example).

The plugin will get the photo's title from Flickr and display it as a title attribute when you hover your mouse over the thumbnail. If you'd rather provide your own title, simply enter it after the id:

[flickr:71877803 How to make a penguin fly]

And that's pretty much everything the plugin currently does.

The plugin uses Dan Coulter's phpFlickr class (version 1.4.3 is included with the plugin) which does all of the hard work of communicating with Flickr. It also provides caching options, as the use of [flickr:] autotags may significantly slow down your site otherwise (see the plugin's README for details).

Yes, I can imagine a lot more things that this plugin could do with the Flickr API. But currently it doesn't. It's pretty much only a proof-of-concept that I hacked together last night. I released it because I thought people would find it useful. If you have any grand plans for this plugin, then by all means grab the source and run with it (it's GPL, after all).

Oh, and because I'm lazy the included installation script only really works with Geeklog 1.4.0 although there's nothing in the plugin itself that would prevent it from working with 1.3.10 or 1.3.11. If you create the entry for the plugin in Geeklog's gl_plugin table manually, then it should work just fine on those versions.