[Zope] Counters

Shaw, Howard ShawH@STHS.org
Wed, 24 Mar 1999 13:27:44 -0600


I remember noticing various comments on the list bemoaning the lack of
some sort of counter. I also remember noticing the objections which were
raised, and why counters weren't feasible. I don't remember reading
these objections, which may be why when I found a need for a counter, I
sat down and wrote one. I now have a working Counter product which
provides a <!--#counter--><!--#/counter--> tag .

It includes the ability to have multiple non-incrementing displays of a
counter, and the optional ability to render the individual digits using
a supplied template, thus allowing graphical counters of whatever sort
you feel like using. The counter uses a long property in the containing
folder, so you can manually set the counter to whatever you want. 

It also provides the optional capacity to have a short 'memory' of
recent IP's, preventing the 'running up' of the counter by scripts or
massive reloading (well, makes it more difficult anyhow). 

The template is supplied with variables which indicate the position of a
given digit in the list (it is wierd, it works from back to front, since
it uses modulus) including whether the particular digit is the first,
etc. 

If someone will supply me with instructions on how to package the
product, and how to upload it, I will be happy to make it available.

Thanks are due to tsarna@endicor.com, on whose product this was based,
and to Jim Fulton and Philip Aylesworth for answering my questions.
Howard C. Shaw III
Programmer/SysAdmin
St. Thomas High School