Extended News v3.2
=============================
http://www.crimson-blade.org/snippets/

Disclaimer
==========

This code has been tested on a heavily modified version
of SMAUG 1.4a, there is no guarentee that it will work
on your copy, and I retain no responcibilty if this code
does anything to your code, your game, or the system it's
running on.

Terms of Use
============

(1) All comments and headers must be left in place.
(2) If you find a bug in the code, please report it to the
    SMAUG MAILING LIST (smaug@realms.game.org) and/or directly
    to myself: jbellone@comcast.net
(3) This code may only be re-distributed with the author's concent.
(4) I would like an email telling me that your using the code. This
    tells me actually how many people are using it, and if I should
    produce further snippets and code updates.
(5) If you are not abiding by the Diku, Merc, and Smaug codebase
    licenses, you may not use this code. (considering that your
    using Smaug).

Overview
========

This is my 'remake' of the 'news' command (which originally just pointed
to a helpfile). I got the idea from Orion's news remake which appended
news to a dat file in the system directory. (Actually, I think I'm running
an older version of his... might be some new goodies in that).

What this does is the following:
 It sorts news by a number beside the news post, the number is generated 
 every time the news file is loaded.

 It allows news posts to be removed.

 News is processed by a short line like this.

   editnews addnews <type> <subject>

Then you are brought into a note buffer to write the news, it saves multi-lined
news that accepts color tokens (colorized news!). The subject line is the only
line that is displayed when you type 'news'. Then the person must type 'news <num>'
to gain the full news.

The v2.0 update included a method of posting news on the web. The MUD writes a txt
file to the server (path specified ingame) which can then be included via a PHP
include as so:
<?php include("/path/to/file/news.txt"); ?>

To change the format of the news, you will need to look at the "snarf_news" function.
I suggest that you get a simple HTML editor and figure out the format you would like;
then editing it to suit your needs; keep a backup handy.

The v2.5 - v3.0 was the conversion period to the new file-handling system. This included
the ability to make seperate news-types for different topics; clans; guilds; immortal news;
it's all able to be handled now with 1 snippet. It also hooks directly into the command interpreter
so that there need not be more than one function for each news-type.

From the transition period to v3.0; HTML-news was removed so that compadiblity could be rewritten. Version 3.2 introduced a faster method of writing HTML files.

Instructions
============

(1) mud.h

    (A) After:
      #define LEVEL_AVATAR		 (MAX_LEVEL - 15)
     Add:
      #include "news.h" /* Extended News - 12/15/01 - Nopey */

    (B) After: SUB_PROJ_DESC, add:
	SUB_NEWS_POST, SUB_NEWS_EDIT,

(2) interp.c
    (A) After:
	  &&   !check_social( ch, command, argument )
	Add:
	  &&   !news_cmd_hook(ch, command, argument)

(3) If your not using the BFD code found on Samson's website (http://www.alsherok.net/snippets/)
    add do_editnews to BOTH proper places in tables.c

(4) Remove do_news in act_info.c (or act_comm.c ... can't remember =P)

(5) In db.c after:
    log_string("Loading races");
    load_races();
    
    Add:
    log_string("Loading news data");
    load_news();

(6) Add news.c, news.o, news.h to your Makefile.

(7) Make clean, compile.

(8) Make sure that you "cedit news delete", and remember to add the editnews command. "cedit editnews create"
    then all you need to do is "cedit save cmdtable" and your ready to go! (after you reboot/copyover of course)
    
Credit
======
Orion for his "Elder Chronicles" news system. It gave me the original idea of creating one that would
suit my MUD better; so I eventually decided to release it as a snippet. Now it's grown into a bigger and
badder News system... I'm actually surprised; one of my better snippets.

Updates
=======
1/26/02 - Fixed a small bug while viewing news posts
	- Fixed a color bug while displaying news list
2/19/02 - Hopefully fixed compile problem that Mikko was having
4/10/02 - HTML-news introduced.
5/1/02	- Interfaced vibed up. Some bugfixes; new date-stamping code.
5/5/02	- News types introduced. News commands are now handled through the
	  command hook in interp.c
5/9/02	- Added alot of news-type security features
	  (alot of these features were imp'ed after talking with Blodkai about some issues
	   he would like to add to RoD; a few were already added on RoD)
	   + lock down news posts to selected posters
	   + give ownership of a news-type to someone
	   + allow clan/guilds/orders to have private news-types
	   + select posting levels
	   + select viewing levels
5/10/02  - + Fixed a posting bug while unlocked
	   + Fixed a posting bug while locked
	   + Fixed a posting bug while null owner
	   + Added NULLSTR macro
6/18/02  - Fixed some more cosmetic bugs
	   Working on the HTML fixup; made HTML output a tad bit faster
	   Fixed "Posters" bug
3/02/03  - Fixed directions
5/20/03  - Added HTML support

Bugs
====

If you find any bugs, please report them to either my email (below) or the
Smaug Mailing List (smaug@realms.game.org)

Noplex, Implementor of Crimson Blade
http://www.crimson-blade.org
jbellone@comcast.net
