Using phpFlickr to Integrate Flickr Photos on Your Own Site
Written By: Jay
- 21 Oct 2006 -
Description: In this tutorial I will explain how to use the phpFlickr API to interact with Flickr and display photos on a web site.
Over the past couple of weeks I have been working with the class that interfaces with the . Intergrating with Flickr is part of a side-project that I have going which is to create a single site to display del.icio.us links, Flickr photos, Google office docs and other social networking stuff.
Any how I stumbled upon the phpFlickr class and have been hacking away at a fully integrated photo site to display my Flickr photos. Now don't get too excited because the photos I have are mostly just my daughter (Yes, to those of you without kids this is a little weird but I assure you it's perfectly normal).
As always I started out with a grand plan to write the ultimate howto guide to the phpFlickr class and so far it's going well but I am reaching a point that it's just too much information for me to cover. So as a compromise I am posting the source code with some instructions so that others can use the code and hack at it themselves.
Summary
In this tutorial I will explain how to use the phpFlickr API to interact with Flickr and display photos on your own site. phpFlickr is a class that wraps up the Flickr API in a nice well though out package for a PHP developer to work with. It was developed by Dan Coulter and a million thanks go out to him for creating this and giving it away to the rest of us hacks.
The end result is a single php page that displays your Flickr Photo Sets and individual photos on your own site. The code is pretty simple and the most complex part is working with the PHP Object and extracing the correct items and then wrapping them in some HTML. The script works in 3 stages:
- Initial view of the primary photo from each photoset
- All of the photos from a single photo set
- A slide show of a single photoset using Lightbox JS
Requirments
- phpFlickr
- Flickr Account
- A MySQL DB for the PEAR Caching OR
- Read/Write access to the FileSystem
- script.aculo.us
- LightBox JS