Counter Readme

Complete installation guide for the graphical Counter script.

Version 1.1.1 | Created 10/27/95 | Last Modified 4/25/96

Table of Contents

Overview

This counter script creates a graphical counter in-lined into your page without Server Side Includes.

Files Included
  1. counter.pl - The main counter program
  2. count.txt - Data file holding the counter number
  3. access_log - Log file of accesses
  4. error_log - Log file of errors
  5. html_log.pl - Produces HTML formatted access log
  6. bad_referer.gif - Error image for bad referers

counter.pl Configuration

Place this file in your cgi-bin and chmod it 755.

File and Directory Locations
VariableDescription
$count_file Path to count.txt data file. Don't edit manually - use new_count.pl to change the number.
$digit_dir Directory containing digit images (0.gif - 9.gif). All must be equal width/height.
$access_log Path to access log file. Directory must be chmod 777.
$error_log Path to error log file for timeouts and bad referers.
$flyprog Path to the FLY program. Chmod it 755.
$fly_temp Temporary file for FLY commands.
$bad_referer_img URL to bad_referer.gif image.
@referers Allowed server names (e.g., "host.com","www.host.com").
Image Settings
VariableDescription
$width / $height Width and height of each digit image in pixels.
$tp Transparency color in RGB (e.g., "0,0,0" for black). Set to "X" for none.
$il Interlacing: 1 = interlaced, 0 = non-interlaced.
$frame_width Frame width in pixels. 0 = no frame.
$frame_color Frame color in RGB (e.g., "255,255,255" for white).
$dot Set to 1 to return invisible pixel (logging only).
$logo URL of image to return instead of counter (logging only).
Options
VariableDescription
$max_time Maximum seconds to wait before timeout error (default: 7).
$uselog 1 = enable logging, 0 = disable logging.

count.txt

To start with a different number than 1, open this file and enter your starting number. The script will display this number on the next access.

html_log.pl

Generates an HTML 3 table-formatted document of your access_log.

Variables
$web1 = run from web, 0 = run from command line
$log_filePath to access_log
$min_remoteMinimum accesses for host to appear in list
$min_agentMinimum accesses for browser to appear
$expand_agent0 = group by browser, 1 = show all platforms
$show_percent1 = show percentages
$titlePage title for statistics
$title_urlURL to the page being counted

Command line usage:

html_log.pl > stats.html

access_log and error_log

Place these files where specified in $access_log and $error_log. Both files and their directory must be chmod 777.

Counter Digits

You'll need digit images named 0.gif through 9.gif, all with identical width and height.

Finding Digits
  • Yahoo has many links to counter digit collections
  • DIGIT MANIA - Great counter images collection

After downloading, rename files to 0.gif - 9.gif and note the width/height for configuration.

How to Call the Script

Call the counter like any image:

<img src="http://www.your.host.com/cgi-bin/counter.pl">

You can even use it as a background image (though it may look tacky):

<body background="http://www.your.host.com/cgi-bin/counter.pl">

Version History

1.0 (11/25/95)
Initial release
1.1 (12/31/95)
Updated for new FLY version. Fixed timeout and image deletion issues. Added usage instructions.
1.1.1 (1/11/96)
Small bug fix in html_log.pl
(4/25/96)
Fixed Digit Mania URL
Back to Documentation Counter Overview