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 tags which you can award to users for whatever reason you deem appropriate.

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

Installation
Add the line below to your wiki's MediaWiki:ImportJS page: dev:UserTags/code.js

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
Add this to the Common.js: (source) 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 what is actually shown on the screen afterwards.

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.

You can use any of the following parameters to design your tags: 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 only need to use the  (unknown) field.

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]

GOTCHA: When working with built-in groups that have a hyphen in their name, you must wrap the name in quotes for it to work:

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 'usergroup-' added to the start. 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 use non-English alphabet characters in internal groups since they aren't visible to your wiki's visitors.

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.

Finally, the user masthead itself has the CSS class for the first tag on the line added to it. For example, if the  tag is at the start of the line then you'll find that   has the ' ' class attached to it. You can use this fact to add different colors or background images to the masthead based on what groups the user is in. Note that Wikia tags are at the start of the line by default, locked tags like "Staff" in particular cannot be moved away from the start. This means that Staff users will always receive ' ' even if they hold a local admin position.

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:

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 have not 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 nameslike those in the URL bar, for example:

MediaWiki Groups
This module adds the user's MediaWiki groups to the internal group list, and will automatically download tag text translations for those groups from the server. This module deals with 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 may be useful in Monobook. There are no configuration options, just enable it if you want it:

For more skilled users, you can freely apply custom JavaScript logic if you want to enable this, but only in Monobook:

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: Note that the length of time and number of edits are decided and controlled by Wikia; the module itself does not choose them, and you have no control over 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:

This module also optionally supports a more powerful format that allows you define your own decision logic. You will need a rudimentary understanding of JavaScript to use this, but it let's you define complex relationships like. The namespace parameter here is the same as the first syntax. Note that the  and   parameters do not do anything at all in this second form, they are only used when you do not define a computation function yourself.

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 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 do that (this is equivalent to a gone list). You can also do weird things like adding the  or   group to a user isn't actually either of those things. This module is mildly complex to configure, it maps user names to arrays of groups: Note that the order of groups in the lists here has no effect on how the groups are displayed on the screen, only the associated tag's  parameter matters.

User Filter
This module removes groups from certain specific users, such as if you wanted to remove the  group from someone, or if you enable the   module but you don't want one particular 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:

Implode (Combine)
This module allows you to detect a particular combination of user groups and merge them together into a single group. The idea is to allow you to create "meta-groups" like combining  and   to get "inactive-bureaucrat", or combine   and   to get "half-admin" or whatever else you'd like. As you can see, the format is basically the same as  above except that it does the opposite.

Explode
This module is the same as  above, except without the combination part. That is, the groups you use will not be removed.

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. Oasis displays a blocked tag automatically so UserTags doesn't need to determine that itself normally; as such, this is only particularly useful in Monobook. This module is force enabled in Monobook because of that, unless you choose to manually disable it.

User's Written Language and Programming Skills
This module uses Pecoes' Preferences framework to add tags for the user's declared language abilities and programming skills. It requires Preferences to function so enabling it will automatically pull in the preferences framework on every page. The tags have the form: These are ISO639-1 language codes. Programming languages are displayed similarly:
 * EN-5 (Native English)
 * DE-3 (Advanced German)
 * etc
 * CSS-4
 * JavaScript-3
 * Templates-1

The module has no (administrator) configuration, just set it to true to enable it. Once enabled, users on the wiki can configure their languages and programming skills by selecting "My scripts" from their user account pull-down in the top right corner.

To enable the natural language display:

To enable the programming language display:

Oasis Tags
This module exists internally and is not user configurable. It is only noted here to explain the script's behaviour.

This module's function is to read the Oasis (Wikia generated) tags off the page and interpret what they mean (this is where 'blocked' and the default groups like 'sysop', 'staff', 'vstf', etc. come from in Oasis). It also automatically fetches the [  messages] in both Oasis and Monobook for your convenience when referring to built-in groups with the   module and so forth.

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. If you try to use spaces or hyphens then you will need to wrap the name in quotes for it to work. 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 in 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.
 * — Wikia employees
 * — Volunteer Spam Task Force
 * — Wikia beta testers
 * — Official PR accounts for companies
 * — 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

'''NOTE: UserTags has an internal cache, it may take up to 1 hour for any changes to the above identity groups to actually appear. There may also be glitches like making the Staff tag a link not working at all until the cache is purged.''' [The cache is in localStorage, you can force it to be deleted by clearing your cookies; that is not recommended though]