Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Check blp parameter/sandbox
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
require('strict') local p = {} p.main = function(frame) local args = frame:getParent().args local yesno = require('Module:Yesno') local current_title = mw.title.getCurrentTitle() local pagetype = require('Module:Pagetype')._main{page = current_title.prefixedText, defaultns = "extended"} if pagetype=='user page' or args.category=='no' then -- bot does not run on user talk namespace return '' end local templates = mw.loadData('Module:WikiProject banner/config').banner_shell.redirects local getparam = function(p) local TPVmodule = require('Module:Template parameter value').getParameter local success, param = TPVmodule(current_title.fullText, templates, p, {ignore_subtemplates=true, ignore_blank=true}) return success and param or nil end local check = function(p_table) local conflict = false local resolved for _, p in pairs(p_table) do local yn = yesno(p) -- check if "other" or "activepol" are set if p=='activepol' then yn = true -- activepol are living elseif p=='other' then yn = false -- other is treated as non-living end if yn==true or yn==false then -- parameter is set if resolved==nil then -- no resolved status yet resolved = yn -- resolve to parameter elseif yn~=resolved then -- resolved differs from parameter conflict = true end end end return resolved, conflict end local conflict, shell_resolved, bio_resolved, resolved shell_resolved, conflict = check({getparam('blp'), getparam('living')}) if not conflict then bio_resolved, conflict = check({args.blp, args.living, args.BLP}) if not conflict then resolved, conflict = check({shell_resolved, bio_resolved}) end end local out if conflict then elseif shell_resolved==nil then if bio_resolved==nil then if pagetype=='article' then out = 'Biography articles without living parameter' end else out = 'Pages using WikiProject Biography which need living parameter transferring' end end return out and '[[Category:' .. out .. ']]' or '' end return p
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Check blp parameter/sandbox/doc
(
edit
)