#76: A Blogging System

Blogs are common because they're very easy to write—all you really need is a system to keep track of dates and content. The basic blog that appears here includes tools for adding entries, adding comments, and viewing entries. The system stores entries and comments in a MySQL database and uses Smarty for display templates.

Here is the main table for blog entries, originally named blog_entries:

CREATE TABLE 'blog_entries' (
'ID' INT NOT NULL AUTO_INCREMENT ,
'title' VARCHAR( 120 ) NOT NULL ,
'content' TEXT NOT NULL ,
'teaser' TINYTEXT NOT NULL ,
'entry_time' DATETIME NOT NULL ,
'category' VARCHAR( 12 ) NOT NULL ,
PRIMARY KEY ( 'ID' )
) TYPE = MYISAM ;

Most of these fields are self explanatory. teaser is a snippet of the entry ...

Get Wicked Cool PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.