Question
On ANY version of TWiki (even latest is fine) -- is there a way to display a "counter" on a page that shows the number of times that page has been viewed? This is a typical function you see on many internet web pages.
Environment
--
StevenElliot - 26 Apr 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
The typical function you see on many internet web pages is just an embedded image with an
src attribute in which the URL of your page is passed as a parameter. While TWiki has no built-in function of this sort, any of these which are available on the net can be used in a TWiki page.
You can not rely on the fact that TWiki will auto-generate the
<img ... > element for you, but you can explicitly write things like this:
<img src="http://my.hitcounter.com/counter.pl?url=%SCRIPTURL{view}%/%WEB%/%TOPIC%"
alt="123" />
Come to think of it: A plain text version which could be used as a TWiki tag wouldn't be too difficult to write as a plugin. Wait a moment (clickedyclick)....
There's
CounterPlugin - only that it won't work as it is, because it contains hardcoded paths to the author's installation directory in it...
--
HaraldJoerg - 26 Apr 2007
That's great info -- thanks so much for your quick response on this!
--
StevenElliot - 30 Apr 2007
i cleaned up the
CounterPlugin in SVN so that version
should work; however, it is still a pretty crappy plugin.
--
WillNorris - 06 May 2007
Note that CounterPlugin in its current form counts
site visits, not
page visits.
--
VickiBrown - 29 May 2008
It's been a year. Has anyone come up with a working example that you use?
--
VickiBrown - 29 May 2008
Closing this after more than 30 days of inactivity. Please feel free to re-open if needed.
--
PeterThoeny - 02 Aug 2008