7.1. Design of the Online Photo Album

The photo album site could have a database-driven backend; each album would be assigned a unique ID and saved in some table. Perhaps another table would correlate images to the appropriate album. However, the file system is a natural choice to keep things organized so a database solution complicates the project more than it really needs to be. Each directory will represent a photo album and the files stored within it the associated pictures. Creating an album is now as simple as creating a directory and uploading files — something you did in the previous chapter!

The File Upload utility you created in the previous chapter can serve as an excellent back end to create and manage albums. The base directory holding all albums can be stored either outside or within a web accessible directory; it's a matter of preference if you want the original images to be accessible only through the album application or not. I've chosen to store mine outside the web root.

Some may argue this isn't a good idea as files stored outside the publically accessible directory must be filtered through PHP and causes additional overhead or is a pain when image sizes become too large. By moving these files to a public location this additional overhead is eliminated. However, with the images outside the public area you are able to implement filtering the requests to allow bandwidth throttling, referrer checking as a leeching deterrent, and so on. So it really does just boil down to a matter of preference.

With half the project already completed then, you need to focus on developing the front end and supporting code files. The front end will be able to present three views to the user:

  • Listing of all available albums

  • Display preview thumbnails of all the images and movies in the selected album

  • Show the image or movie file itself

The front end should be able to present three views to the visitor. The first is a listing of all available albums. Selecting an album should then present the album description and thumbnail images of the album's pictures and videos. The user will be able to click a thumbnail and be presented with the final view — the image itself.

The support code will provide the ability to examine files in the album directories and create the thumbnails for the files on the fly. Each album directory may also have a text file to store a description about the collection as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.249.158