UserTags

UserTags is a script that can add, remove, modify and rearrange the tags on User pages (The "Founder", "Admin", "Blocked", etc. tags that appear next to user's names in their masthead). It allows you to add tags in addition to the Wikia default ones and to rearrange and remove them as desired. You can also invent custom ones to award to users for whatever reason you deem appropriate.

This script replaces InactiveUsers and UserBadges; you should only use one of these 3 scripts to avoid conflicts. This one is the newest and has the most features and customisation options.

Installation
To import the script, add the following code to MediaWiki:Common.js: Or add the relevant row to your existing  call if you have one.

You will also need to add the following CSS to MediaWiki:Wikia.css:

And, finally, add this CSS to MediaWiki:Monobook.css:

This is sufficient for the basic functionality; however, if you want to customise it then you will need to read the Configuration section.

Configuration
This script has a lot of features so the following section is somewhat long. You don't need to use all of them; in fact you can ignore the ones you don't want. You may want to skip to the Examples then come back to read the Core Configuration section.

Core Configuration
The first thing you need to know is that users are divided into "groups", these are things like "blocked", "sysop", "bureaucrat" or "inactive". These are internal names used by the software but they need to be displayed on the screen in the end, to do this they are converted into "tags". Tags describe how the group should look when displayed.

Let's make a simple example, let's say you want to create 3 tags: "Editor of the Month", "Featured" and "Templates Guru". To do this, we will create the groups "montheditor", "featured" and "templates": When creating new groups and tags, this is generally sufficient, except these tags will be placed at the end of the row in the header. Maybe you want to place the tag at start instead, to control the order, you use the  configuration option. The  parameter is a number from negative infinity to positive infinity, lower numbers are closer to the start. In this case  is negative infinity so the tag will be placed at start.

Tags support the following parameters: The male/female/unknown variants exist to support languages other than English, like Italian, that have different nouns for males/females. In English or other languages that don't differentiate on gender, you can just use the  (unknown) field.

Controlling where the Tags are put
The  option allows you to control where the tags are positioned in the Oasis header. By default, they are always placed at the end like the Wikia ones but you are free to change this by specifying a CSS (jQuery) selector for this option. For example, if you would like to place the tags after the H1 (user name), but before the H2 (real name) then you would do this:

Overriding Existing Tags
Sometimes the existing tags may not be adequate for your needs; maybe you want to change the text, order or make them into a link. You can do this by simply defining your own tag for the existing group: This will change the bureaucrat tag to say "Bureaucrat Tag" and turn it into a link to the Project:Bureaucrats page and change the inactive tag so that it says "Has not edited recently" instead of just "Inactive". Alternatively, maybe you just want to make it a link without changing the text, or just change the order, you can do that as well: This will make the bureaucrat tag into a link and move it to the end without changing what it says. [NOTE: Not setting text only works with built-in groups; for your own made-up groups, specifying the text on the tag is not optional]

Styling / Appearance
The script is designed to make it easy to give each tag a different appearance. Every tag has a CSS class based on the internal group that created it with '-user' added to the end. For example, the bureaucrat tag has the CSS class, the inactive tag has the   class and so on. Your custom tags will use the groups you picked, the "Editor of the Month" tag from earlier has the  CSS class.

To change the colors or appearance, simply add a rule to MediaWiki:Wikia.css, like this: This will make bureaucrat tags gold and "featured user" tags blue. You can use any CSS directives you like, including changing the borders, adding background images or whatever. The only caveat is that internal group names will be reduced to plain English, if you have a group like 'asd%$@xyz' then you'll end up with  but there is no reason to non-English alphabet characters in internal groups since they aren't visible to your wiki's visitors.

Finally, all tags that are produced or managed by UserTags are contained within a  element with the   CSS class. You can use this fact to move all the tags onto their own line by setting  to   for example. You can see the effects you can try in the Examples section.

Modules
Now that you understand the basics, we can move on to the actual features. The script is broken into modules which can be turned on and off separately. You don't need to read this whole thing, you may want to skip to the examples then come back to choose which ones you want.

The built-in modules and their configuration options are listed below. It is possible to create your own modules, or to install additional ones created by other developers as well. If you'd like to use a 3rd party module written by someone else then you'll want to read the relevant documentation provided by its developer.

Inactive
This module adds the  group to users who haven't edited within the configured interval. It takes a number specifying the number of days a user must have not edited to be considered inactive: If you have a more stringent set of requirements then you can filter the edits by the namespace in which they were made. For example, if you only consider people who edit article pages to be "active" and everyone else is inactive even if they have edited a talk page or such recently then you can use this configuration format instead: 0 is the main article namespace. The namespaces array can hold multiple values and will accept plain namespace names like those in the URL bar, e.g.

MediaWiki Groups
This module adds the users MediaWiki groups to the internal group list, and automatically downloads translations for those groups from the server. These are formal groups like,  ,  ,  ,  ,  , etc. The sort of things you see in Special:ListUsers. This module takes an array listing the groups you want to include:

Global Accounts Without Edits
This module tags users who have zero edits. It's not very useful in Oasis since you can see the contributions counter in the masthead but it can be useful in Monobook. There are no configuration options, just enable it if you want it:

Newly Registered Accounts
This module tags users who have only recently created their account; that is, they have only been a registered Wikia user for less than 4 days and have made less than 10 edits to any Wiki in the Wikia network. This may be helpful for quickly recognising sockpuppet accounts. Simply enable it if you want it:

New Editors
This module tags users who have not been on your particular wiki for the specified number of days, and haven't made the specified number of edits. This is basically the same as the  module except that it applies to one wiki rather than all of them. It may be useful for recognising meat-puppets, or just new editors who may have been on Wikia for a while but don't know local policies very well. To configure it you can set any of these fields, leaving out ones that you want to keep the default value for:

The parameters are:

Custom
This module lets you attach your custom tags to users. Custom tags are the ones you were shown how to create in the Core Configuration section. You can also attach any other built-in groups if you want, it's entirely acceptable to add the  group to a user as a custom group if you'd like to that (this is equivalent to a gone list), you can also do weird things like adding the   group to a user. This module is mildly complex to configure, it maps user names to arrays of groups: Note that the order of groups in the lists has no effect on the output, only the associated tag's  parameter matters.

User Filter
This module removes groups from certain users, such as if you wanted to remove the  group from someone, or if you enable the   module but you don't want one user to show as inactive even when they are. The format is identical to  above except that the effect is the opposite:

Meta Filter
The meta-filter is a more powerful version of the user filter, instead of operating on user names, it operates on groups. The format is otherwise similar but the effect is much more impressive:

Hide when Blocked
This module removes all groups from users who are blocked, except the  group itself obviously. This module is force enabled unless you explicitly turn it off. Generally you'll want to leave this on as it will stop blocked users from being marked inactive, or as a "new editor" if they haven't met the minimum number of edits before they were banned.

Is Blocked?
This module determines if a user is blocked or not. It's only useful in Monobook since Oasis displays a blocked tag by itself anyway. As such, this module is force enabled on Monobook but not Oasis; in Oasis it will only run if you turn it on manually.

Example
This demonstrates all the modules, it's not particularly practical but you hopefully get a basic feel for how to use it. You create your custom tags inside the  section then add separate configuration blocks for each module you want to use after it. You only need to use the modules you want, you probably don't want all the ones here and you definitely don't want to use this as is.

For a more practical example, here is the default configuration that the script uses internally when you don't set one yourself: Please keep in mind that this default configuration is only used when NO settings are given. It's highly recommended that you copy this entire block into your MediaWiki:Common.js and then customise it from there, adding and removing extra module entries and creating new tags as needed.

Walkthrough
For a walkthrough, I'll show you how to create the tags shown in the image below:

There are 3 custom tags in this image, "JavaScript", "CSS" and "Templates" as well as 2 MediaWiki groups: "sysop" and "bureaucrat". Also take note of the order: the "Administrator" tag is at the start then "Bureaucrat" and so on.

We'll start by configuring the script and add the colors later. The first step is to create the custom groups and tags: Reasonably straightforward, the group names I picked are arbitrary, you can use any plain English name you like (letters A-Z a-z 0-9), although you should remember that it is case sensitive if you mix capitals. This isn't quite enough, we also want the tags to be a certain order as well, so we'll have to add order parameters: This will place all the tags in the order shown in the image, you'll notice I also added a partial tag for the  group, this is because   is a built-in group so it already has text translations which I don't need to change. I don't need to do anything for the sysop group as its order defaults to zero like all MediaWiki groups. Remember that the tags are sorted by their given  values from smallest (start) to largest (end). The numbers I picked are arbitrary, they don't really matter as long as each tag has a different number; tags that have the same  number will be arranged randomly [they'll be in the right place relative to the other tags with different   values, but random with respect to tags sharing the same  ]. There are several specific numbers you may find useful as well:

