Hits was at Sun Jun 10 17:12:16 2007 implemented into 1.7.

The version on this page and the syntax is only for versions before 1.7

Hits Macro

Description

This macro is used to show the cumulative hits of the wikipage where the Macro is called from. Optionally you could count how many times this page or all pages were changed or viewed.

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

Hits-1.6.0-8.py

1.6

Hits-1.5.3-7.py

1.5

Hits-1.5.3-6.py

Hits-1.5.3-5.py

Hits-1.5.3-4.py

Hits-1.3.4-3.py

1.3

Hits-1.3.1-2.py

Syntax

[[Hits([all=(0,1)],[filter=(VIEWPAGE,SAVEPAGE)]]

KEYWORD PARAMETERS

all

if set to 1 then cumulative hits over all wiki pages is returned. Default is 0

filter

if set to SAVEPAGE then the saved pages are counted. Default is VIEWPAGE.

Example

[[Hits]]

[[Hits(all=1)]]

[[Hits(all=1,filter=SAVEPAGE)]]

Now we have [[Hits]] hits on this page.

Or you can use the Frame parser to use alignment and others

{ { {#!Frame align=float:right,background=#aaaaaa
[[Hits]] hits
} } }

{ { {#!Frame align=clear
} } }

Since this macro is not yet installed here, the following example output was captured from a different wiki... Hits1.png

Procedure

It must be in "MoinMoin/macro"

The image was created using the macro on a wiki viewed by konqueror.

Please remove the version number from the file name!

Modification History

@copyright: 2004 by Reimar Bauer (R.Bauer@fz-juelich.de) 
@license: GNU GPL, see COPYING for details.
2004-12-29 RB bug fixed, eventlog is in logfile 
2005-07-15 BenjaminVrolijk, exchange of filename for event-log by getPagePath 
2006-05-01 RB 1.5.3-4 bug fixed for quoting pagenames and some parts refactored
2006-05-02 RB 1.5.3-5 bug fixed, quoting changed to url_quote_plus because of the '+' sign used
                      for a blank in a Wiki Name instead of the '_' in the log file
2006-05-04 RB 1.5.3-6 divid is by now on default ""
                      noframe is default 1
                      if no keyword is used only the value is returned and could be used 
                      in normal text
2006-05-05 RB 1.5.3-7 bug fixed only, pagenames should be counted not referrals
2006-08-16 1.6.0-8 RB:PEP8 and  
                      removed all Keyword Parameters which could be used by the Frame parser 
                      or the wiki markup itself

A refactored version of this routine was added to the 1.7 development branch. This version does go well with 1.6 too -- ReimarBauer 2007-06-10 15:19:11

ReimarBauer

License

Bugs

Discussions

divid was removed because that is now done by Frame.

I'm sure I don't understand the parameters. What I thought the documentation says was that "all" means it counts hits from all pages in the entire wiki, as opposed to just the current page. And the best I could guess for "filter" is that it can separate out saves from views, or by default shows both. (I had to assume on this, since it did not say what happens with filter=VIEWPAGE. Also, is this param required?)

Its not required, default gains

 if not kw["filter"]: kw["filter"] = "VIEWPAGE"

What puzzles me is that in the examples with all=1, the numbers are obviously too small to represents cumulative hits over the entire wiki. So what does all really mean? And does VIEWPAGE include the SAVEPAGE count? Help!!! I mean, Thanks! :) -- SteveDavison 2007-07-03 06:57:39

Ohh, that was a fresh wiki I used for explainaton. If its on MoinMaster we see later real large values. VIEWPAGE or SAVEPAGE could be selected. It filters by that the log entries. Should I add a key for VIEWPAGE + SAVEPAGE ? -- ReimarBauer 2007-07-03 08:00:11

/OldDiscussion

MoinMoin: MacroMarket/Hits (last edited 2009-03-24 17:39:32 by ReimarBauer)