Wikipedia:Lua/Modul/Pinging/en
| Vorlagenprogrammierung | Diskussionen | Lua | Test | Unterseiten | |||
| Modul | Deutsch | English
|
Modul: | Dokumentation | |||
Pinging – Module with functions for any kind of user lists, especially for echo pings.
Functions for templates
All functions expect the parameter list from the template transclusion which will embed them. #invoke has no parameters, if not explicitly mentioned. Anything is optional if not explicitly mentioned.
Whitespace ahead and after any content is ignored.
Common optional parameters
All functions listing users (ping, noping, massmessage) support common optional parameters. They may be provided both with #invoke as default for a certain template as well as for a particular transclusion – the latter takes precedence.
- :
- Postfix character/string.
- Default:
: - Empty assignment makes it disappear.
- Terminating or leading
_will be displayed as simple space. - p
- Like
:(legacy). - @
- Prefix character/string.
- Default:
@ - Empty assignment makes it disappear.
- Terminating or leading
_will be displayed as simple space. - /
- Separator character/string.
- Default: like
|_ - Terminating or leading
_will be displayed as simple space. will be turned into line breaks.
ping
Create a list of user page links from a list of nicks, which should trigger echo mention if occurring in a signed section.
- 1
- User nick (no leading
user:). - 2 3 4 5 6 7 8 9 ...
- Any number of user nicks.
- labeln
- Assign different displayed link title to nick n.
- Legacy for enwiki.
- max
0– Do not show error message if maxecho exceeded.- Chose another limit than by system.
- May turn user name list into linklist for other purposes.
- Available for both
#invokeand template transclusion; the latter takes precedence. - Default: Show error if 50 exceeded.
noping
Like ping, but all links as URL. No mentioning by echo, therefore max out of scope.
massmessage
Retrieve a list of recipients from a list of massmessage targets. This function is „expensive“. The usage of expensive functions per page is limited to 500.
- 1
- Source page, one of
- local page name
- heading
#, followed by curid (pageid) surviving page moves.
- Available for
#invokeonly. - Mandatory.
- 2
- List title, will be linked to source page.
- Must not contain links.
- Members will be shown if omitted.
- If
_provided nothing visual will be displayed. - Available for
#invokeonly. - @
- Parameter may be used to show both list title and members.
- max
0– Do not show error message if maxecho exceeded.- Chose another limit than by system.
- May turn user name list into linklist for other purposes.
- Available for both
#invokeand template transclusion; the latter takes precedence. - Default: Show error if 50 exceeded.
- subst
- Requires that
#invokeis directly preceeded bysubst:if set in any mode. - Available for
#invokeonly. - Supposed to be the name of the top including page (template title) which will be shown in error message.
On defining pages, the parser function call {{#target: is supposed to be downcased, with no spaces within.
The parser functions need to be present within the page source itself, not indirectly via templates.
{{#target:Benutzer:PerfektesChaos}}
{{#target:Project:Noticeboard|en.wikipedia.org}}
maxecho
Just tell the current limitation for pinged users by a single edit: 50
failsafe
Version identification on this wiki: 2022-11-14
Examples (test page)
A test page illustrates practical use.
Functions for Lua modules (API)
Some functions may be used by other modules:
local lucky, Pinging = pcall( require, "Module:Pinging" )
if type( Pinging ) == "table" then
mw.log( Pinging.maxecho() )
else
-- error; Pinging contains error message
return "<span class=\"error\">" .. Pinging .. "</span>"
end
If succeeded there are available:
- failsafe()
- Returns string with ID.
- massmessage( args, args2 )
- args – table with parameters for
#invokeas listed above - args2 – optional table with parameters like for a transclusion
- Returns string.
- maxecho()
- Returns string with digits.
Usage
General library; no limitations.
Dependencies
- Mediawiki:Echo-notification-count – Message if number of echo recipients exceeded
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.