[ZDP] Counter

SRichter@ixl.com SRichter@ixl.com
Fri, 11 Feb 2000 15:23:11 -0500


 * I've turned cookies off, because it gave some strange results when
reloading a page (ie. turned back to 0). Maybe Stephan can have a look
at
its class again?

I will. I have a lot of feedback from other people. I will publish a new
version as soon as I can. It will be published as fwCounter, since it will
be easier, if my company supports it (basically, I get paid to work on it :)
).


* One main problem of the counter is that, when Zope is restarted, it
looses it's value :-(. Perhaps, we need to find another solution to
ZCounter. Is it possible to save the value to a place on a hard-disk?
And
that the Class always looks at this value?

There is a python hack you can do. I have a patch file to ZCounter in my
mailbox fixing that. 


* We can extend ZCounter to a text-based (what-it-is-now) and graphical
counter (what it isn't yet). We could make it so, like ZCalendar-Tag,
where
the pictures of the calendar-parts are placed in a directory. Thus
changing
these pictures also changes the look of the calendar! -> In ZCounter, we
add 10 pictures, named (0 .. 9) which are then used to build the
counter.
Does somebody knows how to write in Python something that takes the
count-value and changes it to a string. Then takes the first char of the
string and looks for a file named this char?

That is very easy to do and also on my list for ZCounter. I did that several
times in python with CGI.

str_counter = str(counter)
html = ''
for x in len(str_counter):
    html = html+'<img src="num%s.gif" border="0">' %str_counter[x]

See you guys soon ( I am in Oregon working ...).

Stephan