Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » a recipe for FlickrService on 2.3.1

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2632 Views
  • Bruce B
    Avatar
    Community Member
    145 Posts

    a recipe for FlickrService on 2.3.1 Link to this post

    I finally have FlickrService and a FlickrGallery page running under 2.3.1. Here are all the various steps:

    Fix compile error
    Change line 159 in FlickrService.php according to Ticket #3719

    Bypass CMS javascript error
    On my system, FlickrGallery_CMS.js causes the wrong fields to be hidden, making the CMS for FlickrGallery unusable.
    I commented out line 25 in FlickrGallery.php:

    //     Requirements::javascript( 'flickrservice/javascript/FlickrGallery_CMS.js' );

    tagged images returned with Username selection
    If there is an entry in the tags field in the CMS, all tagged photos will be returned along with the user's photos in 'Photos taken by' is chosen.
    FlickrGallery.php line 48 changed to:

    $photos = $flickr->getPhotos(NULL, $this->User, $this->NumberToShow, $page, $this->Sortby);

    Wrong link back to Flickr page
    In the Lightwindow popup, there is a link back to the Flickr page. This doesn't work if we have a user's photos or photoset displayed
    In FlickrService.php line 81 is replaced by the following 2 lines:

    $pageUrluser_ID = $user_id == "" ? "" : $this->User($user_id);
    $results->addImagePageUrl($results->PhotoItems, $pageUrluser_ID); //gets individual image page url


    and line 143 is replaced by these 2 lines:

    $pageUrluser_ID = $user == "" ? "" : $this->User($user);
    $results->addImagePageUrl($results->PhotoItems, $pageUrluser_ID); //gets individual image page url

    (note these line numbers may no be exact because of multiple edits to this file)

    Lightwindow popups don't work
    The standard prototype.js and behaviour.js are conflicting with Lightwindow.

    Block them from loading by adding the following immediately above
    parent::init();
    near the end of FlickrGallery.php

    Requirements::block('jsparty/prototype.js');
    Requirements::block('jsparty/behaviour.js');
    Requirements::block('jsparty/prototype_improvements.js');

    Lightwindow popup isn't centred
    apply the patch in Ticket #3512 to Lightwindow.js

  • Matt Howard
    Avatar
    Community Member
    3 Posts

    Re: a recipe for FlickrService on 2.3.1 Link to this post

    Bruce,

    This help to the community came just at the right moment for me!

    Were you able with these fixes to retrieve images from your flickr account by user name? I have been unable to and wondered if you had a hunch about where to start. All I'm getting is "( Photos)".

    Thanks!

    -Matt

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: a recipe for FlickrService on 2.3.1 Link to this post

    Matt, Are you still there? I have an answer for your problem, maybe.

    FlickrService.php calls RestfulServer.php using a depreciated method. This causes problems if Flickr is inaccessible. We also don't get error messages from Flickr. I have attached two files - FlickrService.php and FlickrGallery.php to address these error handling problems. Replacing these two files in the standard install should give you a functional FlickrGallery in 2.3.1. The only additional requirement is to modify lightwindow.js to fix the ie bug.

    With the new files installed, Flickr error messages should be visible on the dev site and to users logged in as administrators.

    The code all works but I'm not sure if its up to official SS standards. I haven't ventured into actually uploading my patches to the subversion database.

  • g4m3c4ck
    Avatar
    Community Member
    11 Posts

    Re: a recipe for FlickrService on 2.3.1 Link to this post

    Wow this took all day to figure out for me for various reasons. The main reason it didn't work is because php5-curl was not installed on my server. The files Bruce B contributed were a big help but the annoying Warning still appears. I am going to look into it but I may lack the skills to fix it. I could only get the desired output I wanted by using the "Photos taken by" option. Seems changes to the Flickr API may have broken the other options. I Hope this helps people.

    Also the Close button gets clipped so I found this one to replace it http://www.paulschroeder.co.uk/images/closelabel.gif

  • dconel
    Avatar
    Community Member
    21 Posts

    Re: a recipe for FlickrService on 2.3.1 Link to this post

    The only thing that i'm still missing are the "previous" and the "next" buttons. I have tried everything, but it will not work..

    Edit: in the lightwindow i mean..

    2632 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.