Skip to content


phpFlickr 2.3.0.1

I've put up a new version of phpFlickr to include all API methods and new arguments for existing methods.  Below, I've posted a list of all of the methods that have changed.  Both the input and output may have changed, so if your app uses one of these methods, be sure that upgrading to this won't totally break it.  If you don't need any of the new methods or arguments, you probably don't need to upgrade to this version.

I've decided to stop using SourceForge for file releases because of their awful interface for creating and uploading file releases.  I will now be using Google Code for file releases and forum.

Download 2.3.0.1

phpFlickr on Google Code

Updated Methods

  • favorites_getList
  • favorites_getPublicList
  • groups_getInfo
  • people_getPublicPhotos
  • photos_getNotInSet
  • photos_getUntagged
  • photos_recentlyUpdated
  • photos_setSafetyLevel
  • photos_comments_getList
  • photos_geo_setPerms
  • photosets_getPhotos
  • tags_getListUserRaw

Posted in Releases.

Tagged with , .


21 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Brendan Falkowski says

    Thanks for the update! Any chance at getting the new "flickr.machinetags" methods?

    ReplyReply
  2. Dan says

    @Brendan Falkowski: All of the current methods in the API are supported in this release of phpFlickr. The methods I listed above are only existing methods that have changed because of new arguments in the Flickr API.

    ReplyReply
  3. Steve says

    Dan, is there a reason that "photosets_getPhotos" is no longer requested and parsed, but merely called and returned?

    ReplyReply
  4. Dan says

    @Steve: Yes. That method's arguments changed at Flickr at some point, so I had to redo it anyway. Using the "call" method of phpFlickr, you get a more pure response back, based on the output of the Flickr API. This is true of all of the methods listed in the post above. In the future most of the other methods will probably move to using this as well.

    If the 2.2 version of the library was working fine and you didn't need any of the newer methods, you won't need to upgrade.

    ReplyReply
  5. Steve says

    I think I understand, but it looks to me like phpFlickr's "call" method is just a clean encapsulation of "request + parsedResponse"… so I'm not sure why the output would be different.

    Oh wait… it looks like the older way shaves the singleton root node(s) off the XML tree… and call returns it from Flickr as-is. I got it… :-)

    Stellar work, BTW.

    ReplyReply
  6. mistake says

    Hi Dan!
    Having used your great phpflickr just for putting my favorites randomized on my blog, I'm not getting this function to work again after upgrading from 2.2.0 to 2.3.0.1.
    It seemed to me as if a simple "$favorites = $f->favorites_getPublicList('64805883@N00');" should work, but it returns just an empty array.
    Do you have any hint what I have to change?

    ReplyReply
  7. Dan says

    @mistake: If you do a print_r() on the result, you should see that all of the data is still there, but it's wrapped inside the $favorites['photos']['photo'] array.

    ReplyReply
  8. mistake says

    :)
    Knowing what to do it's always very easy – thank you very much!!!

    ReplyReply
  9. Eduardo says

    Hi Dan, thank you for this class. It certainly helps a lot! I´ve been testing and it works nice for displaying photos. Now I´m trying to upload photos but I don´t get it to work. I did Flickr authentication and got the token, but when I try to upload the file it´s not working. I must be missing something. I´m doing:

    $f->setToken($token);
    $f->sync_upload($file_name);

    Am I missing something? Can you give me a hint on how to use it correctly? Thanks,
    e!

    ReplyReply
    • Dan says

      That should work if you have a valid token with write permissions. Use auth_checkToken() to make sure it's all good. Also, you might try setting the third parameter in the phpFlickr() constructor to true. That will make it spit out any errors it comes across.

      ReplyReply
  10. Brad Bonkoski says

    One note, so others don't get stuck for a bit like myself.
    With the id's getting to be huge internally to Flickr it would be wise to pass the id's as strings, otherwise the 32 bit machines will put them into scientific notation… caused me some head scratching…

    Also, are there plans for phpdocs or something similar for this? I would probably be able to contribute some of my "spare" time if needed.

    ReplyReply
    • Dan says

      Brad, I would like to get phpdocs at some point. I'm focusing a lot on other stuff right now, though. And you're totally right about the ids being too long for ints.

      ReplyReply
  11. Stephen Melrose says

    I just wanted to say a thank you. I needed a quick and easy way to grab data from the flickr API and yours did just the trick.

    Out of interest, will be creating a new version one day that is more strict with the data, e.g. return objects from methods, not arrays, etc?

    ReplyReply
    • Dan says

      >I just wanted to say a thank you. I needed a quick and easy way to grab data from the flickr API and yours did just the trick.

      You're welcome! I'm glad it is useful.

      >Out of interest, will be creating a new version one day that is more strict with the data, e.g. return objects from methods, not arrays, etc?

      I've thought about it. I might come out with something that uses the existing class as a data access backend with the objects built ontop of it.

      ReplyReply
  12. Darfuria says

    Hi Dan.

    I'm using the following code:

    $photos = $f->photosets_getPhotos($setid);
    if(!empty($photos))
    {
    foreach($photos['photo'] as $photo)
    {
    $photoURL = 'buildPhotoURL($floto, "original") . '">';
    echo $photoURL;
    }
    }

    and I'm getting this error:

    Warning: Invalid argument supplied for foreach()

    I've seen others having this issue. Annoyingly when searching for PHP errors on Google, on tends to stumble upon a lot of websites that are having that issue, rather than discussions for possible resolutions…

    If I change the code to something like:

    foreach($photos as $photo)
    {
    $floto = $photo['photo'];
    $photoURL = 'buildPhotoURL($floto, "original") . '">';
    echo $photoURL;
    }

    Then my output is

    Any suggestions?

    ReplyReply
    • Dan says

      In this exact post, you'll see that the output of this method has changed to bring it more in line with the actual results of the API call. What do you get when you run print_r($photos)?

      ReplyReply
  13. Darfuria says

    This is my output for print_r($photos);

    http://pastebin.com/m584adbe3

    ReplyReply
    • Dan says

      Based on that output, you should be able to figure out what you need to use in your foreach loop.

      ReplyReply
  14. Darfuria says

    Well, dispite trying, I've not been able to do that, hence commenting here =/

    ReplyReply
    • Stephen Melrose says

      $photos = $f->photosets_getPhotos($setid);
      if(!empty($photos))
      {
      foreach($photos['photoset']['photo'] as $photo)
      {
      $photoURL = 'buildPhotoURL($photo, "original") . '">';
      echo $photoURL;
      }
      }

      ReplyReply
  15. seccanj says

    Thanks a lot Dan for this class, it's been very useful for me!!!

    ReplyReply



Some HTML is OK

or, reply to this post via trackback.