Dynamic Web Content with PHP

This material from October 6th's lecture attempts to help you gain comfort in doing our four projects for this class. If you are struggling with the basics. one student in class recommends a Web video series at http://www.phpvideotutorials.com/ which helps reinforce basics learning through a comforting Australian accent.

Project 1 - The Art Gallery

This project is an extension of the ArtStar Community pages at http://artstar.org/community/community.html. You are to design an attractive presentation of Mary Ellis' paintings (digitally captured). They exist on-line at http://artstar.org/community/virtual_artists/mellis/. You have a lot of freedom to incorporate PHP features into the page. I have mocked up an example at http://www.oworld.org/dynphp/bdc/artstar/. Features of PHP I decided to incorporate are:
  • Loops to access thumbnail content via URL and present attractively in a visual index.
  • Loops to link to actual images in Mary's on-line digital archive.
  • An I-Frame presentation of the image when it is larger than the page can handle visually
Other things I might consider implementing if I have time during the class:
  • A filter to show images by predominant color.
  • A CSS style sheet to layout the thumbnail images in a creative manner.
  • A dynamic style sheet within the page using PHP to generate it.
  • An image of the day for starters using the filename to parse out a day of the month.
  • You should implement whatever feature you find challenging and/or attractive, using PHP when best suited to function.

Project 2 - The Earth Science Visualization Gallery

Project 2 is an extension of Project 1 except content can be accessed via a directory read on the server (note you could do this with project 1 too if you wish). PHP can read any readible directory on the Web and process files within the directory via code. In this example, you only need to process the filename, using the string functions to identify the file type and presenting the content appropriately based on the file type. You want to make the page appear attractively within the CEV website that appears at http://www.cev.washington.edu. I have already mocked up a simple version using the old gallery site that CEV used years ago at http://www.oworld.org/dynphp/bdc/cev/. Features of PHP I decided to incorporate are:
  • File directory read to get the list of filenames in the /var/www/html/risd/cev/content directory.
  • String position calls to find the position of important components of the filename.
  • String substring calls to parse out parts of the filename for processing directives.
  • Filtering calls to limit the presentation of the gallery index to a particular content type.
  • Parsing of the filename to present an alternative description of the image for alternative user agents.
Other things I might consider implementing if I have time during the class:
  • A parse of the filename to create a filter based on it.
  • A CSS style sheet to layout the thumbnail images in a creative manner.
  • A dynamic style sheet within the page using PHP to generate it.
  • An image of the day for starters using the relative location in the directory listing to assign to a day of the month.
  • You should implement whatever feature you find challenging and/or attractive, using PHP when best suited to function.

Project 3 - The Ocean Picture of the Day Site

Project 3 adds the ability to get information from a Web visitor and incorporate it into your site. For now, you can work on getting the participant to participate in content sharing. Example code in /var/www/html/dynphp/bdc/opod demonstrates how to use PHP to do a file upload but there are many other examples on the Web as well. You want to present the pictures of the day in an attractive manner and let a reader change from day to day. You also want to incorporate the page so it blends nicely with The Ocean Project site at http://theoceanproject.org/ as a new feature called Ocean Picture of the Day. Eventually the form will connect to a database to store the e-mail address, picture location, and an essay from the provider. Take a look at http://www.oworld.org/dynphp/bdc/opod/index.php. Features of PHP I decided to incorporate are:
  • A form processor to upload new pictures to the OPOD library.
  • Note that you will need to set up your directory for uploading from the general public (I can run the relative chmod 777 /var/www/html/dynphp/bdc/opod/upload that I ran on my directory on your directory if you send me a message to do so. Or, you can use my directory for uploading and reading files.
  • String manipulation to manage requests for specific OPOD pictures.
  • A dynamic next and previous menu for going through all the pictures in the library.
Other things I might consider implementing if I have time during the class:
  • Add a back-end database to store data associated with the picture (we will do this together).
  • Add a moderator's page so that a moderator can rename files to the sequence when they have been approved.
  • A dynamic style sheet within the page using PHP to generate it improve the picture and form layout.
  • Base the filename on date and parse the date to provide navigation based on date and not just number.
  • You should implement whatever feature you find challenging and/or attractive, using PHP when best suited to function.

Project 4 - Citizen Science Marine Counts

To see this project functioning, see http://www.theoceanproject.org/mp/forms/trawl.php and to see reports from the database see http://www.theoceanproject.org/mp/forms/trawl_reports.php. It might be premature to start working on these pages before we have our database in place on our class server (you can't access the Save the Bay server from our class server so I will have to move the data over when we set up the database together on our site). This is the project with the most functionality. It should blend nicely with the Save the Bay site at http://www.savebay.org/NetCommunity/Page.aspx?pid=879&srcid=-2. You should grab the form using the browser's View Source feature and start a PHP page with it. I will be adding more features to demonstrate to you, but basically you can add any interesting feature you want that PHP is capable of performing. Do write me with your ideas as I can get feedback from the Save The Bay folks whenever you want.