« Need Help with MT install | Main | Flickr Photo »

Flickr Photos v0.80

Flickr photos is a plugin that enables you to display thumbnail links of Flickr photos in your Movable Type blog. Flickr Photos focuses on displaying lists of photos, in many possible ways.

The new version, 0.80, has a few bug fixes and a few new features. The majority of these improvements were contributed by Annoying Old Guy, of Solid Wall of Code. Thanks, AOG!

New Features and Bug Fixes

Bug Fixes and Tuning:

-bug fix for MTFlickrPhotoTagURL, should now create correct links
-adjusted HTML in MTFlickrPhotoLink to be xhtml valid
-added a fix to an upgrade problem from v0.5 - if you receive errors after upgrading from v0.5, loading the plugin settings page should now fix it
-code optimizations to improve perfomance
-fixed a bug that was clearing configuration settings
-moved Expressions.pm to correct location to avoid conflicts

Features (details below):

-new tags for photo height and width
-added class elements to the FlickrPhotoLink tag for customization via CSS
-support for setting size and link arguments in MTFlickrPhotos container tag
-support for Plugin Manager (untested, as I was unsuccessful in installing Plugin Manager on my server, use with caution, feedback appreciated)

Basic Usage

You can easily 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 Flickr 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>

Advanced Usage and 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.
    • tags - retricts photos to those with the specified tags. Multiple tags can be specified, separated by comma.
    • 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').
    • search - retricts photos to those with the specified search text
    • lastn - determines the number of photos to display. Optional (default is 10 photos).
    • sort - method to sort the photos. This must be one of date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, or relevance (with 'asc' meaning ascending and 'desc' meaning descending). The default sort method is 'date-posted-desc', which displays the mosting recently uploaded photo first.
    • size - specified the size of the thumbnail images. For size, you can specify "s" (small square), "t" (thubmnail), "m" (small), "med" (medium), "o" (original size).
    • min_upload_date - restricts photos to those with a minimum upload date. Date should be specified as YYYY-MM-DD.
    • max_upload_date - restricts photos to those with a maximum upload date. Date should be specified as YYYY-MM-DD.
    • min_taken_date - restricts photos to those with a minimum taken date. Date should be specified as YYYY-MM-DD.
    • max_taken_date - restricts photos to those with a maximum taken date. Date should be specified as YYYY-MM-DD.
    • Note that each of the above arguments can be used together, including at least 'username' and/or 'tags'. Arguments listed below are 'special' and cannot be used with many of the arguments above:

    • group - restricts the photos to those of a specific group pool. The group argument requires the complete URL of the group page or group pool page. For example <MTFlickrPhotos group="http://www.flickr.com/groups/catchy/">. When using the special group argument, you can further filter the photos by user the lastn, tags, and username arguments - but not the others described above.

    • set - restricts the photos to those of a specific photoset. The set argument requires the complete URL of the photoset page. For example <MTFlickrPhotos set="http://www.flickr.com/photos/markcarey/sets/55064/">. When using the special set argument, you cannot use the other arguments described above.

    • contacts - restricts the photos to those of the contacts of a specific user. The contacts argument requires that you also specify a username. When using the special group argument, you can further filter the photos by user the lastn argument and with the following: just_friends shows only photos from those contacts marked as friends, single_photo displays one photo from each contact, and include_user will display photos include photos from the user specified. For example <MTFlickrPhotos contacts="1" username="John Smith" single_photo="1" include_user="1">

    • favorites - restricts the photos to those of the favorite photos of a specific user. The favorites argument requires that you also specify a username. When using the special favorites argument, you can further filter the photos by user the lastn argument. For example <MTFlickrPhotos favorites="1" username="John Smith">

    • everyone - display recent photos from all Flickr users. When using the special everyone argument, you can further filter the photos by user the lastn argument. For example <MTFlickrPhotos everyone="1" lastn="10">

    • interestingness - display recent interesting photos from all Flickr users. When using the special interestingness argument, you can further filter the photos by user the lastn argument. For example <MTFlickrPhotos interestingness="1" lastn="15">

  • MTFlickrPhotoThumb outputs the URL to the thumbnail image. The size of thumbnail is determined by the FlickrPhotos plugin settings (see below), which can be overidden by an optional size argument. For size, you can specify "s" (small square), "t" (thubmnail), "m" (small), "med" (medium), "o" (original size) Example usage: <img src="<MTFlickrPhotoThumb size="t">">
  • MTFlickrPhotoWidth outputs the width of the photo thumbnail in pixels.
  • MTFlickrPhotoHeight outputs the height of the photo thumbnail in pixels.
  • 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. These settings can be overidden by an optional target argument specifying the size of the photo to link to (see choices above) or "page" to link to the Flickr photo page. Example usage: <a href="<MTFlickrPhotoURL target="page">">
  • 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. This tags supports both of th optional arguments described above, size and target.
  • MTFlickrPhotoDateUploaded outputs the date that the photo was uploaded.
  • MTFlickrPhotoDateTaken outputs the date that the photo was taken.
  • MTFlickrPhotoDescription outputs the description of the photo. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoOwnerName outputs the username or real name of the owner of the photo. In order to display the real name, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoCommentsCount outputs the number of comments that have beeb made on the photo. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoCommentsCount outputs the number of comments that have beeb made on the photo. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoTags is a container tag that displays each of the tags assigned to the photo. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoTagName displays the name of the tag. Must be used between <MTFlickrPhotoTags> and </MTFlickrPhotoTags> tags. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTFlickrPhotoTagURL displays the URL to the Flickr page for the tag for the photo's owner. Must be used between <MTFlickrPhotoTags> and </MTFlickrPhotoTags> tags. For this tag to work, the "Get Photo Details" setting must be turned on (see details below).
  • MTIfFlickrPhotoTags is a conditional tag - anything between the <MTIfFlickrPhotoTags>. and </MTIfFlickrPhotoTags> tags will only be displayed if the photo has one or more tags. For this tag to work, the "Get Photo Details" setting must be turned on (see details below). Here is an example of how these tags can be used to display the tags of a photo:

    <MTIfFlickrPhotoTags>
    Tags for this photo: <br /> <ul>
    <MTFlickrPhotoTags>
    <li><a href="<MTFlickrPhotoTagURL>"><MTFlickrPhotoTagName></a> </li>
    </MTFlickrPhotoTags>
    </ul>
    </MTIfFlickrPhotoTags>

