/* NG HTML frontend */
First, thank you for downloading something I've put much work into. I hope you'll like it.
This system of PHP scripts was designed to mirror a newsgroup in a MySQL database. The stored posts can be browsed and
searched. It also features some nice little extras, like filtering by unread posts posted since your last visit. It is
furthermore capable of posting to the newsgroup you are mirroring. This feature can be password protected, and email
address, IP, time, subject and server messages are logged with each post made to prevernt abuse. The log can be accessed by
calling log.php, the password is the same as for the database.
It is geared mainly towards speed; a database of 25MB generates pages in less than 1 second on a Pentium II 400MHz.
I suggest you change the features and especially design to make it meet your needs, it is intended as a basis for what
you need. Most features can be easily configured in the configuration files.
If you have any questions or suggestions, are looking for a special version tailored to your needs or need help in setting
it up, contact me at metalhead@metalhead.ws.
This software is released under the terms of the GPL, of which a copy is included.
/* Requirements */
To run this, you need a server with PHP, Apache and MySQL installed. It works in linux, but should work in windows as well.
Your PHP installation needs to have IMAP support to get the posts from the newsgroup, GD with JPEG support for the
statistics pictures and PHP session support must be enabled if you want to use the unread posts stuff. Furthermore,
your webserver user must be allowed to initialize and open a socket for posting.
/* Setup */
Decompress the .zip file to a folder of your choice (but since you are reading this, I guess you have already done so).
Create a new database on your MySQL server and import the structure.sql file into it to set up the table structure.
Create a file named stats.php in the directory you want to run it and make it world writable. The temp directory needs to
have public write permissions, too. Now edit the configuration files (those prefixed with config_) to tell the script about
newsserver, database and general options.
If all this is done, run the update_db.php file to query the newsserver and fill the database with some posts. That's it.
I recommend running the update script as a cron job. If you enabled the unread posts stuff, you best run it at every full
hour to have it working properly.
/* Known issues */
Posts that belong to a thread of which the first post is not in the database don't show up on the index page; they're searchable however
/* Revision History */
06-10-02 Version 1.0
Initial release
07-10-02
The 'posts from ... to ...' on the statistics page was sorted the wrong way round.
Moved the index navigation links from the bottom of the page above the message frame.
Added revision history.
08-10-02 Version 1.1
Added posts per day of week chart on the statistics page.
Email addresses and URLs are rendered as links in the message body now.
The post message script should return an error message when something goes wrong now. Tags are stripped from sender name and email address before posting.
Threads are really sorted by reference now.
09-10-02 Version 1.2
Fixed a bug that caused posts from the thread above to appear in the thread below if both were expanded.
Statistics page is now updated when the database is updated, otherwise static.
Message body is shown in a new window now.
10-10-02
Index page generating sped up up to 200%.
30-10-02
Search results can be viewed in the context of their threads now.
Posts made to the newsgroup are being logged now.
03-11-02
When searching for subjects, the threads are returned now.
Added counter on the main page.
07-11-02
The name and email entered when posting are stored in cookies now. When you post again you won't have to fill in those fields.
10-11-02 Version 1.3
Search results are being splitted up into several pages now.
Extended search function for message body with AND and OR connectors.
23-02-03 Version 1.5
Mostly changes in the behind-the-scenes stuff.
The thread structure is stored in an extra table now, and the algorithm for generating the index pages has changed. It should be up to 30 times faster than the old one.
The NNTP message IDs are no longer stored, but converted to UIDs. Space usage has been reduced by about 25%.
25-02-03
Fixed a problem with the thread display which occured after I changed the way posts are stored.
28-02-03
Fixed a bug that caused some threads to show up several times on the index page.
08-03-03 Version 1.6
Posts of the same thread depth are finally sorted by date. Phew. This is considerably slower than the old method, but to change it again you just have to uncomment some stuff in the sources.
Added vertical lines that make it easier to follow the threads.
09-03-03 Version 1.7
The number of posts added to the database since your last visit is now displayed on the main page. You can also display only those posts. It's not quite the way I like it yet, but for now this must do.
10-03-03
Fixed a bug with the message body formatting when posting.
15-03-03
Added thread filtering by new posts. Old threads with new posts are flagged seperately.
18-03-03
Fixed a bug that caused only the first post in a thread to be marked as unread.
19-03-03
Unbelievable, but the unread posts stuff should finally work as it's supposed to. At least I ironed out all bugs I was able to find.
21-03-03
Changed the way unread posts are determined and managed. Same functionality, but faster and more elegant :)
The posting log goes to the database now.
22-03-03 Version 2.0
Cleaned up the code a bit. Added a new configuration file for easy configuration of the features.
Unread posts are split up into several pages now.
Release to the public.
26-03-03
Fixed some security holes. All strings entered by users that are used in database queries are escaped now.
28-03-03
Fixed a bug when inserting post data into the database.
10-05-05 Version 2.1
Fixed a bug that caused messages posted through the frontend to have faulty references.
Fixed a bug that caused error messages when no posts have been added to the database since the last visit.
Added some error checking and correction to the update script.
23-05-05
Fixed some harmless but annoying error message.
The links in expanded threads on the search page are correct now.