Forum Moderators: coopster

Message Too Old, No Replies

How to make a photo gallery

         

aixelsyD

12:38 am on May 5, 2010 (gmt 0)

10+ Year Member



I'm new to the world of PHP and would like to know if anybody knows how (or a link to tell how) to make a photo gallery without having to specify each image, eg. I have a list of images and would like to have people see all of them as soon as it is uploaded (I have an external up-loader). Also, is there a way to automatically delete the images after a preset amount of time.

If anybody is wondering I use Godaddy as a host.

jatar_k

1:29 pm on May 5, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld aixelsyD,

for doing anything automatically based on time you would need to use cron (*nix) or scheduled tasks (windows). Though if you wanted a script to this that you could run manually every opnce in a while you could go through your list, check the date on the file and if it is older than your desired age then use unlink [php.net] to delete it.

As far as the first part of your question I don't really know what you mean.

>> make a photo gallery
well there are some good ones out there
[webmasterworld.com...]

>> without having to specify each image
not sure what you mean. when selecting/showing images? do you use a database?

>> I have a list of images and would like to have people see all of them as soon as it is uploaded
where do you want to show them?
are they just files in some directory?

more info to flesh out the questions would help.

aixelsyD

2:07 am on May 6, 2010 (gmt 0)

10+ Year Member



Well, as of now I have to say the path of the image for example www.webmasterworld.com/images/mine/myalbum/summer.jpg.

So I don't have to do this for each image. and then re-upload the webpage each time I need to add an image.


I am new and don't have a clue how to program in HTTP or PHP, just starting to learn C++. If you could post a code with simple instructions how to wet it up for my site, It will be a lode of help.

If you want to know, the site is <snipped if you want to see what I can do with flash. The uploader is not mine, it is borrowed.


Thanks in advanced. This is for the camera club I am in.

[edited by: coopster at 11:21 am (utc) on May 6, 2010]
[edit reason] no personal urls please [/edit]

tangor

3:22 am on May 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your url will be removed... but in the meantime you'll want to take a little time to get some knowledge of HTTP and PHP. It is unlikely any here will give you a turnkey script.

We tend to teach from your best efforts rather than give you code. That way you learn how to do it right. You can bing for "photo gallery php script" (or use the google) and you'll find some examples.

aixelsyD

3:34 am on May 6, 2010 (gmt 0)

10+ Year Member



You can't blame a guy for trying, can you?

If it's anything like like C++ then i will get months of instruction for something that will take 30 seconds to do.
I have actually, that just came with its own set of problems. I repedietly get an error message saying that a "',' or ';'" is needed. That is the upside of making your own scripts, you a) know what your doing, b) you can make it as simple or complex as you want it to be.

jatar_k

1:16 pm on May 7, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> So I don't have to do this for each image. and then re-upload the webpage each time I need to add an image.

then you need some dynamic place to save the image names so that you don't have to change the page. You could insert them into a database and then your script could pull all the image names from there and build the paths.

even easier would be to add them to a file, they could be just names or full html tags and include the file on your page.