Now that we have our groups and tags set up correctly, we can move on to actually using them. To use our custom groups/tags, we obviously need to use the Custom module so we'll set that up now: If you've read the description for the custom module, you can see that this adds 3 groups to the selected user. Not terribly difficult, if we wanted to add groups to multiple users then we could just list more of them.

We're half-way now, we just need to add the Bureaucrat and Admin tags. To do that, we'll use the MediaWiki Groups module. MediaWiki Groups asks the server for the user's groups automatically so we don't have to fill in each user's groups manually in the custom lists which would be a tedious waste of time. Pretty simple really. The script will now ask the server for the user's group memberships and automatically add the "bureaucrat" and "sysop" groups if the server says that the user is in them. [It also implicitly retrieves the text translations for the bureaucrat and sysop tags from the server as well, this is where the internal default text comes from]

Finally, we need to set the colors to match what we see the image. To do that, we'll create a couple of custom CSS rules in MediaWiki:Wikia.css. Each tag on the UI has a CSS class based on the group that generated it; for example, the "Bureaucrat" tag has a  CSS class. For our custom tags, the CSS classes will be. And we're done.

The final JavaScript in MediaWiki:Common.js looks like this: Of course, you probably also want to enable Inactive Users and several other modules as well.

Restyling the Oasis Masthead
The above image used the following configuration: The appearance was formed using the following CSS rules:

