UserActivityStates automates a user's current activity state. Along with other scripts such as User Avatar Finder, it is particularly useful for the creation of administrator templates for your wiki.
Installation
Install template
Configuration
You can create many different user states, such as "active", "semi active" or "very active", and different conditions a user must meet to be marked as a particular state. For instantaneous customization that bypasses the review process, the MediaWiki:Custom-User-Activity-States.json page on your wiki can be used. You can copy the example below and paste it into the page on your wiki and customize it to your liking:
{
"namespaces": [
0
],
"inactiveText": "Inactive",
"states": {
"veryActive": {
"text": "Very Active",
"dayRange": 14,
"minContribs": 50
},
"active": {
"text": "Active",
"dayRange": 30,
"minContribs": 10
},
"semiActive": {
"text": "Semi Active",
"dayRange": 60,
"minContribs": 1
}
}
}
Alternatively, you can place the following code into the MediaWiki:Common.js page on your wiki, again customizing it to your liking:
window.userActivityStates = {
namespaces: [
0
],
inactiveText: "Inactive",
states: {
veryActive: {
text: "Very Active",
dayRange: 14,
minContribs: 50
},
active: {
text: "Active",
dayRange: 30,
minContribs: 10
},
semiActive: {
text: "Semi Active",
dayRange: 60,
minContribs: 1
}
}
}
CSS customization
You can customize the way a user activity state appears through CSS. To apply the styling to every user activity state, use the .user-activity-state selector. To apply it to a particular user activity state, use the .user-activity-state-NAME_OF_STATE selector, replacing "NAME_OF_STATE" with whatever state you want to customize (e.g. .user-activity-state-inactive for "inactive", .user-activity-state-veryActive for "veryActive", etc.)
Configuration notes
- If you choose the JSON page for configuration, JSON keys and string values must start and end in double quotes ("). Make sure that the JSON is properly formatted, as any JSON errors will cause the script to not work!
- If you choose to use your MediaWiki:Common.js file for configuration, it must first be reviewed and approved before going live, which can slow down any changes you wish to make.
- In either case, the highest levels with the strictest requirements must be above the lowest levels with less strict requirements. For example, "veryActive" needs 50 contributions in 14 days while "active" needs 10 contributions in 30 days. Since "veryActive" is more strict than "active", "veryActive" must be above "active".
- You can specify namespaces a user must contribute to with the namespaces array. You can optionally leave this blank so that it'll calculate a user's state irrespective of any namespace. For a list of namespace numbers, see Help:Namespaces.