shazman Posted January 19, 2010 Share Posted January 19, 2010 I am somewhat new to PHP but I have a pretty good basic understanding of what I'm doing. I'm building a site for my dad and I need a slide show for it. I looked online but could not find one to my liking so I decided to construct my own. Basically what I have done so far is getting the thumbnails from a specified directory and display them on the page. What I would like to do is give each thumbnail an ID so when I click on that thumbnail, it'll display the correct photo above the thumbnails. I also want a previous and next buttons underneath and above the photo. The slide show does not have to be automatic. Here's my directories: Thumbnails: /photos/thumbs/ Photos: /photos/ Here's my script so far: (Found this on Google and modified it slightly.) *Note: This only gets the thumbnails function getSlideImages ($PhotoPath) { //path to photos $directory = $PhotoPath; //get all image files with a .jpg extension. $photos = glob("" . $directory . "*.JPG"); $photoArray = ''; // create array foreach($photos as $image) { $photoArray[] = "$image"; } //shuffle array sort($photoArray); $numPhotos = count($photoArray); print "Number of Thumbnails: $numPhotos<br />\n"; //display images foreach ($photoArray as $imgsrc) { print "<div style=\"float:left; width:102px; height:55px; padding:4px;\"><a href=\"#\"><img src=\"$imgsrc\" border=\"1\" /></a></div>\n"; } } I am not looking for somebody to write me a script. I'm looking for somebody to help me write my own. Please give me some ideas with examples on how to do what I'm looking to do. Thank you. *EDIT: I noticed after I posted this the it was in the wrong section. Sorry. Is there any way to move it? Quote Link to comment Share on other sites More sharing options...
marlonbtx Posted January 20, 2010 Share Posted January 20, 2010 last time i did it with javascript, what i did is load a javascript array with all the paths Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.