|
-
Dec 20th, 2005, 10:57 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Help developing my photo album (small questions)
Ok, I will explain what I am doing and then ask my questions. I am building a script (1 php file) to create a photo album on my website. Right now I have a folder called "Photo_Album". In this folder are other folders, called such things as "Animals", "College" and such. In these are folders like "Lily","Pup","Dorm Room" and these have between 4 and 60 photos.
Photo_Album
....-Animals
........-Lily
............-Page_1
................-photo1.jpg
............-Page_2
................-photo2.jpg
The script reads and displays the main folders (top level) and when they click on one, it then displays the sublevels...so they click "College" and then is shows all the names of the folders under it, like "Dorm Room". when they click on this it then displays all the photos.
I have all this working but I am trying to clean it up. Right now I have folders called "Page_1" and "Page_2" with 15 photos in each (so it limits how many ar shown)
What i would like to do but no idea how, is have all the photos in 1 folder (no page folders) and have it display the first 15 photos in alphabetical order. If the are more than the limit number, for example 15, it will display "1" and "2" at the end and then if they click on 2, it will display the next 15.
So jst to get this working, just have a folder with 25 images, and I want to show 10 per page ( so at the end it should show 1,2,3) and then display the proper photos per page. I can adjust it to fit perfectly.
http://moonsofneptune.com/photo_album/PhotoAlbum.php this is a link to what i have right now. please help. I would really like to get this done before my family reunion but cant get any examples in the web.
-
Dec 21st, 2005, 01:14 AM
#2
PowerPoster
Re: Help developing my photo album (small questions)
Is MySQL out of the question? Your method doesn't seem like a very good way to do things :\
-
Dec 21st, 2005, 05:41 AM
#3
Frenzied Member
Re: Help developing my photo album (small questions)
neicedover1982:
Hey, I checked out your site and it is pretty good.
I did have a problem when I went into Events. Didn't get any photos to display.
And also none of the Bahamas.
You just need to make a few adjustments here and there and it will be great.
Have a great Holiday Season!
And keep on PHPing.
Good Luck
-
Dec 21st, 2005, 07:28 AM
#4
Re: Help developing my photo album (small questions)
I'd show you mine but the server's down 
I used mySQL like Pc_Madness suggests. One table for photo galleries and one table for photos. Each photo record has the url of the photo, ID, and gallery ID that it belongs too. Then you just do a SQL query to get the right photos for each gallery, eg.
Code:
mysql_query('SELECT * FROM photos WHERE galleryid = ' . $_GET['id'])
-
Dec 21st, 2005, 08:32 AM
#5
Thread Starter
Fanatic Member
Re: Help developing my photo album (small questions)
 Originally Posted by penagate
I used mySQL like Pc_Madness suggests.
I had thought of using MYSQL becuase then I could have extra fields so I can add other information and I could create an admin section, so I can change settings and stuff. The issue is I have alot of photos that I will be listing.
I liked the way I was just reading from folders becuase I would just have to dump the thumbnails into a folder called "Thumbnails" and the fullsize images into some other folder and the script will instantly read them and such. It was just much less work for me. Just drag and drop.
-
Dec 21st, 2005, 05:44 PM
#6
PowerPoster
Re: Help developing my photo album (small questions)
 Originally Posted by neicedover1982
I had thought of using MYSQL becuase then I could have extra fields so I can add other information and I could create an admin section, so I can change settings and stuff. The issue is I have alot of photos that I will be listing.
I liked the way I was just reading from folders becuase I would just have to dump the thumbnails into a folder called "Thumbnails" and the fullsize images into some other folder and the script will instantly read them and such. It was just much less work for me. Just drag and drop.
Or you could make a script that creates the thumbnails for you? And you don't even have to navigate to a folder, just select the category it belongs in when uploading your pic.
-
Dec 22nd, 2005, 12:15 PM
#7
Thread Starter
Fanatic Member
Re: Help developing my photo album (small questions)
Ok, I am going to try to explain my issue better and no, I cant use MySQL.
I have a script that will read all the images (jpg) from a folder into an array. I then sort that array to be in alphabetical order. The folders hold between 2 and 100 photos.
The script is programmed that if it doesnt have a page number in the link to start at 1. I would like it to display the first 15 from the array (numbers 0-14). Then calculate how many total images there are by doing a count on the array and then putting the correct number of pages at the botton.
I also want them to be able to click on the links to jump to the next page, so page 2 will start with image number 15 in the array and read the next 15. I just dont know how to do this and am not sure what to do, as there are not folders with even numbers divisible by 15, so the last page will always have less than 15 photos. Please help anyone.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|