FlickrPhotos Plugin Settings

The following settings can bet set on a per-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 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. This setting can be overidden by using the size argument as described above.
  • 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 This setting can be overidden by using the target argument as described above..
  • Number of Photos: The default numbers of photos to display. The default is 10. You can override this by using the 'lastn' argument (for example, <MTFlickrPhotos username="John Smith" lastn="15"> )
  • Photo List Cache: The length of time to cache the list of photos. After the above time frame has passed, FlickPhotos will check with Flickr to see if there are any new photos. It is highly recommended that this setting be set to 1 hour or longer. Choosing 'none' may slow down your rebuilds considerably. You can override this setting on a case by case basis by specifying the number of seconds in the refresh argument (for example, to set the Photo List Cache to 1 hour you could use <MTFlickrPhotos username="John Smith" refresh="3600"> )
  • Photo Info Cache: The length of time to cache the detailed information for each photo (title, tags, description, number of comments, etc.). After the above time frame has passed, FlickPhotos will check with Flickr to see if there have been any changes to the photo information. It is highly recommended that this
    setting be set to 1 week or longer. Choosing 'none' may slow down your rebuilds considerably. You can override this setting on a case by case basis by specifying the number of seconds in the refresh_details argument (for example, to set the Photo Info Cache to 2 weeks you could use <MTFlickrPhotos username="John Smith" refresh_details="1209600"> )
  • Clear Cache Older Than: This setting will delete cache information about photo lists and photo details that are older than the time frame selected above. This is useful to remove data for older photos that you are no longer displaying, thus preventing your database from growing too large. It is recommended that this setting be set to 1 month or longer. Choosing 'Never' may cause your database to grow sigificantly larger, depending on how you use the plugin. IMPORTANT: With this setting, the cache will not be cleared automatically. To clear the cache you MUST return to this Plugin settings page. To prevent slow rebuilds, the cache-clearing function only runs when you access the Plugin settings page. Also note that this setting is global, meaning that it applies to photo cache data for all of your blogs.
  • Get Photo Details: If set to "On", FlickrPhotos will ask Flickr for some details about each photo. Photo details includes the following: description (<MTFlickrPhotoDescription> ), number of comments
    (<MTFlickrPhotoCommentsCount> ), owner location (<MTFlickrPhotoOwnerLocation> ), and tags (<MTFlickrPhotoTags> ). If you are not displaying these tags on your pages, you can change this setting to "Off" to improve perfomance and speed rebuild times. You can override this setting on a case by case basis by using the "fetchdetails" argument (for example, <MTFlickrPhotos username="John Smith" fetchdetails="1"> )
  • Install Sidebar Widget: Checking the box for this setting and entering a Flickr username will automatically install a Sidebar widget that displays 5 recent photos. You can then customize this by editing the "Sidebar: FlickrPhotos" template module, which will be created after checking this option. This setting works with the Sidebar Manager plugin: Learn more about Sidebar Manager.

