Show
Ignore:
Timestamp:
05/08/05 04:28:27 (4 years ago)
Author:
ogawa
Message:

Change the behavior of "size" option for MTFlickrPublicPhotoImgURL.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FlickrPublicPhotos/trunk/FlickrPublicPhotos.pl

    r65 r67  
    11# A plugin for adding "FlickrPublicPhotos" container and related tags 
    22# 
    3 # Release 0.12 (May 7, 2005) 
     3# Release 0.13 (May 8, 2005) 
    44# 
    55# This software is provided as-is. You may use it for commercial or  
     
    1616    $plugin = new MT::Plugin(); 
    1717    $plugin->name("FlickrPublicPhotos Plugin"); 
    18     $plugin->description("Add FlickrPublicPhotos container and related tags. Version 0.12"); 
     18    $plugin->description("Add FlickrPublicPhotos container and related tags. Version 0.13"); 
    1919    $plugin->doc_link("http://as-is.net/hacks/2005/05/flickrpublicphotos_plugin.html"); 
    2020    MT->add_plugin($plugin); 
     
    111111} 
    112112 
     113{ 
     114my %sizes = ( 
     115    sq => '_s', 
     116    t => '_t', 
     117    s => '_m', 
     118    m => '', 
     119    l => '_b', 
     120    o => '_o', 
     121    square => '_s', 
     122    thumbnail => '_t', 
     123    small => '_m', 
     124    medium => '', 
     125    large => '_b', 
     126    original => '_o', 
     127); 
    113128sub img_url { 
    114129    my $this = shift; 
    115130    my ($size) = @_; 
    116     $size ||= 't'; 
    117     my $url = 'http://photos' . $this->{server} . '.flickr.com/' . $this->{id} . '_' . $this->{secret} . '_' . $size . '.jpg'; 
     131    $size = $sizes{(lc $size) || 't'}; 
     132    my $url = 'http://photos' . $this->{server} . '.flickr.com/' . $this->{id} . '_' . $this->{secret} . $size . '.jpg'; 
    118133    $url; 
     134} 
    119135} 
    120136