This program is used to write letters to various public officials.
In all, it is a fairly simplistic CGI program, but you will need
to know how the pieces fit together.
First, a test URL is:
http://mordred.armoredpenguin.com/letters/letters.cgi.
Next, much of the output is controlled by
webc,
a simple HTML preprocessor that I've written and used for a
number of similar jobs.
This frees the HTML from the program so that different people
can concentrate on their strengths.
The CGI program (letter.cgi) can be installed in any directory you
can run CGI programs from. This can be a cgi-bin directory,
or possibly a user directory. Under this directory are two main
directories, the Template directory and the Letters
directory.
The Template directory is used for files which guide the
process which are not typically changed. There are some files
which are included in others, and set the tone for the entire
site. These files end in *.wh.
- defs.wh --
This file does not generate any HTML. It sets up constants
that are used through the rest of the package.
- head.wh --
This comes out at the start of each web page. This sets
up the title and color. You can also get carried away
here, and put up a sidebar for navigation or similar
items.
- tail.wh --
This comes out at the end of each web page, and closes
off any tables set up in the head.wh file, as well
as display contact information and the like.
- appl.error.wc --
This is a catchall error file. You may want to modify
this by putting in helpful hints, contact info, etc.
- display.wc --
Display a list of letters.
You may want to alter the text which surrounds the
selection process.
The title of each letter comes from the associated control file.
- letter.wc --
Display a specific letter. The actual letter comes from
elsewhere, so this is just the presentation of the letter.
You can add additional fields if appropriate.
- thankyou.wc --
The user has sent a letter off.
This is the page they come to.
You can put additional links or more things they may want
to do here.
- envelope.wc --
This isn't a web page, but is used to package the letter
to the recipients. The information collected from the
user (such as name, email address, US Mail address, etc.)
can be used here.
The next directory is the Letters directory.
This contains letters and their control files, as well as
a list of email addresses. Look at the comments in the files
for the information which goes in the files.
The letters end in *.txt, and the control files end
in *.ctl.
- email.addr --
This is a list of email addresses that the user can send
mail to. This program cannot send mail to arbitrary
addresses, as it would be used to cause mischief. So
this sets the limits. There is a nickname (used in
the control files), email address, and the real name and title.
- sample.ctl --
This is a sample control file.
It lists a number of fields which control how and when
this letter is displayed.
- preservation.ctl --
A control file for a silly letter.
- preservation.txt --
The silly letter itself.
The process for adding a new letter is to create an appropriate
*.txt file in the Letters directory in standard ASCII.
Format it as you wish. Remember that the user may change or
add text to this message.
The second step is to create the corrosponding *.ctl
file. Copy the sample, and change the fields as appropriate in
your copy. Now check the letter writing page to see that your
new letter shows up. Then you're done.
You can pick up a copy of the entire archive for
version v0.15.
This contains all of the files mentioned on this page.
If you have any question about this package,
send mail to The Administrator.
This application written by Dave Regan.
You can see other programs at http://mordred.armoredpenguin.com/.