Requirements:

  • MT 3.2
  • Flickr::API Perl Module (included in download for convenience)
  • XML:: Parser::Lite (included for convenience)
  • XML:: Parser::Lite::Tree (included for convenience)
  • XML:: Parser::Lite::Tree::XPath (included for convenience)

Download Now

FlickrPhotos.zip

Installation

  1. 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.
  2. Adjust the plugin settings if desired (see above)
  3. Start using the above template tags in your templates.

If you like this plugin, please consider making a donation:

This plugun is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5. In other words, if you use this plugin, please display a "powered by Flickr Photos" link, such as the one below:

<a href="http://mt-hacks.com/flickrphotos.html" target="_blank">Powered by Flickr Photos</a>

Update: Included with this plugin is the MT Plugin Network plugin. MT Plugin Network helps keep you up to date about new and updated plugins from MT Hacks and other plugin providers, by displaying a list of recent plugin announcements with the MT admin area. Click here to learn more.

As always, please let me know if you find any bugs, or if you have any suggestions or comments.

Rate this entry:

  • Currently 3.3/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 3.3/5 (12 votes cast). Powered by the Ajax Rating plugin.

Comments (102)

Marre:

Hi, do I need a flickr API key for this plugin?

Marre:

I'm playing with this (very useful) plugin and everything is working except the tag. The "get photo details"-function is active and commentcount works. What could be the problem?

Marre, no you don't need a flickr API key.

Regarding your problem with the MTPhotoDescription tag, I need more specifics. What exactly happens? Do you get an error or does the description simply not display? can you post the code you are using?

Anonymous:

Hi, thanks for creating useful plugin.

When I set some arguments, I got thumnails which can not be seen because width and heights are set to 0.

Please check this url and source.
ttp://www.osmc.ne.jp/list/test.php

Could you tell me what do you think is the problem?

To the person from osmmc.ne.jp, can you post the exact plugin code that you are using on that test page? It's hard to tell what is going on with all of the different groups of thumbnails on that page...

Andreas Rolfer:

Hey! I can't get this to work. When I'm trying to rebuild templates with your code, the rebuilding stops and displays following error:
Can't use an undefined value as a HASH reference at /home/[...]/cgi-bin/mt/plugins/FlickrPhotos/FlickrPhotosLib.pm line 413.
Any ideas?

Andreas,

Are you upgrading from version 0.5?

If so, this is what is causing the problem. To fix, you need to clear the cache. Simply loading the Plugin settings page should do this automatically (go Settings, then Plugins tab). If the problem persists after doing this, please let me know.

Andreas Rolfer:

Nope, this is the first time I'm using it. I installed a clean copy of MT yesterday, and your version 0.8 today.

Hmmmm. In that case, I need some more details -- what does your plugin code look like, what arguments and tags are you using? I assume you installed MT 3.2. What OS and database are you using?

Andreas Rolfer:

I was just testing with your sample-code between the body-tags in MT:s default template, but with my own flickr-name.






I installed MT 3.2 on a Unix server with Berkeley DB.

tony:

hi
please tell me how Can i add borders to the photos

Is there anywhere we can check out this plugin working, in action?

Hei i've installed the plugin yesterday and everything worked fine. But then today i made sme changes and the flickr thumbnails didn't show antmore. I reverted everything as it was before, but the images still don't appear. On the source code of the page i get a img tag attributes widht="0" height="0". The plugin settings are restored to factory default and i'm only using the basic code you provided.
I've tried to override the plugin settings with the argument size="s" but doesn't seem to work.
Any suggestions? Thanks.
ps: the page that uses this code is www.biscaclothing.com

ok, maybe i've found a workaround: now my code is the following:


">">

It seems to work as it did before (and is i wanted to).
i'm just wondering what was wrong with

Doug:

Thanks for the great plugin, but is there a way to use it in an actual entry's context as oppossed to just in layouts?

In layouts (both static or dynamic) it loads perfectly fine, but inside of entries (ie: the body is the MTFlickrPhotos username="John Smith" etc) it doesn't convert the tags.

Mark:

Doug, yes this is possible.

I do this myself, using the Process Tags plugin. This plugin enables you to use MT Template tags within your entries (including Flickr Photos tags). Works well.

Doug:

Hmm, I've got Process Tags installed, but it doesn't seem to be co-operating. I've recently upgraded to MT 3.31, so I don't know if there's an issue- it doesn't seem to be processing any MT tags. I'll keep playing around with it.

Doug:

