モジュール:IPブロック一覧
表示
local p = {}
-- エラー
function p.error ( message )
return '<strong class="error">エラー:' ..message ..'</strong>'
end
function p.main( frame )
local args = require( 'Module:Arguments' ).getArgs( frame, { wrappers = 'Template:IPブロック一覧', removeBlanks = false })
local cell = {}
local style = args.style or ''
if style == '' then
style = 'font-size: 90%;'
end
local number = tonumber(args.number) or 1
if number > 0 then
number = number - 1
end
local outset = '<table class="sortable wikitable" style="' ..style ..'">'
..'<tr>'
..'<th></th>'
..'<th>IP</th>'
..'<th>会話 / 投稿 / 記録</th>'
..'<th>Whois</th>'
..'<th>初出現日時</th>'
..'<th>投稿ブロック記録</th>'
..'<th>ISP</th>'
..'</tr>'
local cell = {}
local line = ''
local temp = ''
local fullurl = ''
local i = 1
local k = 1
for row, val in pairs ( args ) do
cell[1] = args[i] or ''
cell[2] = args[i+1] or ''
cell[3] = args[i+2] or ''
cell[4] = args[i+3] or ''
temp = cell[1] ..cell[2] ..cell[3] ..cell[4]
if temp == '' then
break
end
temp = tonumber(k + number)
line = line ..'<tr><td style="text-align: right;">' ..temp ..'. </td>'
cell[1] = '<td>' ..cell[1] ..'</td>'
..'<td>[[利用者‐会話:' ..cell[1] ..'|会話]] / '
..'[[特別:投稿記録/' ..cell[1] ..'|履歴]] / '
..frame:preprocess('<span class="plainlinks">[{{fullurl:特別:ログ|page={{urlencode:利用者:' ..cell[1] ..'}}}} ログ]</span></td>')
..'<td>[http://whois.domaintools.com/' ..cell[1] ..' IPv4] / '
..'[https://www.ultratools.com/tools/ipv6InfoResult?ipAddress=' ..cell[1] ..' IPv6]</td>'
line = line ..cell[1]
..'<td>' ..cell[2] ..'</td>'
..'<td>' ..cell[3] ..'</td>'
..'<td>' ..cell[4] ..'</td>'
..'</tr>'
i = i + 4
k = k + 1
end
return outset ..line
..'<tr><td colspan="7" style="text-align: right; font-size: 90%;">[[Template:IPブロック一覧|テンプレートを表示]]</td></tr>'
..'</table>'
end
return p