WWW Page Access Counter at NJIT

Plainspeak Abstract

How to put stuff into your Web-pages so you can use NJIT's counter.

Why does this page load so slowly?

This page has dozens of examples and takes a few kilojoules to get across the Internet. Click your Stop icon and/or disable the Auto Load Images if you want this page faster. Each example is hardly 1K or so, but each is loaded separately. This page makes use of proposed HTTP3.0 markups and is best viewed with Netscape version 1.1N or later, or an equivalent browser.

Introduction

A service is available for the NJIT community access counts for WWW pages. Complete details of the program are provided by the author, Muhammad A Muquit, in http://www.fccc.edu/users/muquit/Count.html. The program, called Count.cgi, provides very nice on-the-fly graphics to show the counts, such as , or the display can be hidden.

Authorization

Availability is limited to students, faculty, and staff at NJIT, and counting can only be done for documents that reside on a Web server at NJIT. You must also send mail to me, walsh@njit.edu. This step will be automated if response merits. In my response to your authorization I'll provide you with a "datafile" name. For the time being, you can freely use sample.count for your datafile wherever it's mentioned in this document.

Precautions

Access and specifications are unfortunately subject to change without prior notification. The count value itself can only be considered approximate, as it is not possible to account for cached access of pages, bad access to the counter itself, and other tough luck. Too much use of counters in your documents slows down access. This document has dozens, which is why it loads so slowly.

Simplest Form

Put a line like this in your HTML document:
<img src="http://counter.njit.edu/Count.cgi?df=sample.count">
Use the file name given to you in the "Authorization" step above instead of sample.count.

How to Get Really Fancy Digits

This counter makes use of the average Web browser's ability to display embedded graphic images, and neat gizmos on many servers known as the cgi-bin programs.

So you must use the HTML markup for embedded graphics,

<IMG SRC=image_comes_from>
In which case do this to use the NJIT counter:
<IMG SRC="http://counter.njit.edu/Count.cgi?parms">
in which one of the parms must be
df=sample.count
or the name you were authorized with instead of sample.count. Each of the parameters specified must be separated with a verticle bar, the | symbol, or by an amperstand, the & symbol. The params can be any or all of the following:

ParameterNameDescriptionExamples Default
ft=X Frame Thickness You can wrap the counter in an ornamental frame of X pixels thick. Use 0 for no frame. Values over 5 make a nice 3-D effect.
ft=7
ft=0
No frame
frgb=R;G;B Frame Color Specifies the color of the frame in RGB (red/green/blue) format. Each color component, R, G, and B is specified as a value between 0 and 255. If you use ft=# without a frgb= param, the default color is used.

If you specify a frgb= without a ft=#, then the frame thickness defaults to 5. All the examples show ft=5.

Knowing the RGB sequence for a given color is not always for most of us regular folks, but Count.cgi does provide a way to find the values for a given color. Refer to the rgb.txt paragraph in the Additional Tricks section below.


frgb=69;139;50

frgb=255;0;0

Default
frgb=100;139;216
Cyan
tr=B Transparency On/Off You can specify if your counter image will have a transparent color with the Boolean B. So tr=Y means there will be a transparent color; and tr=N means there will not. It does not matter if the GIF files used for the digits are "transparent"; as is shown next, you must specify explicitly which color to make transparent.

If you specify a trgb=, then you do not need to specify tr=Y.

Valid values for B are Y, N, T, F, 1, or 0.


tr=N

tr=Y
tr=N
No transparency
trgb=R;G;B Transparent Color Here you specify the color to render as transparent, given in red/green/blue format.

When you provide a trgb=, you can skip the tr=Y; it is automatically turned on for you.

For additional info regarding RGB (red/green/blue) format, refer to the rgb.txt paragraph in the Additional Tricks section below.


trgb=0;255;0
(green)

trgb=0;0;0
(black)
frgb=0;0;0
Black
md=X Max Digits Defines maximum number of digits to display. Any value between 5 and 10 inclusive are permitted. Padding with leading zeros is automatically done for you; longer counts are truncated to the given X.
md=5