Full Group List
This is a list of all built-in groups for reference if you want to change the text or avoid accidentally picking an already used name for a custom group:

The following MediaWiki groups are also known to exist so you probably want to avoid these as well unless you are intentionally trying to change what the tags say for them:

Note that all the groups in this second list do not have default text unless you have the mwGroups module configured to look for these. The MediaWiki Groups module will download the tag text on demand only; otherwise, only the default text for groups in the first list will be available to you.

Limitations
Some Wikia generated tags are protected, the following groups may not be added or removed from any user. The tags for these groups will always be kept and will always be left at the start of the row; however, you can make the tags for these groups into links and add hover text to them as normal, only changing the face text and order is restricted.
 * &mdash; Wikia employees
 * &mdash; Volunteer Spam Task Force
 * &mdash; Wikia beta testers
 * &mdash; Official PR accounts for companies
 * &mdash; Wikia interns and contractors

All other Wikia generated tags like "Founder", "Admin", "Blocked", etc can be manipulated normally.

In order to change the face text on the tags for the above protected groups, you can edit the MediaWiki messages on the server that contain the text translation data for them. These messages can be found here: Please give careful consideration and use common sense when editing these; they exist to make Staff and VSTF members easy to find and recognise, changing what the tags say will make that more difficult and confusing for people not familiar with the Wiki.
 * MediaWiki:User-identity-box-group-staff
 * MediaWiki:User-identity-box-group-vstf
 * MediaWiki:User-identity-box-group-council
 * MediaWiki:User-identity-box-group-authenticated
 * MediaWiki:User-identity-box-group-helper