Jump to content

Photo Gallery


ded

Recommended Posts

Is it difficult to create a photo gallery using php?

 

I want to allow a site admin to create folders and load/edit/delete images to each folder with a description. 

 

Is this possible with php and sql or should I just use a free gallery from somewhere?

 

Thanks,

DED

Link to comment
Share on other sites

Thank you.....I would call myself a moderate php programmer.  Still learning as I move forward.  I will search for some code ideas to create the gallery.

 

Thanks again,

DED

Link to comment
Share on other sites

I've created small galleries for members of one of my clients. Users have the ability to upload the desired photos which are stored in a special folder and automatically renamed using the member's user id plus an additional letter progressing from A to Z. This allows uploaded photos to be stored where ever I want and are easily referenced using the member's id plus the identifying character. Since the naming begins with the letter A, I can do a file_exist check to determine exactly how many photos the member currently has posted. I use this information to help set up the display outlay. I hope this helps.

Link to comment
Share on other sites

Ya there are plenty of tutorials/scripts for this, just google it. It's actually a nice little add-on to any website.

 

Question for anyone that deals with uploading photos..

 

Do you guys store the images in a database (longblob), or in a folder, for later accessibility?

 

And which is better for both: space efficiency / loading time?

Link to comment
Share on other sites

Do you guys store the images in a database (longblob), or in a folder, for later accessibility?

 

Both. Store the path to the file in the database along with who posted it, the description, and any other things you need. This way you can very easily get what you need and have easy access to any information you want.

Link to comment
Share on other sites

I don't store it at all. In the upload process I rename the file to fit an expected pattern based on the member's id. Then I can recall the photo anytime I desire automatically knowing the name of whichever photo I need for whichever member.

Link to comment
Share on other sites

I don't store it at all. In the upload process I rename the file to fit an expected pattern based on the member's id. Then I can recall the photo anytime I desire automatically knowing the name of whichever photo I need for whichever member.

 

Thats a pretty big hassle, it also makes it difficult to search very well...especially if you need multiple photos. If you have access to a database, why not use it? It makes life so much easier.

Link to comment
Share on other sites

I don't store it at all. In the upload process I rename the file to fit an expected pattern based on the member's id. Then I can recall the photo anytime I desire automatically knowing the name of whichever photo I need for whichever member.

 

That's like poco said, WAY too much work. I like to simplify it, even if it means more storage.

 

But hey, whatever works for you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.