Specifications

This function, given a postid, will perform the two queries required to retrieve the message
header and body for that posting, and put them together into a single associative array which it
then returns.
The results of this function are then passed to the display_post() function from
output_fns.php. This just prints out the array with some HTML formatting, so we have not
included it here.
Finally, the view_post.php script checks whether there are any replies to this article and calls
display_tree() to show them in the sublist formatthat is, fully expanded with no plusses or
minuses.
Adding New Articles
After all that, we can now look at how a new post is added to the forum. A user can do this in
two ways: first, by clicking on the New Post button in the index page, and second, by clicking
on the Reply button on the view_post.php page.
These actions both activate the same script, new_post.php, just with different parameters.
Figure 29.8 shows the output from new_post.php when we have reached it by hitting the
Reply button.
Building Practical PHP and MySQL Projects
P
ART V
734
FIGURE 29.8
Replies have the text of the original automatically inserted and marked.
35 7842 CH29 3/6/01 3:34 PM Page 734