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
Contents
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 |
|
1.6 |
|
|
|
1.5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3 |
|
|
|
|
|
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...
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
Copyright
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
- Those numbers do not look right for this wiki... should be higher.
Steve, that macro isn't active on this wiki. MoinMoin runs 1.5.8(see SystemInfo) . We are here at the market place, where everyone could easily contribute code. If that code is mature we can integrate it into the MoinMoin code base. I decided to add it to 1.7 develpoment branch because 1.6 will get currently not more new features as it already has (only bug fixes).
- Ah, my bad. Thanks.
As for VIEWPAGE & SAVEPAGE, I prefer them to be distinct, since you would use the counts for different purposes; every save already incurs a view, anyway (I think). What would be really nice is SAVEPAGE-VIEWPAGE, so you could get a value more like real views (I don't consider views that occur during a round of editing to be real views at all.) Thanks. -- SteveDavison 2007-07-03 10:01:55
I'll check that behaviour later on