I think this now may just be a problem with how this one blog is set up- I already had Process Tags installed (but didn't remember it), and it seems to work with one blog but not another. Thanks for the reminder about Process Tags! I should be able to hammer it out now.

Doug Author Profile Page:

First, I apologize for all the replies.

Second, things are generally okay now, but I've hit some definite oddness:

The example: http://www.dougstewart.org/gallery/hdr/

The code used is (angles changed to square brackets):
[MTFlickrPhotos username="Douglas Dollars" set="http://flickr.com/photos/douglasdollars/sets/72157594201617076/" size="med"]
[MTFlickrPhotoTitle]
[MTFlickrPhotoLink]
[MTFlickrPhotoDescription]
[/MTFlickrPhotos]

and the code is working fine for other sets, but for this one it displays one image correctly, but the URLs for the others are somehow missing my username (douglasdollars)

http://www.flickr.com/photos//164499704/in/set-72157594201617076/
instead of
http://www.flickr.com/photos/douglasdollars/164499704/in/set-72157594201617076/

Is this a bug, some Flickr goof-up, or something that I can fix on my end? All other sets seem perfectly fine.

I suppose Flickr is the best ways to share, sort , search and store the photos online. It
aims to take photo storage beyond the "album"
concept. :D

Kevnc Author Profile Page:

I'm confused - when I open the zip file there are no folders, only the files. Your instructions say to:
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.

When I upload all files to only the FlickrPhotos folder in the Plugins folder, I get errors when I try to use the plugin features.

Top notch plug-in but I believe I have a couple of bugs to report:

1) MTFlickrPhotoWidth and MTFlickrPhotoHeight do not seem to provide the correct height and width if the size of the thumbnail is amended using size="s".

2) I am displaying three images. With the first image the content of MTFlickrPhotoDescription is displayed. This isn't the case with the second and third image.

3) The first image uses the friendly version of my flickr url for MTFlickrPhotoURL. The second and third images do not.

Also, it seems odd that the username (Flickr screen name) seems to being used as I assume this isn't unique?

All the best,

--
Ian

Kevnc, the zip archive does indeed include folders (I just tested, to make sure). When you expand the zip, you may need to choose and option to use/maintain folder names. In the version of WinZip that I use, this option is called "use folder names".

Ian,

1) You are correct. Those tags won't work if the size argument is used with the MTFlickrThumb tag. There seems to be no way to get this to work (at least that I can see). I think that the using "size=" in this way should be deprecated. The reason is that you can specify the "size=" argument as part of the MTFlickrPhotos (container) tag, such as <MTFlickrPhotos username="Joe Smith" size="s" lastn="3">. I think this should meet your needs. Please let me know if this works, or if there is a need to get it to work in the actual Thumb tag.

2) I was not able to reproduce this issue. See my test page here. I am just speculating here, but I wonder if the issue is a cache problem. For example, the older photos (2 and 3) may have been cached without description, or before the description was added in Flickr. To test this theory, add refresh_details="1" to you MTFlickrPhotos tag (but don't forget to turn this off later, for perfomance reasons). Let me know if you continue to experience the issue after refreshing your cache.

3) Sounds like the same cache issue. Let me know if you continue to experience the issue after refreshing your cache.

Regarding the username comment, Flickr screen names are indeed unique.

Hi Mark,

Thanks for the reply. You're a star.

1) I've moved the size="s" to the container tag. All seems well.

2+3) You're spot on - once I refreshed the cache using your additional code, both descriptions and friendly link details appeared. Not sure why they weren't in the cache in the first place, but I'm glad they are there now.

I'm sorry but pleased that I was wrong about usernames. Thank you very much.


This rocks. But any idea how to make this baby work like a "flickr badge" ?

THe wordpress version is really rockstar looking:

http://tantannoodles.com/toolkit/wp-flickr-dhtml-badge/

Can anything like that be scraped out of this plugin?

Nick, thanks for that link. I played with it a bit and .... it works! Take a look at my test badge here. Pretty cool.

I will publish the instructions soon, and will package this into the next release as an "easy-to-install" Widget for MT.

Ben Bicais:

Hi!
Please suggest some ways to add borders to the photos so as to make them much more presentable on the site............and Flickr with added features is simply amazing!!!

Karl Author Profile Page:

I've just upgraded to MT 3.31 and I having trouble getting my Flickr thumbs to show up. Is the plugin not compatible with this version of MT yet or perhaps my coding is incorrect.

This is what I have entered in my index page:

<div class="module-archives module"> <h2 class="module-header">Flickr <div class="module-content">
<ul class="module-list">
<MTFlickrPhotos username="astromonkey" lastn="9" size="s"> &;t;MTFlickrPhotoLink><br />
<br />
</MTFlickrPhotos>
</ul>
</div>
</div>

Mark ?:

Karl,

