Jump to content

Lightbox functionality in a photo library type project


BarneyJoe

Recommended Posts

Just looking for a heads up on how complicated this might be, the best way to go about it really.

At the moment we have a photo library app just about up and running, the main objective being that photo's along with various text fields can be uploaded to a local server, and be searched on using a combination of text seach fields and checkboxes for keywords.

There is also a users table, as much as anything to limit who could upload / edit photos etc, and also to limit who can add new keywords or users.

The way I see it in my head is for users to be able to save their own lightboxes of photos. So if they were logged on, and were looking for a selection of photos, as they found photos, they could select them, with a checkbox, carry on searching, and select any more. Then they could then view their lightbox, review the ones they'd found all together, before deciding what photo or photos they wanted to use.

If that makes sense, and anyone could point me in the right direction to achieve that it would be appreciated.

Cheers.
create a table called stored_lightboxes, and in that table store the user id, and the image id that they have added to their lightbox. You could store additional information as you see fit, but by having a table that links 2 id's you can run a query along the lines of.

[code]$query="SELECT * FROM stored_lightboxes WHERE user_id='$user_id'";
$result=mysql_query($query);
while($row=mysql_fetch_assoc($result)){
$stored_lb[]=$row['image_id'];
}//endwhile

foreach($stored_lb as $value){
$query="SELECT * FROM images_table WHERE image_id='$value';
$result=mysql_query($query);
while($row=mysql_fetch_assoc($result)){

// display, link or otherwise do what you want with the images this returns

}//endwhile
}//endforeach[/code]

Hope this helps, although I have never done this kind of thing, I imagine a stored shopping cart/wish list kind of thing would be the same principle.

Nate
That makes sense - but I'm a little unsure as to how to get the records into that table?

At the moment I have a results page - would it be best to have an 'add to lightbox' link, or a checkbox for each record, with a button that added all the selected ones to the lightbox?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.