「モジュール:サンドボックス/Dragoniez/test」の版間の差分
表示
削除された内容 追加された内容
タグ: 取り消し |
特別:差分/87098164から転写 |
||
3行目: | 3行目: | ||
function p.Main( frame ) |
function p.Main( frame ) |
||
--Local宣言 |
--Local宣言 |
||
local |
local tar = frame.args['target'] |
||
local username = mw.uri.decode(tar,'WIKI') |
|||
local userping = "[[利用者:" .. username .. "]]" |
local userping = "[[利用者:" .. username .. "]]" |
||
local usernolink = "利用者:" .. username |
local usernolink = "利用者:" .. username |
||
local talk = "[[ |
local talk = "[[User talk:" .. username .. "|会話]]" |
||
local |
local contribs = "[[特別:投稿記録/" .. username .. "|投稿記録]]" |
||
local log = "[//ja-two.iwiki.icu/w/index.php?title= |
local log = "[//ja-two.iwiki.icu/w/index.php?title=特別:Log&page=User:" .. mw.uri.encode(username,"WIKI") .. " 記録]" |
||
local ca = "[[特別: |
local ca = "[[特別:CentralAuth/" .. username .. "|CA]]" |
||
local block = "[[特別: |
local block = "[[特別:block/" .. username .. "|ブロック]]" |
||
local guc = "[//xtools.wmflabs.org/globalcontribs/ipr-" .. username .. " xtool]" |
local guc = "[//xtools.wmflabs.org/globalcontribs/ipr-" .. username .. " xtool]" |
||
local whois4 = "[https://whois.domaintools.com/" .. username .. " IPv4]" |
local whois4 = "[https://whois.domaintools.com/" .. username .. " IPv4]" |
||
local whois6 = "[https://www.ultratools.com/tools/ipv6InfoResult?ipAddress=" .. username .. " IPv6]" |
local whois6 = "[https://www.ultratools.com/tools/ipv6InfoResult?ipAddress=" .. username .. " IPv6]" |
||
local forip = "IP:" .. username .. '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. |
local forip = "IP:" .. username .. '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. contribs .. " / " .. log .. " / " .. guc .. " / Whois " .. whois4 .. " ・ " .. whois6 .. " / " .. block .. ")</span>" |
||
local |
local list5 = '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. contribs .. " / " .. log .. " / " .. ca .. " / " .. block .. ")</span>" |
||
local forping = userping .. list5 |
|||
local forusernolink = usernolink .. '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. contributions .. " / " .. log .. " / " .. ca .. " / " .. block .. ")</span>" |
|||
local forusernolink = usernolink .. list5 |
|||
local icon = { |
local icon = { |
||
done = '[[File:Yes check.svg|20px|<span class="done">済</span>]]', |
done = '[[File:Yes check.svg|20px|<span class="done">済</span>]]', |
||
25行目: | 27行目: | ||
local statusA = string.lower(frame.args["status"]) |
local statusA = string.lower(frame.args["status"]) |
||
local statusB = frame.args["status2"] |
local statusB = frame.args["status2"] |
||
local logid = "[[特別:転送/logid/" .. tar .. "|Logid/" .. tar .. "]]" |
|||
local diff = "[[特別:差分/" .. tar .. "|差分/" .. tar .. "]]の投稿者" |
|||
-- Local宣言ここまで |
-- Local宣言ここまで |
||
-- type判定 |
-- type判定 |
||
local mtype = "" |
local mtype = "" |
||
if type2 == " |
if type2 == "log" or type2 == "logid" then |
||
mtype = logid |
|||
elseif type2 == "dif" or type2 == "diff" then |
|||
mtype = diff |
|||
elseif type2 == "ipuser2" or type2 == "ip2" then |
|||
mtype = forip |
mtype = forip |
||
elseif type2 == "none" then |
elseif type2 == "none" then |
||
55行目: | 63行目: | ||
m_status = icon.done .. " " .. "<small>'''" .. frame.args["status"] .. "'''</small>" |
m_status = icon.done .. " " .. "<small>'''" .. frame.args["status"] .. "'''</small>" |
||
end |
end |
||
-- status判定ここまで |
-- status判定ここまで |
||
2021年12月19日 (日) 15:07時点における最新版
モジュールの解説[作成]
local p = {} --p はパッケージの p です。この変数名は何でも構いません。
-- target=利用者名、type=type、status=状態
function p.Main( frame )
--Local宣言
local tar = frame.args['target']
local username = mw.uri.decode(tar,'WIKI')
local userping = "[[利用者:" .. username .. "]]"
local usernolink = "利用者:" .. username
local talk = "[[User talk:" .. username .. "|会話]]"
local contribs = "[[特別:投稿記録/" .. username .. "|投稿記録]]"
local log = "[//ja-two.iwiki.icu/w/index.php?title=特別:Log&page=User:" .. mw.uri.encode(username,"WIKI") .. " 記録]"
local ca = "[[特別:CentralAuth/" .. username .. "|CA]]"
local block = "[[特別:block/" .. username .. "|ブロック]]"
local guc = "[//xtools.wmflabs.org/globalcontribs/ipr-" .. username .. " xtool]"
local whois4 = "[https://whois.domaintools.com/" .. username .. " IPv4]"
local whois6 = "[https://www.ultratools.com/tools/ipv6InfoResult?ipAddress=" .. username .. " IPv6]"
local forip = "IP:" .. username .. '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. contribs .. " / " .. log .. " / " .. guc .. " / Whois " .. whois4 .. " ・ " .. whois6 .. " / " .. block .. ")</span>"
local list5 = '<span class="plainlinks" style="font-size:smaller">(' .. talk .. " / " .. contribs .. " / " .. log .. " / " .. ca .. " / " .. block .. ")</span>"
local forping = userping .. list5
local forusernolink = usernolink .. list5
local icon = {
done = '[[File:Yes check.svg|20px|<span class="done">済</span>]]',
doing = '[[File:Stock post message.svg|22px|<span class="doing">未了</span>]]',
reject = '[[File:X mark.svg|15px|<span class="done">却下</span>]] <span style="font-weight: bold;">却下</span>',
}
local type2 = string.lower(frame.args["type"])
local statusA = string.lower(frame.args["status"])
local statusB = frame.args["status2"]
local logid = "[[特別:転送/logid/" .. tar .. "|Logid/" .. tar .. "]]"
local diff = "[[特別:差分/" .. tar .. "|差分/" .. tar .. "]]の投稿者"
-- Local宣言ここまで
-- type判定
local mtype = ""
if type2 == "log" or type2 == "logid" then
mtype = logid
elseif type2 == "dif" or type2 == "diff" then
mtype = diff
elseif type2 == "ipuser2" or type2 == "ip2" then
mtype = forip
elseif type2 == "none" then
mtype = username
elseif type2 == "usernolink" or type2 == "unl" then
mtype = forusernolink
else
mtype = forping
end
-- type判定ここまで
-- status判定
local m_status = ""
if statusA == "" then
if statusB =="" then
m_status = icon.doing
else
m_status = icon.done
end
elseif statusA == "done" or statusA == "済" or statusA == "済み" then
m_status = icon.done
elseif statusA == "not done" or statusA == "却下" or statusA == "非対処" then
m_status = icon.reject
else
m_status = icon.done .. " " .. "<small>'''" .. frame.args["status"] .. "'''</small>"
end
-- status判定ここまで
return m_status .. " " .. mtype
end
return p