This application is built using a simple web application approach I developed for my own use. It provides PHP objects for generating HTML, a simple templating system and abstracts communication with a mysql database. There are plenty of other tool sets out there that do the same kind of thing, but I wanted to write my tools for the experience of doing it. The added benefit for me is that I now have a nice set of extensible tools that I can use to build applications like this one.
Here is a description of the way pages are generated using my approach.
- Each page detemines the location of the 'include' directory
- The 'master.php' file in the include directory is loaded and processed
- Site-wide contstants are defined
- The relative path to the root of the website is determined
- Any incoming user supplied variables are validated and made safe
- The Page Class is loaded to provide a simple templating
- The Data Class is loaded to abstract database access
- Various utility functions are defined.
- A Page class instance is created and the content of the page is defined
- The 'display' method is called and the Page class generates the left side menu based on the contents of the 'menu.ini' if it is present.
- The template page is loaded, the content is added to the template and the rendered HTML is sent to the browser.
This description covers simple pages, but the content may include other objects which generate content such as HTML forms, bible verses, calendars or other kinds of special content. These objects will be covered in their own section.
Some objects can provide complete, abeit simple, applications as well. For example, using the basic components to provide the simple template and form generation I have written objects that act as a shopping cart, a web log, a photo album viewer and a news article library. This application will include many of these small extensible applications to meet its goals.
The first of two objects has already been created to handle searching and presenting bible verses from an various translations of the Bible stored in XML. PHP provides access to a fast, simple XML processing library that can dynamically load, process and display specified verses very quickly.
The second object calculates the lectionary dates in a given calendar year. It is not complete, but the basic calendar calculations work. This will be the heart of the worship planning calendar and will help make suggestions for lectionary verses based on the Revised Common Lectionary.
The Hymn catalog will need to be compiled or acquired from the Presbyterian Church and an object will be created to manage searching for hymn references, titles and other indexes. This should be general enough to allow other hymn catalogs to be added in the same way the bible object supports multiple versions of the bible.
The anthem catalog will be a fairly straight-forward database application which will support searching by various indexes. The fact that it will be available on the web means that a large music library can be broken down and entered by the whole choir, reducing the burden on the designated librarian. I will also be creating various importers to help get any existing data stored in other programs into this application.
The menu on the left will provide a more technical overview of the objects that make up the application. The examples are probably sufficient for experienced developers already familiar with PHP and basic coding style, but new developers may want to keep a few reference sites handy with looking at the code.