Yes, Flickr Photos does work with MT 3.31.

Your template code looks fine. When I look at the HTML source on your home page I see that the flickr thumbs are being set to zero length and width (width="0" height="0").

There are 2 things you should try:

1. Clear your cache by temporarily altering your settings, or by temporarily adding refresh=1 and refresh_details=1 to your MTFlickrPhotos tags, then rebuild.

2. Download FlickrPhotos version 0.82, which addresses are rare case that exhibits these symptoms.

If these don't fix the problem, please let me know.

I just added Flickr Photos to a new MT install. The last few photos (.jpg format) that I had previously saved in my photostream showed up just fine. However, when I added a few new images, screenshots saved in .gif format, I got the Flickr "This photo is currently unavailable" image instead.

I think I see what's going on now; when resizing my .gif images, Flickr saves the thumbnails in .jpg format. If I look at the thumbnail on Flickr itself, it looks fine, and has a .jpg extension. The "unavailable" image shown on my weblog has a .gif extension instead. I can repost the same images converted to .jpg format to Flickr, and they show up just fine; I'll do that for now as a workaround. Am I correct in guessing that your plugin assumes that resized images use the same file extension as the original?

If I can help answer any questions, or help you with any additional troubleshooting, please let me know.

harmfulguy, thank you for this report.

I did not realize that all Flickr thumbnail images are in .jpg format. The only version they keep as the orginal file format is the "original size" version. I will make a few tweaks to the code to adjust for this.

Eric Author Profile Page:

Hi, I want to integrate this plugin with flashrelief. So I need the name of the image file. for example: sunshine.jpg Is it possible with this plugin?

Eric,

Flickr image names are weird one like "233210670_659bedb659.jpg". The current version of the plugin does not include a tag that just outputs this image filename. The <MTFlickrPhotoThumb> and <MTFlickrPhotoLink< can output a full path to the image, including the http://www.flickr.com/photos/, etc. If you need a tag that only outputs the filename portion, I can add that. A few questions: is the the filename of the thumbnail image that you need, or the file name of the linked image? I guess my question is, how the "233210670_659bedb659.jpg" be used?

Eric Author Profile Page:

Hi again and thanks for reply. In flashRelief xml file you have to write this information:
<item>
<img>image.jpg</img>
<thumb>timage.jpg</thumb>
</item>
as you see, one needs both the filename of the image and the filename of thumbnail.
I hope it is all you need to know. I really appreciate if you add this to the plugin.

Eric,

The lasted version, v0.84, has two new tags:

<FlickrPhotoThumbFileName> - thumbnail filename
<FlickrPhotoURLFileName> - linked image file name

You can get the new version here. I have not yet announced this version.

Please keep in the loop with the flashrelief integration, I woul love to see an example when you are done.

AJ Author Profile Page:

Is there any way to use the plugin to format the images taken from Flickr into tables so that instead of just a list of images it can be a CSS formated table of the images? This would make the plugin much more Template friendly...instead of just a plain list of images. Any ideas as how to do this? Thanks much...great plugin!

AJ, the plugin does support CSS styling in a few ways:

-the <MTFlickrPhotoLink> tag includes the following CSS "class" attributes. The link <a href tag has class="mt-flickr-photo-link" and the <img tag has class="mt-flickr-photo-image". You can do a lot with these styles to chnage the appearance of the photos.

-for further customization, don't use MTFlickrPhotoLink. Instead use MTFlickrPhotoThumb and MTFlickrPhotoURL (as described above) to craft your own HTML to display each photo. This could include table tags, of course. That said, the one thing that the plugin does not directly support, is an easy way to specify the "number of photos per row" of a table -- specifically, when to insert </tr> and <tr> tags.

Hi there - I'm probably asking a similar question to Doug, but not sure on implementation of MT tags within other tags.

