Module:Test: Difference between revisions
Jump to navigation
Jump to search
m
no edit summary
Tag: Rollback |
mNo edit summary |
||
Line 5: | Line 5: | ||
]] | ]] | ||
local | local p ={} | ||
function p.Main(frame) | |||
local m_title = mw.title.new(tonumber(frame.args[1])) | |||
local m_exist = m_title ~= nil | |||
local m_pageidlink = '[[:mw:Manual:Page_table/ja#page_id|ID]] : [[Special:Redirect/page/' .. frame.args[1] .. '|' .. frame.args[1] .. ']]' | |||
local m_titlestring = '' | |||
local m_talkpagelink = '' | |||
local m_historyurl = '' | |||
local m_loglink = '' | |||
local m_whatlinkshere = '' | |||
if m_exist then | |||
m_titlestring = mw.allToString(m_title) | |||
m_talkpagelink = '[[' .. mw.allToString(m_title.talkPageTitle) .. '|ノート]]' | |||
m_historyurl = '[' .. mw.allToString(mw.uri.fullUrl(m_titlestring,'action=history')) .. ' 履歴]' | |||
m_loglink = '[//ja.wikipedia.org/w/index.php?title=%E7%89%B9%E5%88%A5:Log&page=' .. mw.uri.encode(m_titlestring,"WIKI") .. ' ログ]' | |||
m_whatlinkshere = '[[Special:WhatLinksHere/' .. m_titlestring .. '|リンク元]]' | |||
end | |||
if m_exist then | |||
if m_title.isTalkPage then | |||
return m_pageidlink .. '<span style="font-size:smaller" class="plainlinks">(' .. m_historyurl .. ' / ' .. m_loglink .. ' / ' .. m_whatlinkshere .. ')</span>' | |||
else | |||
return m_pageidlink .. '<span style="font-size:smaller" class="plainlinks">(' .. m_talkpagelink .. ' / ' .. m_historyurl .. ' / ' .. m_loglink .. ' / ' .. m_whatlinkshere .. ')</span>' | |||
end | |||
else | |||
return m_pageidlink .. '<span style="font-size:smaller">(非存在)</span>' | |||
end | |||
end | |||
return p |