View Full Version : photos in a folder displayed in a page
bryantewell
07-23-2009, 07:52 PM
I just want a script that takes pictures from a folder on the server, resizes them to thumbnails, displays the thumbnails on a page, and obviously makes each thumbnail a link to a full-res photo. I want this so my client can just upload her photos to this folder and keep her photos up-to-date. any extras such as photo titles included under the thumbnails could be helpful but are not necessary
Beverleyh
07-24-2009, 01:42 PM
This Dynamic Drive script sounds like it might work well for your client: http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm - it automatically populates the gallery from all images in a folder, so as and when your client uploads more images, they will automatically be included without any extra coding intervention.
I would suggest making the thumbnails square (same height and width dimensions) to account for landscape and portrait ratios.
Hope that helps
Beverley
bryantewell
07-24-2009, 06:08 PM
can i get the script to crop/resize instead of just resize? I would like to prevent image distortion from skewing the aspect ratio.
bryantewell
07-29-2009, 05:44 PM
Okay the script is working almost flawlessly on my site now. I am having one problem. It's coming up with a scrollbar and I'm trying to avoid that. I've done a lot of extra work on this website just to make sure there are no scrollbars. If anyone wants to take a look at the source and let me know if there's anything I can do here is the link:
http://www.jelizabethphotos.com
NOTE: when the Twitter login comes up, just hit cancel. The client has her twitter set to only allow who follows her to view her updates. I'm trying to get her to get another twitter for this site or just suck it up and allow everyone to see her twits like everyone else in the world. The rest of the page will load after you hit cancel and the "portfolio" is the page with the gallery script. Thank you for your help forum users!!!
Okay the script is working almost flawlessly on my site now. I am having one problem. It's coming up with a scrollbar and I'm trying to avoid that...
you mean the vertical scrollbars? the only way to solve that is to make the page shorter. You have "var dimension" set to 4x15; adjust it to have fewer rows. However, when I look at the page, it's the twitter messages that make the page too tall for my window.
just...allow everyone to see her twits like everyone else in the world.
hmm.. sounds wrong..
jimbowvu80s
12-01-2009, 10:27 PM
I've been using this script for several years. I change the file name of the images to 1.jpg, 2.jpg..etc. Is there a way I can change this script to use wildcards to read the files in a specific directory? Also, I change the variable - NUMBER_OF_IMAGES to reflect how many images are in the directory. I know this can be done in PHP, but I would like to see if it can be done with what I have so far.
Thanks for your help.
<script language="JavaScript"><!--
which_image_loaded = 0;
NUMBER_OF_IMAGES = 8;
ImageNames = new Array;
ImageNames.length = NUMBER_OF_IMAGES - 1;
for (counter = 0; counter < NUMBER_OF_IMAGES; counter++){
file_number = counter + 1;
filename = (file_number + ".jpg");
ImageNames[counter] = filename;
}
function changeImage(direction) {
which_image_loaded += direction;
if (which_image_loaded < 0)
which_image_loaded = NUMBER_OF_IMAGES - 1;
var jim = which_image_loaded;
if (which_image_loaded == NUMBER_OF_IMAGES)
which_image_loaded = 0;
document.jobimage.src = ImageNames[which_image_loaded];
}
//--></script>
<td><form>
<div align="center">
<input type="button" value=" Next " SIZE=30 onClick='changeImage(1);'>
<input type="button" value="Previous" onClick='changeImage(-1);'>
</div>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.