[Zope] Counter for Visitors

jhauser@ifm.uni-kiel.de jhauser@ifm.uni-kiel.de
Tue, 10 Aug 1999 16:12:21 +0200 (CEST)


There is some sticky point in this approach. The property is updated
in the database and not changed inplace, so you hold all the old
values also. (This gives the ability to do a countdown just by undoing
:-). If many people use something like this the database grows
quickly. Howard Shaw has implemented a counter-product, so perhaps
look at his code. I can send you a copy in private mail.

HTH
__Janko

But there should be a counter-product on the zope site, or look
Stephan Richter writes:
 > I want to put a little counter on my page.
 > Currently I have the following. Please tell me how good that is:
 > 
 > I declared a property called visitors (integer);
 > I wrote a external method that increases the value of the property:
 > (Is the following code right?)
 > def add_visitor(self):
 >       self.visitors = self.visitors + 1
 > 
 > And a display function:
 > def show_visitors(self):
 >       return self.visitors
 > 
 > Is there a way to do it with DTML only. I do not neccessarily write external
 > methods, but that is the only solution I see.
 > 
 > stephan
 > --
 > Stephan Richter
 > iXL - Software Designer and Engineer
 > 
 > _______________________________________________
 > Zope maillist  -  Zope@zope.org
 > http://www.zope.org/mailman/listinfo/zope
 > 
 > (To receive general Zope announcements, see:
 > http://www.zope.org/mailman/listinfo/zope-announce
 > 
 > For developer-specific issues, zope-dev@zope.org -
 > http://www.zope.org/mailman/listinfo/zope-dev )