-
-
Photo gallery client can add to?
Hey Pezza4u, Yeah, my install was a little out dated. I had some time this morning to take a closer look on a fresh install. I have added a list of available sizes to the tutorial - thanks for the tip. I have also put up a solution for displaying the description. Here is the code you'll need: <div id="gallery"> <?php foreach ($ph_sets['photoset'] as $ph_set): ?> <div class="photosets"> <p><h2><?php print $ph_set['title']; ?></h2></p> <?php $photoset_id = $ph_set['id']; $photos = $f->photosets_getPhotos($photoset_id); foreach ($photos['photoset']['photo'] as $photo): $d = $f->photos_getInfo($photo['id']); ?> <div class="photos"> <a rel="lightbox[]" href="<?= $f->buildPhotoURL($photo, 'medium') ?>" title="<?= $d['photo']['description'] ?>"> <img src="<?= $f->buildPhotoURL($photo, 'square') ?>" alt="<?= $photo['title'] ?>" title="<?= $photo['title'] ?>" /> </a> </div> <?php endforeach; ?> </div> <?php endforeach; ?> </div> The changes include the addition of the line, "$d = $f->photos_getInfo($photo['id']);" as well as changing the title attribute in the <a> tag to $d['photo']['description']. As I mentioned on the tutorial, it's a little inefficient due to having to lookup the description for every photo (needs to be done in the loop) so it might slow down load time of your site. Unfortunately there does not seem to be a way to grab this info for the entire photoset outside of the loop. Once they implement this (or I figure out that there is a way) I'll make the necessary changes. Hope this helps!
-
Photo gallery client can add to?
Hey, yeah it looks like I'm using an old version of phpFlickr - I wrote that tutorial in 2009 I thought this might happen - it's because the function doesn't retrieve the description within the API. I won't have time to look at this until tomorrow but should have something to you by tomorrow night. It's definitely doable, you just have to use flickr.photos.getinfo() instead as this seems to return the description.
-
-
Photo gallery client can add to?
Just figured out the medium size issue. I didn't realize there were 2 "medium" sizes according to flickr, a 500 and a 640. I noticed the 640 as you said is the one with _z on the end. This is what you'll need to do: Edit the phpFlickr.php file and find the following lines: function buildPhotoURL ($photo, $size = "Medium") { //receives an array (can use the individual photo data returned //from an API call) and returns a URL (doesn't mean that the //file size exists) $sizes = array( "square" => "_s", "thumbnail" => "_t", "small" => "_m", "medium" => "", "large" => "_b", "original" => "_o" ); You have two options. If you want all 'medium' results to be the 640 instead of the 500, simply change this line: "medium" => "", to: "medium" => "_z", Alternatively, you can try to add another line altogether, such as this: "med640" => "_z", Not sure the the latter will work as I didn't check the rest of the file, but I'm assuming it will. I didn't test this on a gallery, but I'm 99% sure it'll work. Cheers. Adam.
-
Photo gallery client can add to?
Hey Pezza4u, Glad you enjoyed the tutorial and I hope it helped. The phpflickr API is able to grab the following sizes: 'square' (which we used to display the small images on the page), 'thumbnail', 'small', 'medium', 'large', and 'original'. Perhaps try replacing the 'medium' with 'large' to see if it gives you the size that you need. Unfortunately it does not grab anything other than the above list, as far as I know anyway. Also, I'm not sure if you commented on the post, but I replied with an idea for the description one of my most recent comments - let me know if this does/does not work and I can give you the alternative using getInfo().