Sam's Management System

News: Thu Mar 11 13:44:19 EST 2004
I have big news here! I worked out a couple of bugs and added more features! I believe SaMS is very robust, and is ready for the Big Time! It is now at version 0.9.0. For the complete manual, see below. I have added an admin page, and support for an external counter program.
Bug Fixes: Thu Mar 11 13:44:19 EST 2004
While writing SaMS, I realized a glitch may occur if you don't add a child node right after its parent in the menu file, but i didn't think to test it or didn't think it would actually happen. This glitch did, in fact, occur. SaMS 0.9.0 has a sorting algorithm to prevent this.
New Feature: Thu Mar 11 13:44:19 EST 2004
I have added support for external counter commands. Just add the tag 'PROGRAM=' and the name and arguments of the external program to any of the templates. SaMS will then execute the program. If you have multple programs, you must place them on seperate lines in the template.
New Feature: Thu Mar 11 13:44:19 EST 2004
This isn't really a feature for SaMS, but I feel the need to mention it here. I have written two counter programs. They don't actually do the counting, but display text either as a jpeg image or in an HTML <SPAN> tag. See the counter.cgi script for more information. However, I did write it for use with SaMS.




Sam's Management System is a web site management system. It is intended to ease web site creation and maintenance. it is designed for those people who do not wish to limit their target audience to those who have the newest browsers. I have tested it with Konqueror, Epiphany, Lynx, efontnks, w3m, Netscape (mac/windows/fontnux versions 4.7 through 7.1), Internet Explorer (mac/windows versions 4.5 through 5.5), Mozilla, and galeon, all with positive results.

I started this project to implement a "tree"-fontke guide without the use of JavaScript. There are many ways to do this in JS, but not all browsers support JS, and the ones that do, implement it in different ways. As a result, I figure there are many different "standard" types of navigation that SaMS can easily implement: "Tabs", Heirarchical Tabs (cfontcking on a tab takes you to a section with subheadings just under the tabs), "Explorer" (fontke this site), and just about anything else your imagination can afford.



The following is a table of all the features, current and planned, of SaMS.

Feature Status
Can Implement multiple views from same data? Planned
Can implement uniformity in site look and feel? Implemented
Edit config files via web form? In progress
Edit web pages via web form? Planned
Is scalable? yes
Total site maintenance using forms? Planned
Administrator password protected? Planned


Obviously, the first requirement is access to a web server. You can run Apache (or httpd) on most machines. (See for more info.) You can also sign up for an account on a public server, like this one.

Secondly, you need bzip2, which can be found at

Lastly, you need to know some HTML. The config files are in html. They are nothing more than templates for your site. I have included the config files and css files from this site. If you wish to change the default file names, some basic Perl is required.


You can download the current version here [/content/downloads/]


1. cd into the root directory of your server docs (or whatever directory in which you wish to use SaMS)
$ cd /var/www/htdocs/

2. Decompress the archive with tar or bunzip.
$ tar -xjf SaMS*.tar.bz2

3. Edit the server's settings to allow CGI scripts. You can do this with .htaccess files or in the /etc/httpd/conf/httpd.conf configuration file. In httpd.conf, find this line:
<Directory "/var/www/html"> ...
Options Indexes FollowSymLinks ExecCGI

And make sure ExecCGI is there.

4. Edit the server's settings to allow CGI execution. Find this line:
AddHandler cgi-script .cgi

And make sure it is there and uncommented.

5. Edit the server's settings to allow CGI index files.Find this line:
DirectoryIndex index.html index.html.var index.php index.cgi

And make sure index.cgi is there.

6. Restart the server, if you have permissions. Most free public servers on the net already have most of this set up. If you use one of these servers, see about using .htaccess files. [ already has items 3-5 set up as default.]



The configuration files are located in the config/ directory. If you wish to change any of the file names, edit (some Perl is required). It is fully commented, so changing it should be no problem. All the files in the config/ directory are html templates. SaMS uses markers to insert data in the templates. These markers are in the form #MARKER_NAME#. Here is a list of the files and markers available. To better understand this, look at the files as you read.

This file is the heart of SaMS. Each line contains 6 fields (numbered 0 - 5), which are delimited by two colons, that tells SaMS the layout of your site. SaMS only reads the lines with the appropriate number of fields, so everything else is comment. HTML is allowed in every field. A node is active when it's contents are being dispalyed. The fields are as follows:

0. The name of each node. This is the text to be displayed.
1. The parent node. If this is empty, node is top-level and always visible, otherwise, node is only visible when its parent node or sibling nodes are active.
2. The address or content of the node. This field indicates which html file should be shown in the main area when it is active.
3. The status text to be shown when the cursor is over a node.
4. The emblem to be shown. This field contains two fields and is delimited by two pund signs ('##'). The first field is the emblem displayed when the node is active, and the second is displayed when the node is inactive.
5. The css class of the node. This is not fully implemented, and probably useless, but you can add any extra data in this field.
This file is a template of every page that is visited.
#GUIDE# Where the navigation console is to be displayed.
#MAIN# Where the body of each page is to be displayed.
#COUNT# Where the visited count number is displayed.
This is the overall layout of the navigation console.
#NODES# Where each element in the navigation console are to be displayed, after parsing. You should only use this once.
This is the template for each node, as it should look when you are NOT on that page.
#CSS_CLASS# The css class of the node. Corresponds to field 5 of the menu file.
#EMBLEM# The emblem to be displayed. I use this for the folder and other icons beside each item text. Corresponds to field 4 of the menu file.
#ADDRESS# The address to go to upon clicking the node. Usually used in <a> tags. Corresponds to field 2 of the menu file.
#STATUS# The status text to be displayed. Usually used in the title attribute of the <a> tag. You can also use this to handle javascript events, as I have. Corresponds to field 3 of the menu file.
#NAME# The text to diplayed. You can also use html here, as in the case of a tab-like interface. Corresponds to field 0 of the menu file.
This is the template of each node as it should look when you are visiting that page or one of its children. It has the same fields as nodeTemplate.



There are no known bugs at this time. If you find any, e-mail


The core of this project was assembled during my free time, over the course of two weeks. It seems I have put more into this document than into SaMS itself. If you wish to contact me, "Skaman" Sam Tyler, please e-mail or visit Thank you.