You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-13Lines changed: 83 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# WSStats
2
-
This MediaWiki extension counts pageviews by user
2
+
This MediaWiki 1.39.x extension counts pageviews by user
3
3
4
+
* Version 2.0.0 : REL 1.39 only. Added statistics for Special Pages. Lua equivalent functions for statistics. Special Page added.
4
5
* Version 1.0.8 : Removed global references
5
6
* Version 1.0.7 : Added statistics over time for pages
6
7
* Version 1.0.6 : Fixed path to sql tables
@@ -22,7 +23,7 @@ This MediaWiki extension counts pageviews by user
22
23
* Version 0.1.2 : Skip usergroup results
23
24
* Version 0.1.1 : Initial release
24
25
25
-
##Installation
26
+
##Installation
26
27
27
28
Create a folder called WSStats in the MediaWiki extensions folder. Copy the content from bitbucket inside this new folder.
28
29
@@ -36,7 +37,11 @@ Run the [update script](https://www.mediawiki.org/wiki/Manual:Update.php) which
36
37
37
38
Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
38
39
39
-
#Configuration
40
+
## Upgrading
41
+
If you are upgrading from a version before 2.0, then you must visit the Special Page : Special:WSStats. If the database tables need updating, it will show you there and you can update the tables.
42
+
You will have to update the tables for statistics to be accurate. This is because we now allow to get statistics based on page titles, while the previous version of WSStats did not store titles.
43
+
44
+
# Configuration
40
45
41
46
By default Anonymous users and sysops are skipped from stats recording. To change this add following to LocalSettings.php..
42
47
@@ -50,6 +55,12 @@ Allow statistics for anonymous users:
50
55
$wgWSStats['skip_anonymous'] = false;
51
56
````
52
57
58
+
By default Special Pages are counted as well. To omit Special pages set the following :
59
+
````
60
+
# Special Pages statistics
61
+
$wgWSStats['countSpecialPages'] = false; // defaults to true
62
+
````
63
+
53
64
To skip users in certain groups, just add the groupname to "skip_user_groups" :
To retrieve statistics you can use the following parser functions :
81
87
88
+
82
89
#### Ask number of hits for page id : 9868
83
90
This returns a number
84
91
```
85
92
{{#wsstats:id=9868}}
86
93
```
87
94
95
+
You can also ask for statistics based on title, instead of Page Id's.
96
+
#### Ask number of hits for page with title : Main Page
97
+
This returns a number
98
+
```
99
+
{{#wsstats:title=Main Page}}
100
+
```
101
+
102
+
About dates. Dates are in a format of YYYY-MM-DD. Internally WSStats works with Date and Time.
103
+
This means a date of **2023-10-30** will internally become **2023-10-30 00:00:00**. You can also search by date and time. See the example about this.
104
+
105
+
88
106
#### Ask number of hits for page id : 714 since start date 2018-02-01
89
107
This returns a number
90
108
```
@@ -100,12 +118,21 @@ This returns a number
100
118
|end date=2018-02-08}}
101
119
```
102
120
121
+
#### You can also get statistics based on date and time Get number of hits for page id : 714 from start date 2023-10-30 14:00:00 and end date 2023-10-30 16:00:00
122
+
This returns a number
123
+
```
124
+
{{#wsstats:id=714
125
+
|start date=2023-10-30 14:00:00
126
+
|end date=2023-10-30 16:00:00
127
+
}}
128
+
```
129
+
103
130
#### Filter results on registered users or anonymous users
104
131
This returns a number
105
132
```
106
133
{{#wsstats:id=714
107
-
|start date=2018-02-01
108
-
|end date=2018-02-08
134
+
|start date=2023-10-30 14:00:00
135
+
|end date=2023-10-30 16:00:00
109
136
|type=only anonymous}}
110
137
```
111
138
@@ -184,4 +211,47 @@ This returns a table
184
211
{{#wsstats:stats
185
212
|unique
186
213
|limit=20}}
214
+
```
215
+
216
+
# Using the lua functions
217
+
New in version 2.0
218
+
219
+
There are two Lua function you can use.
220
+
221
+
For the parser function that returns a table ( {{#wsstats:stats.. ) you can use wsstats.stats().
222
+
223
+
For the parser function that returns a number ( {{wsstats:... ) you can use wsstats.stat();
224
+
225
+
All the arguments are the same as for the parser functions, except :
226
+
227
+
* start date = startDate
228
+
* end date = endDate
229
+
230
+
### Example
231
+
232
+
If you create a Module called WSStats and you add the following content :
0 commit comments