Specifications
return false;
}
return $id;
}
}
This is a long function, but it is not overly complex. It is only long because inserting a posting
means inserting entries in the header and body tables, and updating the parent article’s row in
the header table to show that it now has children.
That is the end of the code for the Web forum application.
Extensions
There are many extensions you could add to this project:
• You could add navigation to the view options, so that from a post you could navigate to
the next message, the previous message, the next-in-thread message, or the previous-in-
thread message.
• You could add an administration interface for setting up new forums and deleting old posts.
• You could add user authentication so only registered users could post.
• You could add some kind of moderation or censorship mechanism.
Look at existing systems for ideas.
Using an Existing System
There are a couple of noteworthy existing systems.
Phorum is an Open Source Web forums project. It has different navigation and semantics from
ours, but its structure is relatively easily customized to fit into your own site. A notable feature
of phorum is that it can be configured by the actual user to display in either a threaded or flat
view. You can find out more about it at
http://www.phorum.org
Another interesting project is phpslash. This is a port of the software used to run the Slashdot
discussion boards. Although the original software is written in Perl, this PHP version is avail-
able. You can get it from
http://www.phpslash.org
Building Web Forums
C
HAPTER 29
29
BUILDING WEB
FORUMS
741
LISTING 29.13 Continued
35 7842 CH29 3/6/01 3:34 PM Page 741