The MT code piece below is what I want to achieve, using the tags I assign to a posting (MTTagName) to create the Flickr tag filter (

[MTFlickrPhotos username="my username" tags="[MTEntryTags glue=", "][$MTTagName$][/MTEntryTags>"] [MTFlickrPhotoLink] [/MTFlickrPhotos]


It doesn't work, so what am I doing wrong? I'm sure the quotation marks for glue = ", " are contributing to the non-functioning.
Thanks
Simon

Simon, what error are you getting? Or is is just that no photos are displayed?

Hi Mark

No error, just doesn't render the code. Works perfectly if I hard code the tags= parameter.

Simon, I should have asked this my first reply, but have you looked at the HTML source of the page? Does show nothing where the photos should be or some mangled template tag code?

Oh, and just to make sure, do you have the Expressions.pm file in /path/to/mt/extlib/MTPlugins?

Finally, have you tried this without the glue=, for an entry that has only one tag? Maybe try single quotes for the glue?

Ok, in the source I have a start and end comment line [!--flickr photos start --] etc. When I try to render the MTTagName code portion, HTML only renders the comment start and end pieces, nothing in between.

Expressions.pm is present in my extlib/MTPlugins dir.

Taking away glue= or using single quotes renders the code, but fetches all photos in my flickr account, as the tags parm isn't rendered. Specifically, a [/MTEntryTags]" ] fragment for each pic is left in the final HTML which appears on my posting as " ].

(replace all square with angle brackets).

It may be that I'm missing some basic MT template coding practice? Eg. What's with using $Tag$ sometimes eg. $MTTagName$.

Simon, I am not sure why your method doesn't work. I tested it myself, and it doesn't work.

With some help from the MT Pronet email list, I have a solution that works:

<MTSetVarBlock name="tags"><MTEntryTags glue=", "><$MTTagName$></MTEntryTags></MTSetVarBlock>

<MTFlickrPhotos username="User Name" tags="[MTGetVar name='tags']">
<MTFlickrPhotoLink>
</MTFlickrPhotos>

Cool bananas...Mark you rock.

Works perfectly, thanks for the coding help. Was wondering how to set variables, didn't even consider going to look inside the MT tags template guide.

Zoltan Author Profile Page:

Mark,

I'm using FlickrPhotos Version 0.84 with MT 3.31 and the following code,

<div class="flickrtitle">
<a href="http://www.flickr.com/groups/crixa/">crixa on flickr</a>
</div>
<div class="flickrpix">
<MTFlickrPhotoLink> <br />
<br />
</MTFlickrPhotos>
</div>

on my index page.
When I rebuild the index template, I get the following error,
"Parse error in template 'Main Index': <MTFlickrPhotos> with no </MTFlickrPhotos>"

Any ideas?

Thank You

Zoltan, I think the error message says it all.

You need to always start with a <MTFlickrPhotos> tag and end with a </MTFlickrPhotos> tag. Between these two tags, you can place other tags, such as <MTFlickrPhotoLink>.

I am not sure what you are trying to display, but if you are trying to display photos from the 'crixa' group, try this code:


<div class="flickrtitle">
<a href="http://www.flickr.com/groups/crixa/">crixa on flickr</a>
</div>
<div class="flickrpix">
<MTFlickrPhotos group="http://www.flickr.com/groups/crixa/">
<MTFlickrPhotoLink> <br />
<br />
</MTFlickrPhotos>
</div>

praca Author Profile Page:

Mark! Thanks for this code - it works:)

Brian Author Profile Page:

Hi Mark-

Great work on this plug-in - it's just what I've been looking for. I'm wondering if there is any way to override Flickr's sizes and specify the width of an image within the plug-in. I'd like Flickr Photos to display my most recently uploaded photo, and in order for it to fit into the layout of my blog, I'd like it to be, say, 250px wide, whether it's a horizontally or vertically oriented photo. I don't care that it'll be a different height depending on which way it's oriented; the width is more important. I'm wondering if there's a way to choose options other than Flickr's thumbnail, small, original, medium, etc. Thanks again for the great work.

Brian,

Unfortunately Flickr works in fixed sizes, you can't specify a custom size.

However, you could use resize the images in your HTML to fit your layout. Sometimes this results in the photos not appear quite as sharp, but sometimes it is fine. To do this, chose the Flickr size that is just bigger than the size you want. For example the Flickr "small" size is 240 pixels on the longest side, and the
"thumb" size is 100 pixels. Suppose you want to use 150 pixels wide (landscape image). The you would specify the width element of the img tag to 150, as follows:

<MTFlikrPhotos size="s" username="you">
<img src="<MTFlickrPhotoThumb>" width="150">
</MTFlickrPhotos>