md=5
Truncation of 9 digit value
md=10
Without padding
pad=B No Padding Turn padding on/off in conjunction with md= setting.

Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0.

(There are some bugs in the padding feature, as shown in the examples. These will be fixed shortly.)


pad=Y
With default md=10

md=5&pad=N
No padding value shorter than max 5.

md=5&pad=N
Truncation of 9 digit value without padding.
pad=N
Without specification of a md= value


pad=Y
With specification of a md= value

dd=A Digits Dir Denotes what style digits will be used. The examples show all those currently installed.
dd=A

dd=B

dd=C

dd=D

dd=E

dd=chinese

dd=cd
dd=A
wxh=W;H Digit Size This is used to specify the width and height of an individual digit image in pixels for character set used. As you can see in the examples for the dd=option, the default size is fine. The exception is dd=D, which is slightly smaller.

This parameter will be obsolete with the next release of WWWcounter; sizing will be automatically done up for you.


dd=D
Default size is wrong for style "D"

dd=D&wxh=9;13
Correct!
wxh=15;20
Correct for styles A, B, and C
st=X Start count Used to set the initial value of the counter to some number X. This is only valid if you are allowed to create a new counter file. (This space intentionally left blank.) st=1
Count starts at one
sh=B Show digits Used to turn display of digits on or off according to the Boolean B. When sh=T, digits are shown as in most of the examples given here. If sh=F no digits will show, but the counter will still increment; instead of digits a transparent 1x1 GIF is displayed.

Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0.


An invisible counter is above!
sh=Y
Display digits
df=file Data File for counting Specifies the name of the file for storing the count in. The file must be allocated to you as was mentioned in the "Authorizations" section above. You can use df=sample.count for testing and so on, but of course the value in it is not reliable.

One special use of the parameter is df=RANDOM. This returns a random number using the fractional portion of the host's time of day clock as a seed for the generator.

Unlike all other WWWcounter parameters, the file name provided is case-sensitive, except for the value random. Or Random, or rANDOM, etc.


A random number
df=RANDOM
Roll of the dice!
incr=B Increment count Makes it possible to display the current count without incrementing the count. This can be used to examine the count for reporting or other purposes without adding to the count.

Valid values for the Boolean parameter B are Y, N, T, F, 1, or 0.


incr=F&df=sample.count

incr=F&df=sample.count
The count does not go up, unless due to someone else accessing the counter at the same time as you are.
incr=T
Increment count on each invocation.
lit=X Display literal Makes it possible to display a given, predetermined value.

Valid values for the string X are digit.


lit=123
Almost all the examples on this page are made with lit=X
None

Additional Tricks: Alignment

Alignment of the GIF image into your text is pretty random looking unless you control placement with the ALIGN= attribute of the <IMG> markup. You can check http://www8.netscape.com/assist/net_sites/html_extensions.html for details on how image alignment might be done in HTML-3, being as it looks like what Netscape did is going to become the standard.

Or you could skip looking at it and just try:

<IMG SRC="stuff shown above" ALIGN=ABSMIDDLE>
It aligns the image with the middle of the current line of text, which is what you'll probably want to do.

Additional Tricks: RGB

The use of red/green/blue (RGB) values for describing colors is pretty common in such places as X-windows programming, tweaking GIF files, necromancy, and other places where regular people like myself should not tread. To get by this a gimmic has been added to WWWcounter so that mere mortals can connect a humanistic color such as "gold" to the corresponding RGB secret code. This makes use of the installed rgb.txt file common with Xwindows, which can vary by local. One solution available to you is to check this list of RGB equivalents, which I think is the X-consortum version.

The NJIT installation of the WWWcounter will not let you use specifications such as "gold", as this is quite time consuming when large numbers of lookups are done. But it will look up the value for you:

<img src="http://counter.njit.edu/Count.cgi?frgb=gold">
This results in an error message such as:
Take the RGB value given to make your markup appear as:
<img src="http://counter.njit.edu/Count.cgi?frgb=255;215;0">
Which results in a "gold" frame:

Good Luck!

/KJW
walsh@njit.edu /KJW disclaimer