I'm using phpflickr to retrieve images from Flickr. For some reason photosets_getPhotos doesn't contain the image descriptions and photos_getInfo has to be used instead. However, when I do it slows everything right down.
Here is a function I've made to retrieve an image set and display it in a prettyPhoto list.
function flickrGallery($setId,$ulClass,$prettyPhotoGroup){
$f = new phpFlickr('KEY','SECRET',false); // API
$user = "USERID";
$photoset_id = $setId;
$photos = $f->photosets_getPhotos($photoset_id);
echo "<ul class=\"$ulClass\">\n";
foreach ($photos['photoset']['photo'] as $photo){
$getInfo = $f->photos_getInfo($photo['id']);
$description = $getInfo['photo']['description'];
$urlOrig = $f->buildPhotoURL($photo, "small");
$urlHex = strToHex($urlOrig);
$fullsize = $f->buildPhotoURL($photo, "large");
echo "<li>"
."<a href=\"$fullsize\" rel=\"prettyPhoto[$prettyPhotoGroup]\" title=\"".$description."</pre>\">"
."<img src=\"/thumb/external$urlHex/120/86\" width=\"120\" height=\"80\" class=\"borderoff\" alt=\"".$photo['title']."\" />"
."</a>"
."</li>\n";
}
echo "</ul>\n";
}
Is there a way I can speed things up or an alternative method for getting the image descriptions?
Unfortunately the API doesn't have any other calls to grab the description.
As an alternative, could you write more descriptive Titles for your photos and display the Title field instead of the Description field?
I would've left this as a comment but I haven't gained that privilege in Stack Overflow yet :(