Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RedHat Linux
Web server: IBM WebSphere
Perl version: Perl 5
Client OS: MS Windows XP
Web Browser: IE
Categories: Statistics, Missing functionality

-- StevenElliot - 26 Apr 2007

Answer

ALERT! 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

Change status to:

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-08-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.