(of course you would add in other tags to link the images, etc.

Brian Author Profile Page:

Mark,

Thanks a bunch - that's sort of what I figured, but your solution looks great. I'll take the jaggies any day... I'll give it a try when I get a chance. Thanks again.

FlickrPhotos (v0.84) seems to have stopped working for me.

Here's the code:

Seems simple enough, I think. Might it be that I upgraded to MT 3.34? Also, I'm running under FastCGI now.

Anonymous:

FlickrPhotos (v0.84) seems to have stopped working for me.

Here's the code:

<MTFlickrPhotos username="Donald Andrew Agarrat" tags="blogbar"><MTFlickrPhotoLink></MTFlickrPhotos>

Seems simple enough, I think. Might it be that I upgraded to MT 3.34? Also, I'm running under FastCGI now.

Great and excellent article ts realy helpful. Thanks again.

Sweet little plug-in. Is there a way to randomize the photos it displays?

For example, I want to display 5 random pictures with a specific tag in my header. I don't want just the most recent or the oldest photos with that tag.

I'm not much of a coder, so forgive me if this is easy to do and I'm just lost.

thanks!

Kevin, see my comments here about randomizing photos. Unfortunately there is no easy way...

Doh. Oh well, I understand why that would be difficult.

At least you give us plenty of control over what pictures to pick, so I went ahead and used a Flickr photo set to do my header. It's not random, but at least I can pick which pictures make it into the header.

Very slick plug-in. Thanks!

Looks sharp, Kevin.

If you are prepared to get a little creative with it, you could do random photos by combined this plugin with the Random Line plugin. Basically, you would create an index template with only a Flickr Photos tag to output a long list of image thumbnails, one per line. Then use RandomLine to randomly choose a defined number of photos from the list. Should be pretty easy. The only tricky part would be periodically rebuilding the thumbnail index. If you have a lot of photos in it, you want to uncheck the "rebuild with indexes" box to avoid slowing things down too much. You could manually rebuild it from time to time to capture the newest photos in your Flickr photostream. (Note: the RandomLine plugin will randomize the photos everytime that tag is built. So if you use it in your header, each of your pages will have a different set photos in the header, which will be changed on each rebuild of those pages. The only purpose for rebuilding the thumbnail index to update the "master list" of photos available for display).

Hi--I've got this plugin installed and when I use the code it seems to be omitting the file extension. For example, this is the IMG tag that the plugin is writing:

As you can see, it's not writing the "jpg" extension. Any ideas why this is happening? I'm not sure if this has anything to do with it, but I just converted my old sk00L account to the Yahoo! ID. I'm using this code on another site with a different flickr ID that was originally set up as a Yahoo! ID and everything seems to be working fine.

Any thoughts?

haven:

Sorry, here it is without the tag enclosures
---------
Hi--I've got this plugin installed and when I use the code it seems to be omitting the file extension. For example, this is the IMG tag that the plugin is writing:

img src="http://static.flickr.com/186/401104071_b942f92f57_s." width="75" height="75" alt="Multimedia message" border="0" class="mt-flickr-photo-image" /

As you can see, it's not writing the "jpg" extension. Any ideas why this is happening? I'm not sure if this has anything to do with it, but I just converted my old sk00L account to the Yahoo! ID. I'm using this code on another site with a different flickr ID that was originally set up as a Yahoo! ID and everything seems to be working fine.

Any thoughts?

I feel like I've seen this question answered somewhere, but I can't seem to find it. Does the FlickrPhotos plugin work with dynamic pages?

htanks

Kevin,

No, the current version of Flickr Photos tags can not be used on MT Dynamic pages.

haven:

I'm definitely using static, not dynamic. I even have the plugin working fine on another blog in my system. Any other ideas on how I can fix it?

Thanks

haven, what version of Flickr Photos do you have installed? Make sure your have 0.84 installed.

Also, what template code are you using when this error occurs, <MTFlickrPhotoLink> or <MTFlickrPhotoThumb>?

Can you post a link to one of your pages with the broken image link?

Also, be sure to clear your photo caches, before you test and rebuild your files (sometimes temporary problems get cached and flushing the cache forces the plugin to fetch fresh data from Flickr, which may help)

haven:

Thanks Mark

Looks like I had .81 installed. Once I upgraded to .84, it started working again.

Thanks for the help--much appreciated.

Haven

Is there a way to alter the html generated by the plugin?

What html?

If you are referring to the HTML generated by the <MTFlickrPhotoLink> tag, then yes, you can do so by using the other tags to created the photo link. See descriptions above for the <MTFlickrPhotoURL> and <MTFlickrPhotoThumb> and other tags.

Months late, but if you want your MTFlickrPhotos images to be a specific size, you are best off adjusting them to that size before you upload to Flickr, and then use the "original" size.

Fabian Author Profile Page:

Greetings, I am getting "Flickr request failed: API returned a non-200 status code" all of the sudden. This plugin has been working fine for me for over a year and I've changed nothing. Has Flickr changed their API interface to require and API key?

Hi Fabian,

I got that same error a few days ago. It seemed like Flickr had a temporary outage in their API. I tried again an hour later and it worked fine.

Mark

My pages weren't validating and I thought it might be the plugin, but it was something else. Thanks.

Also the plugin stopped working in MT 3.35.

Thank you for this awesome plugin.

Oh nevermind. I disabled it then re-enabled it and everything is working again. Sorry. :D

Mike Author Profile Page:

Hi Mark,

Sweet Plugin. I'm trying to get more than one column as simply as possible... Do you have any code for doing that? I saw you had an example with about 6+ rows and colums.

Maybe there's a way to make a table.. and have the first columm with something like <lastn="1-10">, a second column with <lastn="11-20"> etc... :roll:

Mike,

My example is a bit of a trick: its not a table at all. Take a look at the HTML source and you will see that it just looks like a table. You can use CSS styles to further achieve the table look, adding padding, etc.

FYI, attempting to install this via the Plugin Manager plugin, I received this error in MT:

"Error adding plugin: Insertion test failed on SQL error Column 'pluginmanager_config' cannot be null"

I'm on MT 3.34, using the 1.05 version of Plugin Manager.

Thanks for the PM feedback, Curtis. As I said above in my entry, Plugin Manager support has not been tested. Once of these days, I will get around to trying it again. The next version of MT is going to come bundled with a new version of Plugin Manager, so I will definitely try to support that version.

I also hope to find time to finish the next version of Flickr Photos... ;)

