FANDOM


For "tags" on user profiles, see UserTags.

MessageWallUserTags allows you to add a customizable "tag" to names which appears at the top of Message Wall posts from specified users. It can be used to mark messages by admins, bureaucrats, founder, etc. It can also be used for any other purpose, such as user-of-the-month, etc.

Note: This script will work with the FANDOM forum system as well.

Installation

To add this script on your wiki, place the following code into your MediaWiki:Common.js, and change 'user1', 'user2' etc to the names of users you want tagged, and 'usergroup' etc to the text you want to appear, such as Admin, etc:

window.MessageWallUserTags = {
    tagColor: 'red',
    txtSize: '10px',
    glow: true,
    glowSize: '15px',
    glowColor: '#f77',
    users: {
        'username': 'usergroup',
        'User1': 'Founder',
        'User2': 'Bureaucrat',
        'User3': 'Admin',
        'User4': 'Rollback',
        'User5': 'Custom Tag'
    }
};
 
importArticles({
    type: 'script',
    articles: [
        //other scripts,
        'u:dev:MessageWallUserTags/code.js'
    ]
});

There are also several other options you can tweak, such as the color of the tag (tagColor), whether or not it will glow as well as the size and color of the glow (glow, glowSize, and glowColor).

You may also specify multiple tags per user, like so:

window.MessageWallUserTags = {
    //...other options...
    users: {
        'username': 'Bureaucrat • Admin • Something Else',
    }
};

They can be separated by bullets, commas, or any other character of your choosing.

If you have usernames with spaces in them, replace the spaces with underscores ( _ ). Be sure that each name and group/text has quotes around it, and a comma at the end of each line except for the last line. If a name contains an apostrophe ('), you will need to surround that name with double-quotes (") instead of single-quotes (').

If you have an existing importArticles() call, you can just place 'u:dev:MessageWallUserTags/code.js' at the bottom of the list (with a comma at the end of the second-to-last line). If you put it elsewhere in the list, don't forget to add a comma at the end.

If you don't have an existing importArticles() call, you can just copy/paste the above code into your MediaWiki:Common.js (just be sure to keep window.MessageWallUserTags = {...} above importArticles()), however it is recommended to read the following instructions/guidelines:

importArticles — Best Practices for installing JavaScript on FANDOM
The importArticles statement is designed to combine multiple HTTP requests into a single data transfer, allowing multiple scripts to load and execute faster. If you've been installing several different scripts, your JavaScript file has probably accumulated unnecessary import statements. Click "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner. One other approach is by using the MediaWiki:ImportJS.
If your JavaScript file has several lines of code that say importScript, importScriptPage, or importArticles, you may be able to combine them! By batch importing a collection of scripts with a single import, your JavaScript code will load faster and look cleaner. Consider the example below. On the left is an example of what your JavaScript file might currently look like. On the right is how you could improve that code.
Multiple imports — messy and slow One import — clean and efficient
importScriptPage('AjaxRC/code.js','dev');
 
importScript('MediaWiki:localScript.js');
 
importArticle({
  type: 'script',
  article: 'u:dev:FloatingToc/code.js'
});
 
importScriptPage('page1.js', 'wikiname');
 
importScriptPage('page2.js', 'wikiname');
importArticles({
    type: 'script',
    articles: [
        'u:dev:AjaxRC/code.js',
        'MediaWiki:localScript.js',
        'u:dev:FloatingToc/code.js',
        'u:wikiname:page1.js',
        'u:wikiname:page2.js'
    ]
});
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.
But there's much more to importArticles than just this! For more examples and advanced usage, see the help page at Help:Including additional JavaScript and CSS.

Updates

All updates and improvements are welcomed! If you make any major changes please list them below in descending order (newest on top).

2 March 2017
Wikis using a non-English language are now supported. — OneTwoThreeFall
3 February 2016
Text size can now be specified using txtSize. Default is 10px if not specified. — SuperSajuuk
18 September 2014
The script will now work with posts made on the FANDOM forum system. — SuperSajuuk
10 September 2014
Glow colour is now customizable.— Auron
11 May 2014
Added additional options, revised code, and added code comments. — RyaNayR (diff)
8 February 2014
Added option to specify color. — RyaNayR (diff)
8 February 2014
Initial release — RyaNayR

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.