پودمان:Tfd links
توضیحات این پودمان میتواند در پودمان:Tfd links/توضیحات قرار گیرد.
-- This module implements [[Template:Tfd links]]
local p = {}
local function urlencode(text)
-- Return equivalent of {{urlencode:text}}.
local function byte(char)
return mw.ustring.format('%%%02X', mw.ustring.byte(char))
end
return mw.ustring.gsub(mw.ustring.gsub(text, '[^ %w%-._]', byte), ' ', '+')
end
local function fullurllink(t, a, s)
return '[https://fa.wikipedia.org/w/index.php?title=' .. urlencode(t) .. '&' .. a .. ' ' .. s .. ']'
end
function p.main(frame)
local args = frame:getParent().args
local ns = (((args['catfd'] and args['catfd'] ~= '') and 'رده') or
(args['module'] and args['module'] ~= '') and 'پودمان')
or 'الگو'
local tname = mw.getContentLanguage():ucfirst(args['1'])
local fname = ns .. ':' .. tname
local fullpagename = frame:preprocess('{{FULLPAGENAME}}')
local sep = ' <b>·</b> '
local res = '<span id="' .. ns .. ':' .. tname
.. '" class="plainlinks nourlexpansion 1x">'
.. '[[:' .. ns .. ':' .. tname .. ']] ('
.. '[[بحث ' .. ns .. ':' .. tname .. '|بحث]]' .. sep
.. '[[ویژه:تاریخچه صفحه/' .. fname .. '|تاریخچه]]' .. sep
.. fullurllink('ویژه:پیوند_به_این_صفحه/' .. fname, 'limit=5000&hidelinks=1', 'تراگنجانشها')
.. ' <sup>([https://linkcount.toolforge.org/?project=fa.wikipedia.org&page=' .. urlencode(ns .. tname) .. ' شمار])</sup>' .. sep
.. fullurllink('ویژه:سیاههها', 'page=' .. urlencode(fname), 'سیاههها') .. sep
.. '[[ویژه:نمایه_پیشوندی/' .. fname .. '/|زیرصفحهها]])</span>'
return res
end
return p