扩展:新用户消息

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Extension:NewUserMessage and the translation is 47% complete.

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎中文
MediaWiki扩展手册Manual:Extensions
Crystal Clear action run.svg
NewUserMessage

发布状态:Extension status 稳定版

实现Template:Extension#type User activity, Hook
描述Template:Extension#description 在新创建用户的讨论页添加一条消息
作者Template:Extension#username Nad, Siebrand
最新版本Template:Extension#version 3.6.0 (2016-10-31)
MediaWikiTemplate:Extension#mediawiki 1.26+
PHPTemplate:Extension#php 5.4+
数据更新Template:Extension#needs-updatephp
许可协议Template:Extension#license GNU General Public License 2.0 or later
下载
参数Template:Extension#parameters
  • $wgNewUserSuppressRC
  • $wgNewUserMinorEdit
  • $wgNewUserMessageOnAutoCreate
使用的钩子Template:Extension#hook
AddNewAccountManual:Hooks/AddNewAccount
AuthPluginAutoCreateManual:Hooks/AuthPluginAutoCreate
UserGetReservedNamesManual:Hooks/UserGetReservedNames
LocalUserCreatedManual:Hooks/LocalUserCreated
提供的钩子Template:Extension#newhook
CreateNewUserMessageExtension:NewUserMessage/CreateNewUserMessage

翻译NewUserMessage扩展如果在translatewiki.net可用

检查使用和版本矩阵。

问题Phabricator

开放的工作 · 报告错误

The NewUserMessage extension adds a message to the talk pages of newly created wiki accounts.

Usually after a new user registers on a wiki powered by MediaWiki, the message in MediaWiki:Welcomecreation is displayed. This extension allows a message in a specified template to be added into the new user's talk page instead.

In case LiquidThreads is installed, this extension will create a new thread on the user talk page. See In-wiki configuration for details.

安装

  • 下载文件,并将其放置在您extensions/文件夹中的NewUserMessage目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'NewUserMessage' );
    
  • 配置要求
  • YesY 完成 - 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.26或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension() 如果您需要在早期版本(MediaWiki 1.26和更早版本)中安装此扩展,而不是wfLoadExtension( 'NewUserMessage' );,您需要使用:

require_once "$IP/extensions/NewUserMessage/NewUserMessage.php";

配置

全域变量

There are some global variables which affect the operation of the extension. These should be set in your LocalSettings file after the require_once of the NewUserMessage.php script.

变量 默认值 含义
$wgNewUserSuppressRC false Specify whether or not the new user message creation should show up in recent changes. If set to true, those edits won't be displayed even if "show bot edits" is selected on RecentChanges or Watchlist.
$wgNewUserMinorEdit true Should the new user message creation be a minor edit?
$wgNewUserMessageOnAutoCreate false Should auto creation (CentralAuth) trigger a new user message?

In-wiki配置

Other settings of the extension can be made in the MediaWiki: namespace.

页面标题 默认值 含义
MediaWiki:Newusermessage-template Template:Welcome Specify a template to wrap the new user message within. You can create translations (e.g. MediaWiki:Newusermessage-template/es) that will be used when the registered user has set a different interface language on registration (this is possible through &uselang parameter or more easily through login language links).
MediaWiki:Newusermessage-template-subject Template:Welcome-subject Specify a template to wrap the new user message thread subject within. Only used when LiquidThreads is installed and active on user talk pages. Always preprocessed and substituted by the parser.
MediaWiki:Newusermessage-template-body Template:Welcome-body Specify a template to wrap the new user message thread body within. Only used when LiquidThreads is installed and active on user talk pages.
MediaWiki:Newuseredit-summary Adding [[welcome message]] to new user's talk page Edit summary for the recent changes entry of a new users message. Always in content language.
MediaWiki:Newusermessage-editor New user message Set the username of the user that makes the edit on user talk pages. If this user does not exist, "MediaWiki default" will show up as editing user. The user set here is marked as reserved and won't be able to login!
MediaWiki:Newusermessage-signatures None Optional feature. if it exists and contains a list of user names (* signature newline * etc…), these user names will be added after the template (randomly) along with the date and time. This feature is inactive when LiquidThreads is installed and new user messages are posted as threads.
MediaWiki:Newusermessage-substitute‎ None Optional feature. If the page exists and contains any text (but spaces or a single dash ("-")), the welcome template will be substituted in the talk page.

Note that these items are articles, to edit them go to the article in your browser and edit the text accordingly.

Example NewUserMessage page

A very simple example of the page you should create as Template:Welcome:

== 欢迎来到我们的Wiki ==
Hello {{{name}}} ...

模板参数名

  • {{{name}}}:用户名
  • {{{realName}}}:真名(可以为空)

Example NewUserMessage pages with LiquidThreads

主题

A very simple example of the page you should create as Template:Welcome-subject:

Hello {{{name}}}

This message will be used as the thread subject — preprocessed and substituted. If this page is empty, this extension will not do anything when LiquidThreads is installed.

模板参数名

  • name:用户名(如果用户在注册时使用真实姓名)

Body

A very simple example of the page you should create as Template:Welcome-body:

欢迎来到我们的Wiki,{{{realName|{{{name}}}}}}

This message will be used as the thread body. It will be substituted if MediaWiki:Newusermessage-substitute‎ has contents. If this page is empty, this extension will not do anything when LiquidThreads is installed.

Please note that the {{{realName|{{{name}}}}}} syntax currently does not work. As a workaround {{#if: {{{realName|}}} | {{{realName}}} | {{{name}}} }} may be used if the ParserFunctionsExtension:ParserFunctions extension is available.
模板参数名
  • name:用户名
  • realName:用户真名

复刻

This extension adds one new hook:

See also