Skip to content →

My blog friendly Flickr front-end PHP script

I’ve just started getting into Flickr – think online photo repository meets, with blog and XML functionality.

Anyway, it’s a nice system BUT the main method of viewing photos seems to be via a Flash App (it allows interactive commenting, etc). Those of you who don’t know me, I’m not a big fan of Macromedia Flash.

Despite my reservations about the presentation of images within Flickr, I like the way I can easily email my pictures from my P900 phone and get them automatically posted to my blog. SO, I’ve written my own interface that completely displays my photos outside of the flickr website – avoiding their implementation of Flash. Yes, it has removed the commenting and taxonomy tagging opportunities, but for the time being I’m happy.

Flickr already offers a basic “photo flickr-roll” for your blog, but it uses Javascript to call the roll on the client-side (end user), and inserts it via document.write. This technique is simple-yet-effective, indeed I implemented it when I built the BBC News Headlines Syndication Boxes, but it’s not ideal – especially if you have PHP/Perl/ASP available to you.

I took their Javascript offering and pulled it around into something better (I think).

You can see it in action on the Moblog section of this blog’s sidebar.

In a nut shell it works like this:

  1. Get’s the latest x number of thumbnails from Flickr
  2. Strips out their Javascript document.write implementation
  3. Produces new anchor tags that link to the full size photos, based on a string manipulation of the source-urls of the thumbnails. (rather than point you to a page with your image in their cruddy Flash app

If you like it, please feel free to take the code:

Download Flickr Code (save as a .php file)

Published in Thoughts and Rants Uncategorized


  1. I’d like the script to point back to flickr, just like the java script does, how would I go about this?

  2. I like this script. It has allowed me to resize the images for better displaying on my webpage. One thing I am trying to do but I haven’t spent much time trying to figure it out. (What takes me 2 hours to figure out in php takes most people 5 minutes.) I want to point back to the real flickr directory that the flickr badge would point to rather than just the picture.

    source image is “”

    I need to figure out how to just grab the “4708056” and append it to my flickr url. I know it’s easily done. Just don’t know the method yet. If you can post some script to do that, that would be great. 🙂

  3. Hi Ben

    I’d love to try out your PHP script to syndicate Flickr but the links seems to be broken at the mo…


  4. Please fix this link! It sounds exactly what I’m looking for! 🙂

Comments are closed.