View Full Version : Is this possible?
TaintedPearls
November 16th, 2005, 21:17
Ok I don't know alot about php so if you can help me please do. I want to know if it's possible to have a script that looks into a directory and creates thumbnails of the last 3 uploaded images and displays it to the visitor. I also want the thumbnail to be a clickable link that will display the full-size image in a new window.
Is that possible?
si-jerome
November 17th, 2005, 01:26
It's possible. You have a couple of options. For a quick and dirty solution, rename each file as it's uploaded. Rename them in descending sequential order. Then you can just read in the first three files names from the directory and those will be the newest. To display the thumbnail, just use height and width attributes in the img tag.
The other more complicated solution would involve resizing and saving a thumbnail copy of the images you want to display. Which method sounds best for you?
TaintedPearls
November 17th, 2005, 03:35
so would renaming them as they're being uploaded be an automatic process or a manual one? I've heard of batch uploading. Can that be used to rename them?
si-jerome
November 17th, 2005, 23:05
It all depends on how you plan on letting the users upload the files. I was assuming you were going to make a form available for the user to upload the file(s). In your upload script, you could have php look into your archive directory and get the last filename used and rename the new file as it is saved into the archive. Maybe you can explain to me a little more about what your setup is going to be and how the site is going to operate.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.