Fandom

Wikia Developers Wiki

ListUsers

909pages on
this wiki
Add New Page
Talk0 Share

ListUsers lists users of various groups in the wiki. Similar to ListAdmins, the list is generated via API, and thus does not require any modifications. However, the group can be manually adjusted. Any change in user rights would be automatically amended to the list.

Installation

Add the following to your wiki's MediaWiki:Common.js for site-wide use:

importArticles({
    type: 'script',
    articles: [
        // ...
        'u:dev:ListUsers/code.js',
        // ...
    ]
});

Usage

Any tag, with the class name listusers, and group name as the id would generate a list of users in that group. For instance:

Code Output
<div class="listusers" id="sysop"></div>
  • If the id, that is, the user group is not defined, a message will appear instead of the list: "No user group found".
  • If no users are found in a group (technically, that is not possible as An unknown anonymous user is always present for no users, which is apparently, a bug), another message will be displayed: "No users found in the <usergroup> group".

Configuration

The list can be configured using the listUsers object.

Option Type Values Default
listUsers.talk: Adds a talk link boolean true/false true
listUsers.contribs: Adds a contribs link boolean true/false false
listUsers.editcount: Adds the users actual editcount boolean true/false false
listUsers.limit: Number of results parsed (max. 500) number Any value between 1 - 500 10

The listUsers object also stores custom user groups, which can be added manually.

For instance, if you want the list to be displayed with talkpage and contributions links, your code would look like:

window.listUsers = {
    talk: true,
    contribs: true
}
importScriptPage('ListUsers/code.js', 'dev');

Other options will take the default values.

User groups

A full list of supported user groups, that can be used as valid ids, are (case-sensitive):

  • bot
  • sysop
  • bureaucrat
  • staff
  • vstf
  • helper
  • rollback
  • chatmoderator

Other groups listed in Special:ListUsers have been purposely struck down, but can be added manually if required.

Adding custom user groups

The script supports custom user groups as well. For adding custom user groups, store them in the listUsers.customgroups array. For instance:

window.listUsers.customgroups = ['codeeditor'];
importScriptPage('ListUsers/code.js', 'dev');

To-do list

  • ListUsers.active: Allows the use of .listusers#active, which would list all users active in the last 30 days
    • Implicitly depends upon ListUsers.limit

Updates

September 9, 2014
Script published.

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.