wiki:VisitCounterMacro

Display number of page visits

Description

This is a macro that displays how many times a wiki page was displayed.

This macro accepts from one to three parameters, of which only the first is required.

  1. The first parameter is the wiki page name, of which the visit count is to be displayed.
  2. The second parameter determines whether displaying the macro should update the specified page visit count. Accepted values of this parameter are: True, False, true, false, 1, 0. Default value is True.
  3. The third parameter specifies number of digits for visit count display. If its value is 0, then the visit count is displayed as simple text. Default value is 4.

In the trac.ini configuration file you can specify the time in seconds after which the cookie used to store information about visited pages on the client expires. A value of 0 means as long as the session lasts:

[visitcounter]
expires = 0

Examples:

[[VisitCounter(WikiStart)]]
[[VisitCounter(WikiStart, false)]]
[[VisitCounter(WikiStart, True, 3)]]

This will be displayed as follows:

Bugs/Feature Requests

Existing bugs and feature requests for VisitCounterMacro are here.

If you have any issues, create a new ticket.

enhancement

0 / 1

task

1 / 1

Download

Download the zipped source from here.

Source

You can check out VisitCounterMacro from here using Subversion, or browse the source with Trac.

Installation

After installing the plugin's egg, enable it in your environment's trac.ini configuration file or use WebAdminPlugin to do it for you:

[components]
visitcounter.core.* = enabled
visitcounter.init.* = enabled

Then update your environment using:

$ trac-admin <path_to_environment> upgrade

Feedback

Are you using the VisitCounterMacro?
  • Yes, it's useful.
  • No, it's useless.
  • No, I don't need it.

  • You don't have permission to vote. You may need to login.

Change Log

12139 by rjollos on 2012-10-10 03:54:13
Fixed incorrect source code encoding (http://www.python.org/dev/peps/pep-0263/).
8503 by rjollos on 2010-08-29 09:31:32
Renamed visitcoutermacro -> visitcountermacro to fix a typo. Refs #7573.
7931 by Blackhex on 2010-05-04 16:13:41

VisitCounterMacro:

  • Created 0.10 and 0.11 branches.
  • Ported to Trac 0.11, it should work also with Trac 0.12.
(more)

Author/Contributors

Author: Blackhex
Maintainer: none (needsadoption)
Contributors:

Last modified 8 days ago Last modified on Sep 23, 2016, 9:45:21 AM

Attachments (1)

Download all attachments as: .zip