PHP Picture Gallery

Well, i’ve been trying to add more new things to my website, and this came up as something people would like (i know, i can’t believe i overlooked this either).

Any suggestions on how to do this? My current idea was to read a directory, do some sort of sort to them, and print them out 16 at a time (4x4). i can also pass a variale $skip through the url to say where i want to start. I’m not sure if this is the most efficient way, or if it will even work (i’ve already done a little directory reading). I also don’t want to do mysql for this, although it could be an option if it is really simple.

So, any other ideas on how to accomplish this?

I could distribute the code that I use for chiefdelphi’s gallery. :slight_smile:

I have a non-vBulletin version that I used for a project in a User Interface class a year or so ago. It even has more features, like a discussion thread build into the ‘display image’ page, and other neato things. Let me see if I have it still, and it works. I’ll get back to you.

It would require PHP & mySQL.

-Brandon

Write yer own! That is what I did atleast, and it has been going good so far. I wrote a combonation of scripts last year that allows you to add new galleries, new images, comments, descriptions, and edit every thing. It didn’t take too long, but I don’t know what your abilites are. You should be able to find a good free one, try hotscripts.com

I have included a picture of what my gallery looks like, as my site is currently offline.





well, my intent was go get ideas, not code. I have done all of our current website (http://www.lightningrobotics.com) which include members, many different news sections, events, polls, file uploads and managment, comments, ect. all by hand, (well, except for the calendar displaying thing 'cause i didn’t feel like making another one when i had one that worked perfectly the way i wanted it). So i guess the answer to your question is that my abillaties are adaquite to do the job :wink:

So, any suggestions on how to solve/approach the task (not where i can find code), or how you did it in your website
Also, i was thinking no mysql so you could add about 200+ pictures straight to a dirrectory, and you wouldn’t have to do each one through a form that would query to the database. If i just searched the dirrectory everytime, it would lower on the grunt work, but would eliminate the ability to have descriptions or searches. Give and Take.

:slight_smile: hopefully i’ll get people to read that this time :slight_smile:

Chances are, if you want to do it, the geniuses behind PHP have predicted it.

http://www.php.net/manual/en/ref.dir.php

Use those commands to read all the files in the picture directory. Although if you want to sort them you would have to have some sort of file naming convention that contains the date so your script can tell how to organize it.

One suggestion would be to mix mysql and this directory reading method. Have an admin script that you run everytime you dump a bunch of files in the folder. The script compares the new directory to the current list in the mysql db and adds the new files into the mysql db using the current date and time.