In the previous articles we looked at what PEAR is, how it works and how to install packages. We also explored various packages that we installed. One of these packages was called PEAR::DB. We will be using this database abstraction layer to build a CMS in the next couple of articles.
Overview of CMS
The CMS works like this: several authors will send in articles which are then processed, stored and displayed in the CMS. It follows these rules:
Anyone who wants to use the CMS must be authenticated. This ensures that only users that have the right to use the system are using it.
Different users will have different clearance levels. Some will have admin rights and others will not.
The CMS home page will display the latest five stories. Users can click on them to view the stories or articles in detail.
The authentication section will consist of two scripts:
Login.php - This script is responsible for authenticating a user; in other words, logging a user into the CMS system.
Logout.php - This script is responsible for ending a user session, which basically means logging a user out of the CMS system.
The main CMS section will contain the following four scripts:
main.php - This script acts as the "door" to the CMS application. It is the first page that you will see when accessing the Content Management System.
view.php - This script displays a user-selected article in full.
authors.php - This script lists all the authors in the system. It also provides links to articles written by the author.
authart.php - This script list all the articles written by a particular author.
The admin section contains four scripts:
Add_auth.php - This script adds a new author to the system.
Delete.php - This script deletes an author from the system, including all articles written by the particular author.
Index.php - This script displays a welcome message. It is the first screen that you will encounter when accessing the admin area.
Listauth.php - This script displays the names of the authors that are in the system. It also provides a facility to remove authors from the system. When removing an author, all the articles that he or she wrote are also automatically removed.
Other application-wide scripts include:
pear.css - This script contains the styles for the site.
main.dwt.php - This item provides the template for the entire Content Management System
connx.php - This script contains the connection credentials of the application.