Reston Runners
Home | Schedule | Courses | Photos

Our New Automated Home Page

Routine updating is a major problem for webmasters, especially social clubs like the Reston Runners who must rely on part time volunteers. For example, our home-page is changed about 75 times per year. It is very time consuming to make changes and then test everything with all the widely used browsers, several screen sizes, operating systems, etc. As a practical matter, every combination can't be tested. So, the webmaster must rely on visitors to report problems.

The solution to this problem is to separate the page design from the content. Our new home-page uses this technique. The design of the page is fixed and only the content [the words and images, etc.] is changed. Thus, when changes are now made, the webmaster can be relatively certain the home-page will display properly for all visitors without having to go through the exhaustive test phase.

Everything discussed here involves the use of server-side script coding. This code does all the work and sends the finished page to your browser for rendering.

So what exactly is "fixed" and what is "content"? Take a minute and backup to the home-page to refresh your memory and then return here. Everything having to do with appearance and location is controlled by the "fixed" code. There are 3 main columns.

When a visitor opens the home-page, the code renders all of the fixed stuff and then fetches the "middledate.inc" file and renders it in the "News & Information" column. The code then does a bit of special logic for the "Commentary" column.

Next, we'll explain the special logic, which you may find interesting. First take a moment and go to this link: Stats & Chat Archive. Then return here. There you saw a simple list of the Stats & Chat issues. This list is maintained in a simple plain text file [chattoc.inc] that also contains some code that keeps track of the file name of the latest issue. The archive page generates a table of contents (TOC) from the list automatically.

The code in the Home-page gets the file name of the latest issue from the chattoc.inc file. It then sends the contents of the issue file to your browser for rendering in the "Commentary" column.

Often the Commentary column gets a bit long for the home-page. So, we added a special bit of code to handle it gracefully. The Stats and Chat files actually contain two sections, the stuff that is to appear on the home-page and the balance that will appear on a "Continuation" page. Code in the home-page checks to see if there is any continuation text in the current issue of Stats & Chat; and if there is, displays a "Continue....." link at the bottom of the column. When you click the link, you are sent to a special page that renders the "continuation" stuff from the current issue.

In summary:

The code in the home-page and "Stats & Chat Archive" page automatically uses the changes, additions or replacements.

Here's how the "Dates" section at the top of the "News & Information" column works. The webmaster maintains a page [file] of what's new on the site. The Home-page code reads the "last-modified" date of the file and displays it as the date and time (to nearest hour) when it was last updated. And, here it is:  

The second date is

is generated in the following way. When you visit the Home-page, the code sends the current date and time in a "cookie" to your browser. If your browser is set to accept cookies [which is normal] it saves the values in a file in your cookie folder. The cookie handling system of your browser is very secure. Our cookie contains only the date & time of your visit; your browser will send that information back only to the site that originally sent it. When you again visit, our code asks your browser if it has a cookie saved for the Reston Runners and if so to send the date & time. If the Home-page code receives a date & time, it displays it.

Webmaster note: Thanks to Al Rider for designing this Web-site automation code for us.

Questions or Comments?