Fandom Developers Wiki
Advertisement

本页面或其中部分内容仍未翻译。请将其翻译为适当的语言(中文(简体))。

ListUsers 列出 Wiki 中各个组的用户。与 ListAdmins类 似,列表是通过API生成的,因此不需要任何修改。但是,你可以手动调整该组。用户权限的任何更改都将自动修改到列表中。

安装[]

使用方法[]

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".

配置[]

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
}
importArticle({
    type: 'script',
    article: 'MediaWiki:ListUsers/code.js'
});

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
  • soap
  • rollback

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'];
importArticle({
    type: 'script',
    article: 'MediaWiki:ListUsers/code.js'
});

Excluding user groups[]

Users in additional user groups may be excluded through the addition of several custom classes:

Class Exclude
LU-exclude-bot Bot
LU-exclude-bureaucrat Bureaucrat
LU-exclude-content-moderator Content Moderator
LU-exclude-rollback ⧼userprofile-global-tag-rollback⧽
LU-exclude-staff Staff
LU-exclude-sysop Administrator
LU-exclude-threadmoderator Thread Moderator
Advertisement