CS11
PHP projects

 

Week 1:
I am going to build an online photoalbum site, which will hopefully have features that will allow other people to use it.
I spent this week reading about PHP and SQL. These websites were extremely helpful:
http://sqlzoo.net
http://philip.greenspun.com/panda
Especially the sqlzoo one. It has a bunch of examples on JOINS and OUTER JOINS and how to CREATE and manage tables with commands. I set up my DB schemata this week, which is pretty simple looking once it was reduced. I am going to try and do the three main tables first: ImageFile, Image, and Gallery.

Week 2:
I made some progress on forms, PHP, and SQL, although not much.
add.php - is a simple script that let's you display and manage galleries from the gallery DB. The delete functions do not work and further development was abandoned for work on the front end of the site.

Week 3:
Variables were pretty confusing to me because the process has been recently changed and I have not had expereince in HTML. I learned about OUTER JOINS this week and _GET and _POST variables that PHP uses to pass variables around in the URL. Usage of these can be seen here:
galleries.php - a simple display of all the galleries in the gallery database and a link to each one
gallery.php - a simple display of the contents of the gallery, complete with thumbnails and all generated from the Image and ImageFile DB's.

A very helpful page for understanding passing variables in HTML is:
http://www.zend.com/zend/art/art-sweat4.php
The image thumbnails just link to themselves, and I don't have anything that automates the thumbnailing process. Hopefully, I will be able to install Imagemagik in the next two weeks and get the exhibit table up and running. The exhibit table is more of a user controlled gallery option. I should probably get Comments working first though, so people can leave comments on Images and make a better presentation page for the images themselves.

Week 4:
Some cool progress this week. I put in the comments section and an image display page. There's also a cool new navigation bar that lets you go back and forth through the pictures in a gallery and also one that lets you work your way up through the the exhibits->galleries. I think I will add the user system next, or possibly some user management pages that use cookies for session tracking.
week4php.zip - the three files that are being used right now.

Week 5:
I added a user table and the ability to enter comments this week. I had a lot of trouble passing the referring page to the login and logout scripts, but I took care of it by using a * instead of a & for separating variables and then replacing the * with & before calling the page.
week5php.zip - all files that are being used now.

Week 6:
I added a scheme to more accurately verify users this week. When the user logs in, a random number is stored on their computer and in the database. Whenever the user does anything, like posts a comment, this random number, or "passport" is verified before the action is allowed. I also implemented real image resizing this week. I did this through a php script that returns an image when you pass it a size and a filename. The resized image is stored in a file by appending the size to the front of the image. If the image already exists, the script doesn't dynamically resize the image again, it uses the old one. I thought this was a cool system. You can also add a new user now.
week6php.zip - all files that are being used now.
Next week I want to put in the ability to add photos or galleries to the system. I should probably start at the top with adding exhibits and then propagate down from there.

Week 7
I started on my method for editing exhibits and galleries this week. Almost none of the functionality is there yet. This week served up another heavy dose of humility when I learned that you can have multiple forms in the same page. I was trying to edit specific galleries with a really stupid way of passing the gallery number to the edit page before I found this out. Now, you can login and edit your exhibit, which just means that you can edit your gallery. So far, the only thing that kind of works is adding pictures to the gallery. If you click on "ADD" it will take you to a page that adds all images not currently in the imagefile database, to the imagefile database. Then it lists all images that you could add to the gallery. I am going to work on this more next week, hopefully it will go more smoothly.
week7php.zip - all files

Week 8
I added a lot of the management features this week. Now you can add images to a gallery and remove them, even change the name and description of the images. Next I need to put checks in so that the same images don't get added to the same gallery, a system that removes imagefile representations of files that no longer exist, and a way to encode descriptions and names so that they can have spaces and stuff. I think I'll do that last one first. Overall I think it's a good start to a picture gallery system. Definately enough to use on my site.
week8php.zip - all files