Bug fix: photos_getNotInSet()

Posted on Saturday 6 August 2005

All versions up through 1.3.1 have had a bug in photos_getNotInSet(). If a call is made while there is only one photo not in a set, the array structure of the result won't be quite the same. This is because of the way that the xml parser arranges things. If this is a concern, replace the entire function (starting on line 596 in phpFlickr.php) with the code below. I've fixed the problem in CVS and the next update will have the correct code.

    function photos_getNotInSet($extras = NULL, $per_page = NULL, $page = NULL)
    {
        
/* http://www.flickr.com/services/api/flickr.photos.getNotInSet.html */
        
if (is_array($extras)) {
            
$extras = implode(",", $extras);
        }
        
$this->request("flickr.photos.getNotInSet", array("extras"=>$extras, "per_page"=>$per_page, "page"=>$page));
        
$this->parse_response();
        
$result = $this->parsed_response['rsp']["photos"];
        if (!empty(
$result['photo']['id'])) {
            
$tmp = $result['photo'];
            unset(
$result['photo']);
            
$result['photo'][] = $tmp;
        }
        return
$result;
    }


1 Comment for 'Bug fix: photos_getNotInSet()'

  1.  
    August 10, 2005 | 3:00 pm
     
    Hi! Greate work! I did my photolog using the phpFlickr here. Can I send you the PHP file? (if u wanna post as an example :D) Cya!

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI