|
Cookbook /
FlickrAlbumSummary: Display images dynamically from Flickr
Status: Stable
Version: 2007-03-05
Prerequisites: PmWiki 2.0
Maintainer: JonHaupt
Discussion: FlickrAlbum-Talk?
Categories: Images
Questions answered by this recipe
DescriptionUsing this recipe will allow you to have albums of Flickr photos in your wiki that update automatically when new photos are added to Flickr. This recipe requires the use of the phpFlickr class written by Dan Coulter, a Flickr API key, and this recipe. You may also need to use MySQL (see below). Follow these steps to Flickr photos in your site:
The script will display an album of photos by a given username. The album is contained in a div called "flickralbum" which can then be styled using skin or local css. The simplest album can be created by using the markup (:flickralbum:) which will create an album of 12 of the most recent photos added to Flickr in 6 columns. (:flickralbum user=foo:) can, then, be used to create a similar album of recent photos by someone with the Flickr username foo, etc. The following is a list of arguments possible for other combinations:
As of version 0.5, you can also specify that the images returned be displayed using Lightbox, using "lightbox=1". In order to do this, you have to install Lightbox JS on your server in a web-accessible location, then add the following to config.php:
# lightbox
$HTMLHeaderFmt['lightbox'] = "
<script type='text/javascript' src='http://your.url/lightbox/js/prototype.js'></script>
<script type='text/javascript' src='http://your.url/lightbox/js/scriptaculous.js?load=effects'></script>
<script type='text/javascript' src='http://your.url/lightbox/js/lightbox.js'></script>";
For examples, see NotesMany other uses of phpFlickr are available and future tweaks of this recipe are planned, particularly for displaying photos in sets and groups.
Updates2007-05-03: Added global variables for database/filesystem caches, changed styling for images (now you should use .flickralbum in your CSS instead of #flickralbum).
See Also
ContributorsCommentsUser notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |