NewsUpdate
· Setting up news.usr
· Setting up news.cfg
· Case studies

NewsUpdate allows you to add and edit news messages on your site through a simple WWW interface. Obviously, this is a must-have utility for news-oriented sites like EmuSphere and Retrogames, but its extreme flexibility allows it to fit other roles, too.

Any FTP account can be used for news updating. Since NewsUpdate maintains its own password file, webmasters can give staff access to post news without granting them ftp access. NewsUpdate is controlled by three main files contained in /yourlogin/ (not /yourlogin/web/): Once you have it configured, you can access the WWW interface at
    http://ftp.yoursite.com/newsupdate

ex: http://ftp.emulationworld.com/newsupdate
The http:// is important in this case, since most browsers will try to use FTP otherwise. If you save the password, you can bookmark almost any page within newsupdate. If not, you should always start at /newsupdate.

Setting up news.usr:

news.usr contains the user name for each NewsUpdate account. Each line contains 4 - 6 colon (:) separated fields describing a user. A typical line will look like this:
lev:61khNRMuUn8X6:209.104.156.242:930184592:/images/lev.gif

The fields are:

Adding an account:
To add an account, edit news.usr and add a line:
    login:password:::usera:userb

ex: lev:test:::/image/lev.gif
As mentioned above, the password will be encrypted the next time NewsUpdate is used. UserA and UserB are optional. You do not need to use them.

To use NewsUpdate, the person must know their news username and password and the username of the FTP account which has been setup for news. They do not need to know the password for that FTP account.

Editing an account:

UserA and UserB can be added or removed at any point and the username can be changed at any time. To change a user's password, replace the encrypted string with a new password of 4 - 8 characters. NewsUpdate will automatically encrypt it again.

Setting up news.cfg:

The flexibility of this configuration file allows you to create almost any format you like. Unfortunately, that also makes it difficult to setup. Case studies have been provided further down as a guide.

The main configuration:

The first portion of news.cfg controls when items are archived, what fields are available, and their default contents.

Here is the basic format:

-- Config
Category = list
Platform = list
Title = default
Body = default
Tagline = default
KeepDays = number
KeepItems = number
-- End
Keyword Required? Description
-- Config optional Does nothing.
Category optional If used, the list is a comma (,) separated list of categories to choose from. It must have at least one item.
Platform optional If used, the list is a comma (,) separated list of platforms to choose from. It must have at least one item.
Title required The subject/title. A default value may be given, but is optional.
Body required The meat of the post. A default may be given, but is optional.
Tagline optional Useful for a thank you, or other short add-on. A default is optional.
KeepDays optional Defaults to 30 days. Posts are archived when they are older than KeepDays or there are more than KeepItems posts. If used, a number must be given.
KeepItems optional Defaults to 200 items. Posts are archived when they are older than KeepDays or there are more than KeepItems posts. If used, a number must be given.
--End required Marks the end of the main configuration

The templates:

The remainder of news.cfg contains one or more output templates. Each template has three major portions: the configuration, the date header, and the format for each post.

The configuration:

-- Start name
File = filename
ArchiveDir = directory
Platform = list
Category = list
KeepDays = number
KeepItems = number
Keyword Required? Description
-- Start required This marks the start of the template. A name must be given and each template should be given a different name.
File optional Once the posts are run through the template, the result will be saved to this location (relative to /login/web). It will overwrite this file, so set this to a news file and SSI it into your web page.
ArchiveDir optional Posts to be archived are run through the template and saved in this directory, separated by month. If a header.txt and/or footer.txt are stored in that directory, NewsUpdate will use those before and after the archived posts.
Platform optional If used, the list is a comma separated list of platforms covered by this template. Any other platforms are ignored.
Category optional If used, the list is a comma separated list of categories covered by this template. Any other categories are ignored.
KeepDays optional If used, posts older than this many days will be ignored.
KeepItems optional If used, only this many posts will be included in this file.

The date header:

This portion of the template produces the HTML used to mark the start of each day in the news output. It is optional, but usually desirable. It starts with the line
-- Daybreak
It ends when it finds the Format tag (see below). The following tokens can be used within the date header:
Token Example Description
%monnum% 6 The current month 1 - 12
%daynum% 30 Day of the month 1 - 31
%year% 1999 Four digit year
%weekday% Wednesday Day of the week
%month% Jun The current month Jan - Dec
%date% 06/30/1999Zero padded date 01/01/1999 - 12/31/1999
%% % A percent

The post format:

This portion produces the HTML for each news post. It is required. It starts with the line
-- Format
and ends with the line
-- End
The following tokens can be used in the post format:
Token Description
%category% The category of this post
%platform% The platform this post is about
%title% The title/subject
%body% The meat of the post
%tagline% The one-liner (usually on the end of the post)
%login% The username which last added or edited this post.
%usera% The 5th field in news.usr
%userb% The 6th field in news.usr
%timestamp%Seconds since 01/01/1970. Good for anchor tags.
%time% Zero-padded time 00:00 - 23:59
%monnum% The current month 1 - 12
%daynum% Day of the month 1 - 31
%year% Four digit year
%weekday% Day of the week
%month% The current month Jan - Dec
%date% Zero padded date 01/01/1999 - 12/31/1999
%% A percent

Case studies:

By this point, NewsUpdate is one large, abstract mess. At this point, some examples are sorely needed. Below are scenarios presented by two hosted sites and possible solutions.

Case #1: Zophar's Domain

In addition to news on the main page and a news-only page, ZD needed a raw data file for Unix news sites to pick up.

Case #2: Emulation Zone

The 'Zone's main page posts the titles for the last few news items, but the full news items are stored on another page.


Membership Services   Getting Started   Dynamic Content   Other Features  

Last updated July 1, 1999 by Brian Rahn