the Forum

ee-hive’s Flickr Plugin for Expression Engine 1.x

Posted on June 22, 2011 by Michael Rosario
Total Posts: 33  |  Join date: 03-12-11

I just wanted to share the following file: eehive_flickr.zip This is the fieldType developed by Brett DeWoody. I updated it to work for Expression Engine running 1.x, FF Matrix, and field frame. It works great for EE1 and flickr - providing your ID, Secret and Flickr API code. A quick set of tags that you can use:
{field_name size="square"} - Allows you to specify the size of the image, with the options square, thumb, small, or large.
{field_name:title}- Display's the photo's title
{field_name:description} - displays the photo's description
{field_name:pagelink} - displays the photo's page URL in flickr It's useful in that I can assign 1 photo to a field or multiple photos via FF Matrix. However, what I really needed was a way to pull sets only. So i revised the Fieldtype eehive_flickr_updated.zip
Install by adding to /system/extensions/fieldtypes directory. With this, you choose a Set, then the Cover. I added the following commands in addition to the original above:
{field_name:setTitle} - returns the name of the Set
{field_name:setID} - returns the ID of the Set With the setID, I use the following Jquery snippet to output the images:
$(document).ready(function() {
  
$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api;_key={api_key}&photoset;_id={news-gallery:setID}&extras=original_format&format=json&jsoncallback;=?"
   function(
data){
       
var nmbr 1;
    $.
each(data.photoset.photo, function(i,item){
     
var photo 'http://farm' item.farm '.static.flickr.com/' item.server '/' item.id '_' item.secret '_s.jpg';
     var 
lg_photo 'http://farm' item.farm '.static.flickr.com/' item.server '/' item.id '_' item.secret '_z.jpg';
     var 
html "<li class='images'><a rel='gallery'  title='' href='#viewer"+nmbr+"'><img src='/images/image.gif' alt='"+lg_photo+"' /></a></li>";
     var 
galhtml  "<img id='viewer"+nmbr+"' src='"+lg_photo+"' />";
     
nmbr++;
      $(
"#Gallery").append(galhtml);
      $(
"#images").append(html);
     
});
     $(
"a[rel=gallery]").fancybox(
       
'hideOnContentClick' 'true'
       
'centerOnScroll':'true',
       
'scrolling':'no',
       
'titleShow':false
       
'onComplete': function() 
          
$("#fancybox-img").bind("contextmenu",function(e){
                 
return false
                 
}); 
              
}}); 
            return 
false;
            
});
         
});
         

<!-- 
NOTEimage.gif is a transpant 1px X 1px image -->
<!-- 
prevent right clicking and saving of photos -->

<
div id="Gallery" ></div>
<!-- 
Placeholder for images -->

<
ul id="images"></ul>
<!-- 
Placeholder for thumbnails --> 

Tags: There are no tags for this entry.

There are no answers yet.  Add yours below.

add your answers here
comments powered by Disqus