Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Photo gallery client can add to?

Featured Replies

I have updated a website for someone, which was made 5 years ago so it's done in html 4 and with tables! They didn't want it redesigned from scratch. However, now they want a gallery added that they can upload photos to. I've done a search but can't find any suitable answers. I was thinking of maybe using flickr or similar. They might want to add titles and description to the photos as well.

 

I'm assuming I can create the gallery in xhtml even though the rest will be html 4?

 

What's the best way to do this though?

http://www.flabell.com/

 

wen you install all the files to the ftp there`ll be a page called:

ssb_embedcodegenerator.html

open that in dreamweaver <DO NOT EDIT THE PAGE> click preview and then when the webpage opens up choose which slideshow you want to use and copy the code :)

You can use Dynamic Flash for gallery. Your customer will have an opportunity to upload photos or images by yourself.

  • Author

Awesome, works a treat thanks for that :) I had googled before posting but wanted something that had been tried and tested.

  • 2 weeks later...
  • Author

I'm really liking this lightbox and flickr gallery, works great. Got 1 small problem though with the size of the image.

 

When you put the size in as medium it displays it at 500 pixels along the longest edge. I would like it displayed at 640 pixels, which is medium 640 and uses a prefix of z. I've tried 'medium640' and 'z' but neither of them work...what do I need to use?

 

It goes in this bit of code where it has medium. Also does anyone know how I can get the description to show along with the title?

 

   <a rel="lightbox[]"
    href="<?= $f->buildPhotoURL($photo, 'Medium') ?>"
    title="<?= $photo['title'] ?>">

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().

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.

  • Author

Adam, thanks for the reply :)

 

I've just had a look in the phpFlickr.php file and there is already a reference to the medium 640 size, it is medium_640. I have changed the size to this and it works fine. I don't think Flickr uses the original size any more as I also tried it but it returned an error saying it couldn't find any photos.

 

I will read the comments on your guide for adding the description and see if it works.

  • Author

Just tried changing $photo['title'] to $photo['description'] and it doesn't work. Nothing displays even though there is definitely a description for the photo in Flickr.

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.

  • Author

I downloaded the file from the link in your tutorial so that's up to date then...maybe a list of what text to put in to generate the sizes would be useful?

 

I'll keep an eye on the thread then, re the descriptions :)

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!

Edited by Adam Bate

  • Author

Works a treat Adam :)

 

It takes a few seconds to load the sets but it's not too long.

Edited by Pezza4u

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.