Flickr photos is a plugin that enables you to display thumbnail links of Flickr photos in your Movable Type blog.
You can list thumbnails by Filckr user and/or by Flickr tags. You can also control the number of thumbnails displayed and the size of the thumbnails. Each thumbnail can link to a larger version of the image, or to the Flickr page for that photo.
Here is an example of the easiest way to use FlickrPhotos in your templates:
<MTFlickrPhotos username="John Smith">
<MTFlickrPhotoLink> <br />
<br />
</MTFlickrPhotos>
The above template code will display thumbnail links for the 10 most recent photos for Flickr user "John Smith". (Tip: when entering the value for your 'username', you should use the name that appears after "Logged in as" on the top of each Flick page when you are logged in. Your user name may contain spaces - if so, be sure to include those space as I have done with "John Smith" above).
Here another example that displays thumbnail links from any user tagged with "movabletype":
<MTFlickrPhotos tags="movabletype">
<MTFlickrPhotoLink> <br />
<br />
</MTFlickrPhotos>
FlickrPhotos Template Tags
FlickrPhotos includes the following template tags:
- MTFlickrPhotos is container tag for displaying photos. Arguments include:
- username - restricts photos to a specific Flickr user. Required if a tags argument is not included.
- tags - retricts photos to those with the specified tags. Multiple tags can be specified, separated by comma. Required if a username argument is not included.
- tag_mode - specifies the method for displaying photos by the tags argument. If tag_mode is set to 'any', it will display photos with at least one on the tags specified in tags. If tag_mode is set to 'all', it will only display photos tagged with each and every one of the tags specified by tags. Optional (the default value is 'any').
- lastn - determines the number of photos to display. Optional (default is 10 photos).
- MTFlickrPhotoThumb outputs the URL to the thumbnail image. The size of thumbnail is determined by the FlickrPhotos plugin settings (see below). Example usage: <img src="<MTFlickrPhotoThumb>">
- MTFlickrPhotoURL outputs the destination URL that can be used to link each thumbnail. This URL will be to either to the Flickr photo page or directly to a different size of the photo (as determined by the plugin settings). Example usage: <a href="<MTFlickrPhotoURL>">
- MTFlickrPhotoTitle outputs the Flickr title for the photo. This can be used as "alt" text for the thumbnails, and/or used a caption for each photo.
- MTFlickrPhotoLInk combined each of the above tags - it outputs a linked thumbnail, using the title as the 'alt' and 'title' for the link. The link will open in a new window. This tag is the easiest way to use FlickrPhotos, becuase you don't have to write any HTML for creating the link or displaying the image.
FlickrPhotos Plugin Settings
There are two settings which you can set on a pe-blog basis. To access these settings, select the blog you want and then choose "Settings" from the menu. Then choose the "Plugins" tab. You should then see FlickrPhotos in the list of plugins - hit the settings link to display the settings. The two settings are:
- Thumbnail Size: This setting determines the size of the thumbnail images. Choice are Square, Thumbnail, Small, Medium, and Orginal. These sizes correspond to the sizes used by Flickr. The default is Thumbnail.
- Link to: This setting determines where each thumbnail will link to. You can link directly to a different size of the photo (you can choose from the same sizes as above) OR you can link each photo to the Flickr page for that photo. The default is Flickr Page.
Requirements:
- MT 3.2 (it may work with earlier versions, but I have not tried)
- Flickr::API Perl Module (included in download for convenience)
- XML:: Parser::Lite and XML:: Parser::Lite::Tree (included for convenience)
Download Now
Membership required, please sign-in or register:
Installation
- Expand the zip file and upload the contents of the 'plugins' folder to the 'plugins' directory of your MT installation and the contents of the 'extlib' folder to the 'extlib' folder of your MT installation.
- Adjust the plugun settings if desired (see above)
- Start using the above template tags in your templates.
As always, please let me know if you find any bugs, or if you have any suggestions or comments.

Comments (10)
dfsdf sdfsdf http://sdfsdf.com
Posted by fghfgh | April 10, 2006 5:52 AM
Posted on April 10, 2006 05:52
If I hacked your hack to provide size information, would you be willing to consider back patching that in? The application I have in mind for this requires the pixel sizes of the images.
P.S. You have two copies of FlickrPhotos.pl in the distribution.
P.P.S. In terms of code structure, I have a whole bunch of comments. Heh.
* Why do you repeat the API key in multiple places instead of 'use constant' or even an 'our' variable?
* You should look at moving most of the code to an ancillary file that loaded only if the plugin is used, instead of loading that big chunk 'o code every time anything is done in MT. Look at AutoBan for an example of how to do that.
Posted by Annoying Old Guy | April 24, 2006 12:03 AM
Posted on April 24, 2006 00:03
Thanks for the comments, AOG.
Yes, if you want to add a pixel dimensions feature, I would definitely add that in. Thanks.
Regarding having 3 copies of FlickrPhotos.pl -- thanks for letting me know, I will look into that right away.
Regarding the API key, the answer is laziness :blush: mostly. I know that I really should do that.
I will try to implement your last suggestion too. The general answer to these questions is that I am quite a novice when it comes to programming. When I do things like this, much time is spent, digging for tutorial content to try to figure out how to achieve what I want. I am sure there are more than a few best practices that I am not following ;)
Posted by Mark | April 24, 2006 10:20 AM
Posted on April 24, 2006 10:20
Well, I already have a working copy, if you'd like to see it :wink:. I'll mail you a copy, along with some other commentary.
Posted by Annoying Old Guy | April 24, 2006 12:41 PM
Posted on April 24, 2006 12:41
This is fantastic - thanks for creating it. :-)
Any way to grab random photos instead of the last picture uploaded?
Posted by erika | August 3, 2006 10:07 PM
Posted on August 3, 2006 22:07
Hi
I am mere novice with Moveable Type but I do know that it's a fantastic creation.
I use it for RSS mostly and want to include images along side my news feed.
I have successfully installed flickr but I just don't know how to use it. Can anybody help me out here.
Best regards
Kelly :-(
Posted by Kelly
|
August 10, 2006 7:14 AM
Posted on August 10, 2006 07:14
Hi,
Is there any way to get the photos to wrap horizontally on a page?
Erika
Posted by Erika Varga
|
August 19, 2007 12:45 AM
Posted on August 19, 2007 00:45
Erika, can you be more specific? What exactly do you want to do? Using the template tags, you can add breaks or other markup between each photo to customize the way that they are displayed.
Posted by Mark Carey
|
August 19, 2007 7:55 AM
Posted on August 19, 2007 07:55
Can I repeat Erika's earlier request? Is there a way to get the plugin to choose random photos from a set, rather than always the most recent uploaded? I would like the display of photos to rotate once a day or so, to make readers' lives more interesting.
Andrew Brown
Posted by acb
|
August 20, 2007 1:39 AM
Posted on August 20, 2007 01:39
Great plugin, was wondering if there was away to add some additional elements into the output url as want to integrate with a lightbox effect?
Essentially I want to add...rel="lightbox[name]" to the url
Posted by harryp | April 23, 2008 10:06 AM
Posted on April 23, 2008 10:06