Friday, July 24, 2009

phpFlickr - return 'extras' array from favorites_getPublicList()

I figured this might help someone because as of using one of Flickr's php API class (phpFlickr class, 2.3.0.1), I wanted to fetch extra data from favorites_getPublicList() through the 'extras' argument but the class returned nothing. Of course, this is not a major issue, and Dan Cloutier already made a great job at putting this class together, but just in case you want to get these variables, here's how I did it.

  1. Open phpFlickr.php
  2. Go to line #664 or so if you have version 2.3.0.1, or simply find (ctrl+F) by "favorites_getPublicList"
  3. After the function open brackets, before the return values, insert the following:
    if(is_array($extras)) $extras = implode(",", $extras);
  4. Save File and have fun.
Hope this helps.