I'm using the following code on my index page but nothing seems to be showing up. Is my code off?

Flickr


Anonymous:

I'm using the following code on my index page but nothing seems to be showing up. Is my code off?

[div class="module-archives module"] [h2 class="module-header">Flickr [div class="module-content"]
[ul class="module-list"]
[MTFlickrPhotos username="myusernameishere"]
[MTFlickrPhotoLink] [br /]
[br /]
[/MTFlickrPhotos]
[/ul]
[/div]

So I got this code to work, but only with Firefox. IE7 shows just a blank section, however if you look at the source of the page with IE7, you will see the correct flickr code. Any thoughts?

[div class="module-archives module"]
[h2 class="module-header"][div class="module-content"][/h2]
[center]
[ul class="module-list"]
[MTFlickrPhotos username="farmdwg" size="s"]
[MTFlickrPhotoLink] [br /]
[br /]
[/MTFlickrPhotos]
[/ul]
[/center]
[/div]
[/div]

Thanks.

Shawn, the key thing you are missing are <li> and </li> tags inside the MTFlickrPhotos tag. You shoudl use these instead of the &;lt;br /> tags:

<MTFlickrPhotos username="farmdwg" size="s">
<li><MTFlickrPhotoLink></li>
$lt;/MTFlickrPhotos>

That said, the plugin comes with a Widget (template module) that includes exactly the code you want here, so it is easily to use that widget, or include the module:

<MTInclude module="Widget: FlickrPhotos">

Hey there Mark, awesome plugin!

Are there any plans to make it MT 4.0 compatible?

Cheers.

Marce, yes, I paln on updating it for MT4. I will probably add a bunch of new features at the same time.

Hi, I'm using a fresh copy of .84 with a new installation of MT 4 and the 'process tags' plugin in order to make a photoblog of sets. I'm trying to backdate entries to when the sets were taken. I'm not sure if it's having problems with the process tags portion or the backdating, but using this is causing the publishing of each entry to time out and give a blank page. Occasionally the entry won't publish at all and gives a 404 not found until I keep republishing it or the site. It's making this a painstakingly slow process! Posts not backdated or using the plugin are publishing instantly and just fine. My first two posts (the top two) also published fine using the same MTPhotos syntax, so maybe it is the backdating that's having a problem. Site rebuilds timeout and throw a blank page.

I'm new to MT 4 and its templating system (I'm a WordPress user normally). Is there an ideal place to put the process tags=1? Has this plugin been tested with MT4? I went to Design - Templates - Template Modules - Entry Detail and added it to the MTIfNonEmpty tag="EntryBody" process_tags="1" which probably wasn't ideal, eh?

89:

thanx

Muhabbet, islami sohbet, dini sohbet

ahmet:

thanks.. ;)
89
youtube

89:

www.89iz.com
www.pornizle.net

muhabbet, muhabbet odaları

msn nickleri,şekilli nickler

giyotin,korku,giyotinnet,korku videoları

korku,korku videoları,korku sitesi,giyotin,giyotinnet

anahtarci,cilingir

chat:

chat, muhabbet, sohbet, hosbes, haber

pc:

pc, bilgisayar,pc program, anti virus,pc al, plazma tv, lcd tv, anakart, format, internet, pc topla, teknik destek, püf noktaları, işlemci, ekran kartı, inceleme, ram, elektronik, internet

sohbetiniz style thanks a lot.

mirc:

Thanks a lot..

I installed the plugin in my MT 4 but there's no widget created and I keep getting an error message. Plus, I'm unsure about where the mtplugin.pkg file should be (this is my first time installing a plugin so I'm pretty much in the dark). Is this supposed to work with MT 4 too?

Post a comment