Module:MediaWiki:Talkpageheader
Appearance
This module is for use in MediaWiki:Talkpageheader to display the talk page header if it is not already directly included on the talk page.
Usage
{{#invoke:MediaWiki:Talkpageheader|main}}
local p = {}
local isIP = require('Module:IPAddress')._isIp
p.main = function(frame)
local args = require('Module:Arguments').getArgs(frame)
local tptext = ''
local pageTitle = args[1] and mw.title.new(args[1]) or mw.title.getCurrentTitle()
local out = ''
local text = frame:preprocess('{{:' .. pageTitle.fullText .. '}}')
if not mw.ustring.find(text, '<table role="presentation" class="tmbox tmbox-notice talkheader plainlinks" id="talkheader" style="border-collapse: separate;">') then
out = out .. '{{Talk header}}\n'
end
if not mw.ustring.find(text, '<span class="sharedIP">') and isIP(pageTitle.baseText) then
out = out .. '{{Shared IP}}\n'
end
return frame:preprocess(out)
end
return p