[Zope] counting every document

Jim Washington jwashin@vt.edu
Thu, 26 Apr 2001 08:27:38 -0400


Hi, Marcus

Here's a possible answer:

You could put together a database-backed counter method with the DTML
Documents' absolute_url()s as a key.

The method would be optionally called from the DTML Documents as
<dtml-var doc_counter> or something like that.  It would be on the
acquisition path for your users.

What it would do:

1.  See if the key (absolute_url()) exists in the table, if not create a
new record.
2.  Increment the counter in the table.  You could be fancy about
defining what counts as a hit.
3.  Return the value associated with the key.

I have not actually done this, but it would be my first stab at it.

-- Jim Washington

Marcus Schopen wrote:
> 
> Hi there,
> 
> some users would like to have access statistics
> about each DTML-Document without creating a new
> FSCounter or ZCounter for each new document.
> 
> Is that possible?
> 
> Thank you
> Marcus