Fandom Developers Wiki
(Undo revision 19381 by RyaNayR (talk))
Line 24: Line 24:
 
'User4': 'Rollback',
 
'User4': 'Rollback',
 
'User5': 'Custom Tag'
 
'User5': 'Custom Tag'
  +
}
 
};
 
};
   

Revision as of 21:47, 20 May 2014

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.

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',
    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 such:

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 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: Template:ImportArticles

Updates

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

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