Nanoblogger comments (update)
January 26, 2009
programming
Basicly these blog items serve as a personal reminder and documentation. Also the code needs to be refactored a bit and some html tags need to be removed from it.
Files needed
The following files are needed for this comment system:
-
comment.php, this is the PHP file the implements everything
-
nbadmin, a small shell script that implemented the comment moderation (just a
mv
of the comment to the correct directory) -
nbnofity, small shell script that notifies you a new comments (to be put in
cron
) -
com.css, the
css
code for the comment pages.
Templates
In your templates you will need to require
the php script, so a
require_once "/home/miekg/miek.nl/comment.php";
must be there somewhere.
Further more all pages that do something with comments need the following code:
- Get the current comments and put them in a
PHP
array
- Show the current comments as HTML
- Check the current form input and act accordingly
- Show the comment input form
- Show a “recent comment” section in your side title
And that should be it.