Albedo Systems


Albedo contact details: Albedo Systems Ltd; 268 Amhurst Road; Stoke Newington; London N16 7UP; t - 020 7923 2267; e - information@albedo.co.uk

Home pagePortfolio: clients and case studiesSite mapAlbedo contact detailsMiscellaneous writings and codeDownloadable softwareA few useful links

 


CFX_COUNT page hit counter


How to make use of the multi-featured CFX_COUNT page hit counter.



Copyright Albedo Systems Ltd 1997-2004

CONTENTS

SUMMARY


CFX_COUNT is an extension tag to Allaire's Cold Fusion active web page language, written in C++, that allows the use of easily tailored graphic counters within Cold Fusion web pages. As such it makes use of Tom Boutell's excellent GD1.2 GIF graphics library - for more information on this see http://www.boutell.com/. Please try to credit, or link to the boutell.com site somewhere, because they really deserve it. It is recommended that the tag designation be CFX_COUNT.

NEW FEATURES


Note: If you have previously downloaded version 1.0 of this program, released in August 1997, you may still wish to install this version. Besides a number of new features, its performance has been enhanced to put less strain on your server.
  • Any size of font can be used.
  • Specify foreground/background colour for counter.
  • Background can be transparent.
  • Any number of digits up to 20 can be specified.
  • Leading zeros can be removed.
  • Use of a log forbid file is now optional, allowing use for more than just a web page counter.
  • Digits are now cached, so that the counter only loads the numeric gifs it needs.
  • CFX_COUNT now returns the output gif width and height and the access count to the calling program.

CONDITIONS


Cfx_count is freeware. As such, it may be freely distributed in the form of this zip file, provided this readme file is retained. All technical queries, bug reports etc. with regard to its use should be addressed to admin@albedo.co.uk.

We'd, of course, appreciate it if you credited us/linked to us, but you know you don't have to. We'll be doing more stuff soon, so please do drop by our website at http://www.albedo.co.uk/

INSTALLATION


The zip file that contains this file should contain:
  • readme.htm: this file.
  • readme.txt: text version of this file
  • cfx_count.dll: the Cold Fusion extension dll
  • count.txt: specimen count file
  • count.gif: specimen output gif
  • 0.gif to 9.gif: Ten numeric gifs to get you started. Put them all in an appropriate directory. (With a graphics package you can make your own.) Please note that the version 1.0 white-on-black digits may not work too well with this version - this time (as you'll see later) digits must be black-on-white.
To get started, decide, or get your server admin person to decide, where you are going to put extension Cold Fusion tags on your server, then put CFX_COUNT.dll in that directory. Then fire up the Cold Fusion administrator program, click on the 'cfx tags' tab or button, then click on Add. Enter your chosen name (we recommend CFX_COUNT), and make sure the library is not persistent in memory.

USAGE


Here's an example, with all the attributes on separate lines to make it clear... (Bear in mind that not all of these parameters are mandatory).

<CFX_COUNT
COUNT="f:\webs\mysite/data/mycount.txt"
FONT="f:\webs\mysite/fonts/CNT_tn24/"
GIF="f:\webs\mysite/htdocs/art/mygif.gif"
LOG="f:\webs\mysite/data/mylog.txt"
IP_ADDRESS=#CGI.REMOTE_ADDR#
DIGITS=6
BGCOLOR=##0000FF
FGCOLOR=##FFFF00
TRANSPARENT="NO"
ZEROS="YES"
>

...which can then be followed some time later with, for example...

<CFOUTPUT>
<IMG SRC="../Art/mygif.gif" WIDTH=#count_width# HEIGHT=#count_height# BORDER=0 ALT="#count_total# accesses since 1 Jan 1901">
</CFOUTPUT>

...depending on where your site root directory is.

Taking the last first, note that #count_width# and #count_height# are variables returned by the tag that hold the true width/height of the output gif. If you are using these names they will be overwritten. Similarly, #count_total# is the count itself.
But to the parameters...

COUNT (mandatory) path specification for the text file containing your access count. This is just a simple ascii file containing the number.

FONT (mandatory) points to the directory containing your chosen numeric font. Don't forget the trailing slash.

GIF (mandatory) is the path specification for the output GIF.

LOG (optional, defaults to nothing). If you choose to keep a forbid log, this is the path specification for it. The log keeps a list of IP addresses that have accessed the page with the current hour - the program will not increment the counter for the same IP address twice within that hour.

IP_ADDRESS (optional, defaults to nothing). The current user IP address, for use in the log.

DIGITS (optional, defaults to 6) Simply the maximum number of digits in the count.

BGCOLOR (optional, defaults to 000000 (black)). Background colour for the text, expressed as ##rrggbb hex value. Note the Cold Fusion double hash.

FGCOLOR (optional, defaults to FFFFFF (white)). Foreground colour for the text, expressed as ##rrggbb hex value. Note the Cold Fusion double hash.

TRANSPARENT (optional, defaults to "NO"). If set to "YES" makes the gif's background colour transparent. You may still want to set the BGCOLOR to something similar to your page background, as this will give your text better anti-aliasing.

ZEROS (optional, defaults to "YES"). If you wish to suppress leading zeros, just put "NO" here.

A WORD ON FONTS


Bear the following in mind.

  • Use a decent graphics package that anti-aliases the fonts properly.
  • Each character can be any width and height - the program handles all sizing automatically, but remember to include a full set from 0.gif to 9.gif.
  • All characters for a given font must be in the same directory.
  • Very importantly - if you want to recolour the fonts, they must be created as black on white. Otherwise use of BGCOLOR and FGCOLOR will have strange results. It may also be helpful to make the white background transparent.
  • If all else fails, we may be persuaded to create a custom font. We're busy and it's a rather dull task (i.e. grease our palms).

OTHER ALBEDO TAGS


If you liked this, check out our CFX_FONT tag, downloadable from http://www.albedo.co.uk/goodies/cfusion.cfm. It allows you to create masses of anti-aliased text graphics and has oodles of options.

Use and enjoy.

Fin Fahey
Fiona Daly
January 31 2004

LEGAL DISCLAIMER


Neither Albedo Systems Ltd. nor anyone else who has been involved in the creation, production or delivery of this product shall be liable for any direct, indirect, consequential or incidental damages (including damages for loss of business profits, business interruption, loss of business information, and the like) arising out of the use or inability to use this product even if Albedo Systems Ltd. has been advised of the possibility of such damages.

| Home | Folio | Sitemap | Contact |
| Texts | Downloads | Web links |

Page last modified: 07 Aug 2005

Valid HTML 4.01!