大便秘结是什么原因| ap手表是什么牌子| 腰脱什么症状| 9月12是什么星座| 胎动在肚脐周围是什么胎位| 核载是什么意思| 宾至如归是什么意思| 感触什么意思| 面条吃多了有什么坏处| 1991年属羊是什么命| 宝齐莱算什么档次的表| 丰富多腔的腔是什么意思| 扁桃体发炎吃什么好得快| 什么是传染性软疣| 手肿是什么病的前兆| 站着头晕是什么原因| 眼角发黄是什么原因| get什么意思| 3680是什么罩杯| 药店属于什么单位性质| 霜和乳有什么区别| 乳腺增生吃什么药| 眼睛发痒是什么原因| 龙涎香什么味道| 小孩小便红色是什么原因| 摩羯是什么星座| 官员出狱后靠什么生活| 黄柏胶囊主要治什么病| 皮肤黑穿什么颜色的衣服| 做流产手术需要准备什么东西| crh是什么意思| 梦见一个人说明什么| 木耳菜是什么菜| cabbeen是什么牌子| 爱因斯坦是什么星座| 小孩咳嗽吃什么药效果最好| 梦见大蛇是什么意思| 79年属什么的| 白玫瑰代表什么| 凿是什么意思| 脉率是什么| 左金丸治什么病最好| 什么羊肉最好吃| 食少便溏是什么意思| 案底是什么意思| 什么是肛裂| 怀孕了吃什么药能打掉| 男孩子送什么礼物| 足金什么意思| 孕检唐筛是检查什么的| 感光度是什么意思| 肺部感染吃什么药效果好| 肺部气肿吃什么药能治好| 甘油三酯高用什么药好| 男人结扎对身体有什么影响| 根有什么作用| 回奶是什么意思| 纹眉失败擦什么淡化| 高血糖什么原因引起| 梦见自己疯了什么意思| 越位是什么意思| 肺腺瘤是什么| 吴亦凡什么学历| 心衰用什么药| 啪啪啪什么意思| gg是什么牌子的包包| 脑门长痘痘是什么原因| 小腿酸胀吃什么药| 什么叫个性强| 梦游是什么原因造成的| 男外科都检查什么| 吾矛之利的利什么意思| 男人吃什么补身体| 生化妊娠是什么意思| 淘宝什么时候成立的| 低烧是什么病的前兆| scj是什么意思| 房产证改名字需要什么手续| 乙肝表面抗体阴性是什么意思| 坐围是什么| 牛大力有什么功效| 为什么家里会有蚂蚁| 过敏吃什么药| 小孩啃指甲是什么原因| 雄性激素是什么| cmyk代表什么颜色| 来大姨妈为什么会拉肚子| 因人而异是什么意思| 祛斑去医院挂什么科| 早上为什么不能洗澡| 什么至什么来| 为什么光放屁| vca是什么牌子| 糖类抗原是检查什么的| 胳膊脱臼什么症状| 海参不能和什么一起吃| 危楼高百尺的危是什么意思| 毓读什么| 张力是什么意思| 普瑞巴林胶囊治什么病| 脑梗吃什么鱼最好| 妇炎康片主要治什么妇科病| 哇咔咔是什么意思| 第一次要注意什么| 四五行属什么| 掉头发是什么原因引起的| 流鼻涕吃什么药最管用| 交警支队长是什么级别| 沉香有什么功效| 谷氨酸高是什么原因| 996是什么| 什么是生僻字| 遗传代谢病是什么意思| aww是什么意思| 地级市市委书记是什么级别| ptt是什么| 牙龈发炎吃什么消炎药| 移植后可以吃什么水果| 牙疼吃什么好| 舍什么为什么| 四川为什么叫四川| 圣诞节在什么时候| 画像是什么意思| 心跳慢吃什么药| 子女宫是什么意思| 公关是什么工作| 黄体酮有什么副作用| 小苏打学名叫什么| 皂矾是什么| 木薯是什么东西| 脂肪肝是什么意思| 糖类抗原是检查什么的| 陆陆续续是什么意思| 浅表性胃炎什么症状| 援交是什么意思| 手指麻木是什么病的前兆| 嗳腐吞酸是什么意思| 满月是什么意思| 坐阵是什么意思| 什么是肥皂剧| 岔气是什么意思| 左肾尿盐结晶是什么意思| 过敏是什么样子的| 日加西念什么| 血压低有什么症状| 来月经可以吃什么水果| 一什么黑暗| 饺子有什么馅| 故事梗概是什么意思| ck是什么| 甲亢食疗吃什么| 省内流量是什么意思| 蛋白质变性的本质是什么| 感冒吃什么水果好得快| 环切手术是什么| 腋下出汗多是什么原因| 为什么会口臭的原因| 项链折了意味着什么| 五步蛇长什么样| 扑热息痛又叫什么名| 男马配什么属相最好| 口头禅是什么意思| 悉如外人的悉是什么意思| 眼睛痒用什么滴眼液| 五指毛桃煲汤配什么| 尿多尿频是什么原因造成的| 建日是什么意思| o血型的人有什么特点| 朱元璋长什么样| 甲流吃什么药效果最好| 1936年中国发生了什么| louis是什么意思| 拉肚子想吐是什么原因| mtt什么意思| 生孩子送什么花| 消化内科主要看什么病| 交接是什么意思| 老人手抖是什么病的预兆| 婴儿便便是绿色的是什么原因| 半月板退变是什么意思| 冉字五行属什么| 更年期什么年龄开始| 湿气太重了吃什么药| 一月23号是什么星座| 孕妇不吃饭对胎儿有什么影响| 门第是什么意思| 心跳过缓是什么原因造成的| 粉是什么做的| 什么叫甲沟炎| 微针是什么美容项目| 海藻糖是什么糖| 男人吃荔枝有什么好处| 次第花开是什么意思| 小三阳吃什么药能转阴| 黑裤子配什么颜色的鞋| press什么意思| 血清铁蛋白是检查什么| 女性白带发黄是什么原因| 办理护照需要什么| 一什么晚霞| 为什么明星都不戴黄金| 八拜之交是什么生肖| 梦见上班迟到什么意思| 痛风什么症状| 黄瓜有什么营养价值| 七月份出生是什么星座| 肌红蛋白高说明什么| 自身免疫性疾病是什么意思| esim卡是什么| 吃头发的虫子叫什么| 打耳洞医院挂什么科| 吃什么能养胃| 甲功三项是什么| 梦到自己被蛇咬是什么意思| 11月8日什么星座| 梦见很多肉是什么意思| 男人秒射是什么原因| 时令是什么意思| fierce是什么意思| 为什么会得疣| 贤侄是什么意思| 莲花是什么生肖| 乳腺囊实性结节是什么意思| 排卵期是什么时候开始算| 沃尔玛是干什么的| 什么叫甲状腺| 什么异思迁| 今年春节是什么时候| 9月10日是什么节日| 散光和近视有什么区别| 脑梗怎么形成的原因是什么| 鱼油对身体有什么好处| 做背有什么好处及作用| 除了肠镜还有什么方法检查肠道| 痛经吃什么水果| 梦见女鬼是什么意思| 喝什么茶对身体好| 男人吃什么食物可以补肾壮阳| 什么叫认知能力| 吃什么不会便秘| 追溯码是什么意思| 为什么有的人怎么吃都不胖| 积滞是什么意思| 喝黑豆浆有什么好处| 628是什么星座| 临床药学是干什么的| 胃肠感冒吃什么食物比较好| 早晨起来口干舌燥是什么原因| 美国总统叫什么名字| 00年是什么命| 1328年属什么生肖| 霾是什么意思| 鼻涕倒流到咽喉老吐痰吃什么药能根治| pku什么意思| 什么的大圆盘| 塑料是什么垃圾| 男士脸黑穿什么颜色好| 三公是什么意思| 梦见死蛇是什么预兆| 矫正度数是什么意思| 采字五行属什么| 蛇为什么会咬人| 穷字代表什么生肖| 天地不仁以万物为刍狗什么意思| 百度Jump to content

传言成真? 美海军陆战队将进驻美国在台协会

Kufuma Wikipedia
百度 对此他表示,今年的目标还是希望突破9秒99的成绩。

This module has two functions, portal and image. The portal produces a box with links to a portal or to multiple portals, and is used by the {{portal}} template. It is most often used in the "See also" section of an article. The image function produces the name of the image used by the specified portal.

See here, here, and here for test cases.

Portal function

[kulemba source]

The portal function produces a box of portal links.

Lua error: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

Basic usage

{{#invoke:Portal|portal |Portal 1 |Portal 2 |Portal 3 |... }}

Location

[kulemba source]

Within articles, the output of the portal function is meant to be placed at the top of the article's See also section. If there is no See also section, you may put it in the External links section instead; there is no need to create a new section just to house this template. If there is no External links section either, just put it below the article text in the place that seems most appropriate.

There are no particular rules about the placement of portals on other kinds of pages.

The portal image names are stored in subpages of Module:Portal/images, organised by the first letter of the portal name. For example, the first letter of Portal:Feminism is "F", so the image name is stored at Module:Portal/images/f. If there is an entry for a portal on the correct page then the corresponding image will be shown next to the portal link. If no image is found then File:Portal-puzzle.svg will be shown instead.

It is also possible to specify aliases for portal images. For example, the code {{Portal|Detroit}} produces the same image as the code {{Portal|Metro Detroit}}. The "Detroit" alias is found on the page Module:Portal/images/aliases.

The image-detection algorithm is case-insensitive. For example, the code {{Portal|Detroit}} will produce the same image as the code {{Portal|detroit}} (although the portal links will be different). Portal names are stored in lower case in the image subpages, and input is converted to lower case before being checked.

To add new images to the list, please make a protected edit request at Template talk:Portal to get an administrator to edit the correct subpage for you. Portal images must be either in the public domain or available under a free license that allows commercial reuse and derivative works; fair-use images are not acceptable. The template {{Portal icon demonstration}} may be of use when deciding whether an image is suitable for use as a portal icon; it formats an image using the same size and style that the {{Portal}} template uses by default.

A list of portals and aliases of portals without icons can be found at User:Dreamy Jazz Bot/Portals needing icons. It is updated infrequently, so ping the bot owner to update the list.

List of image subpages
Page Description
Module:Portal/images/a For portal names starting with "A".
Module:Portal/images/b For portal names starting with "B".
Module:Portal/images/c For portal names starting with "C".
Module:Portal/images/d For portal names starting with "D".
Module:Portal/images/e For portal names starting with "E".
Module:Portal/images/f For portal names starting with "F".
Module:Portal/images/g For portal names starting with "G".
Module:Portal/images/h For portal names starting with "H".
Module:Portal/images/i For portal names starting with "I".
Module:Portal/images/j For portal names starting with "J".
Module:Portal/images/k For portal names starting with "K".
Module:Portal/images/l For portal names starting with "L".
Module:Portal/images/m For portal names starting with "M".
Module:Portal/images/n For portal names starting with "N".
Module:Portal/images/o For portal names starting with "O".
Module:Portal/images/p For portal names starting with "P".
Module:Portal/images/q For portal names starting with "Q".
Module:Portal/images/r For portal names starting with "R".
Module:Portal/images/s For portal names starting with "S".
Module:Portal/images/t For portal names starting with "T".
Module:Portal/images/u For portal names starting with "U".
Module:Portal/images/v For portal names starting with "V".
Module:Portal/images/w For portal names starting with "W".
Module:Portal/images/x For portal names starting with "X".
Module:Portal/images/y For portal names starting with "Y".
Module:Portal/images/z For portal names starting with "Z".
Module:Portal/images/other For portal names starting with any other letters. This includes numbers, letters with diacritics, and letters in non-Latin alphabets.
Module:Portal/images/aliases For adding aliases for existing portal names. Use this page for variations in spelling and diacritics, etc., no matter what letter the portal begins with.
Code Result
{{#invoke:Portal|portal|Science}}
Lua error: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

Parameters

[kulemba source]
Name Value Description
1, 2, 3 ... The portal name, e.g. Literature The positional parameters specify the portals to be displayed.
left yes If set to yes, the portal appears on the left side of the page instead of the right.
margin CSS margin value, e.g. 1.2em 3em 0.5em 1em This allows you to set a custom margin. All valid CSS margin values are accepted.
break yes If set to yes, a line break is inserted after the portal name and before the word portal.
redlinks Any of the following values: yes, y, true, or include Redlinks will be displayed. The default is to suppress redlinks.
nominimum Any of the following values: yes, y, or true Suppresses the warning if no parameters are supplied. This can be useful when Template:Portal is called by another template.
border Any of the following values: no, n, or false Turn off border and background
tracking Any of the following values: no, n, false Tracking categories will be suppressed. The default is to use tracking categories, except on certain namespaces and on pagenames which contain "/archive", "/doc" or "/test".

Error tracking

[kulemba source]

If the module is used incorrectly, the page will be added to a tracking category.

The tracking categories are not applied if any of the following is true:

  1. Tracking is specially disabled for that usage. This is done by setting the optional parameter |tracking= to any the following values: no, n, false
  2. the template is used on a page in any of these namespaces: Talk, User, User talk, Wikipedia talk, File talk, Template talk, Category talk, Portal talk, Draft, Draft talk, Module talk
  3. The title page on which the template is used includes any of the following case-insensitive strings: "/archive", "/doc", "/test"
Purge page to update totals


Image function

[kulemba source]

The image function produces the name of the image used by the specified portal.

{{#invoke:Portal|image|portal}}
  • {{#invoke:Portal|image|Art}} → Ballerina-icon.jpg

Image dupes function

[kulemba source]

The image dupes function returns a list of all images that are being used by more than one portal (aliases are not included). This can be helpful in identifying image entries that should be changed to use aliases.

{{#invoke:Portal|imageDupes}}

Display all function

[kulemba source]

The display all function returns a box containing all portals that have images. This is used for maintenance, and should not be displayed in articles, because a) there are around 1500 portals with images, and displaying 1500 images on one page takes up a lot of server resources, and b) the module has no way to know the correct capitalisation of a portal name, so some links to portals will be broken. This function can be seen at Template:Portal/doc/all.

{{#invoke:Portal|displayAll}}

--[==[ This module is a Lua implementation of the old {{Portal}} template. As of February 2019 it is used on nearly 7,900,000 articles.
-- Please take care when updating it! It outputs two functions: p.portal, which generates a list of portals, and p.image, which
-- produces the image name for an individual portal.

-- The portal image data is kept in submodules of [[Module:Portal/images]], listed below:
-- [[Module:Portal/images/a]]		- for portal names beginning with "A".
-- [[Module:Portal/images/b]]		- for portal names beginning with "B".
-- [[Module:Portal/images/c]]		- for portal names beginning with "C".
-- [[Module:Portal/images/d]]		- for portal names beginning with "D".
-- [[Module:Portal/images/e]]		- for portal names beginning with "E".
-- [[Module:Portal/images/f]]		- for portal names beginning with "F".
-- [[Module:Portal/images/g]]		- for portal names beginning with "G".
-- [[Module:Portal/images/h]]		- for portal names beginning with "H".
-- [[Module:Portal/images/i]]		- for portal names beginning with "I".
-- [[Module:Portal/images/j]]		- for portal names beginning with "J".
-- [[Module:Portal/images/k]]		- for portal names beginning with "K".
-- [[Module:Portal/images/l]]		- for portal names beginning with "L".
-- [[Module:Portal/images/m]]		- for portal names beginning with "M".
-- [[Module:Portal/images/n]]		- for portal names beginning with "N".
-- [[Module:Portal/images/o]]		- for portal names beginning with "O".
-- [[Module:Portal/images/p]]		- for portal names beginning with "P".
-- [[Module:Portal/images/q]]		- for portal names beginning with "Q".
-- [[Module:Portal/images/r]]		- for portal names beginning with "R".
-- [[Module:Portal/images/s]]		- for portal names beginning with "S".
-- [[Module:Portal/images/t]]		- for portal names beginning with "T".
-- [[Module:Portal/images/u]]		- for portal names beginning with "U".
-- [[Module:Portal/images/v]]		- for portal names beginning with "V".
-- [[Module:Portal/images/w]]		- for portal names beginning with "W".
-- [[Module:Portal/images/x]]		- for portal names beginning with "X".
-- [[Module:Portal/images/y]]		- for portal names beginning with "Y".
-- [[Module:Portal/images/z]]		- for portal names beginning with "Z".
-- [[Module:Portal/images/other]]	- for portal names beginning with any other letters. This includes numbers,
-- 									  letters with diacritics, and letters in non-Latin alphabets.
-- [[Module:Portal/images/aliases]]	- for adding aliases for existing portal names. Use this page for variations
-- 									  in spelling and diacritics, etc., no matter what letter the portal begins with.
--
-- The images data pages are separated by the first letter to reduce server load when images are added, changed, or removed.
-- Previously all the images were on one data page at [[Module:Portal/images]], but this had the disadvantage that all
-- 5,000,000 pages using this module needed to be refreshed every time an image was added or removed.
]==]

local p = {}

-- determine whether we're being called from a sandbox
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true)
local sandbox = isSandbox and '/sandbox' or ''

local function sandboxVersion(s)
	return isSandbox and s..'-sand' or s
end

local templatestyles = 'Module:Portal'..sandbox..'/styles.css'

local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')

-- List of non-talk namespaces which should not be tracked (Talk pages are never tracked)
local badNamespaces = {'user','template','draft','wikipedia'}

-- Check whether to do tracking in this namespace
-- Returns true unless the page is one of the banned namespaces
local function checkTracking(title)
	local thisPage = title or mw.title.getCurrentTitle()
	if thisPage.isTalkPage then
		return false
	end
	local ns = thisPage.nsText:lower()
	for _, v in ipairs(badNamespaces) do
		if ns == v then
			return false
		end
	end
	return true
end

local function matchImagePage(s)
	-- Finds the appropriate image subpage given a lower-case
	-- portal name plus the first letter of that portal name.
	if type(s) ~= 'string' or #s < 1 then return end
	local firstLetter = mw.ustring.sub(s, 1, 1)
	local imagePage
	if mw.ustring.find(firstLetter, '^[a-z]') then
		imagePage = 'Module:Portal/images/' .. firstLetter .. sandbox
	else
		imagePage = 'Module:Portal/images/other' .. sandbox
	end
	return mw.loadData(imagePage)[s]
end

local function getAlias(s)
	-- Gets an alias from the image alias data page.
	local aliasData = mw.loadData('Module:Portal/images/aliases'..sandbox)
	for portal, aliases in pairs(aliasData) do
		for _, alias in ipairs(aliases) do
			if alias == s then
				return portal
			end
		end
	end
end

local function getImageName(s)
	-- Gets the image name for a given string.
	local default = 'Portal-puzzle.svg|link=|alt='
	if type(s) ~= 'string' or #s < 1 then
		return default
	end
	s = mw.ustring.lower(s)
	return matchImagePage(s) or matchImagePage(getAlias(s)) or default
end

 -- Function to check argument portals for errors, generate tracking categories if needed
 --     Function first checks for too few/many portals provided
 --     Then checks the portal list to purge any portals that don't exist
 -- Arguments:
 --   portals: raw list of portals
 --   args.tracking: is tracking requested? (will not track on bad titles or namespaces)
 --   args.redlinks: should redlinks be displayed?
 --   args.minPortals: minimum number of portal arguments
 --   args.maxPortals: maximum number of portal arguments
 -- Returns:
 --   portals = list of portals, with redlinks purged (if args.redlinks=false)
 --   trackingCat = possible tracking category
 --   errorMsg = error message
function p._checkPortals(portals, args)
	local trackingCat = ''
	local errMsg = nil
	
	-- Tracking is on by default.
	-- It is disabled if any of the following is true
	-- 1/ the parameter "tracking" is set to 'no, 'n', or 'false'
	-- 2/ the current page fails the namespace or pagename tests 
	local trackingEnabled = args.tracking and checkTracking()
	
	args.minPortals = args.minPortals or 1
	args.maxPortals = args.maxPortals or -1
	-- check for too few portals
	if #portals < args.minPortals then
		errMsg = 'please specify at least '..args.minPortals..' portal'..(args.minPortals > 1 and 's' or '')
		trackingCat = (trackingEnabled and '[[Category:Portal templates with too few portals]]' or '')
		return portals, trackingCat, errMsg
	end
	-- check for too many portals
	if args.maxPortals >= 0 and #portals > args.maxPortals then
		errMsg = 'too many portals (maximum = '..args.maxPortals..')'
		trackingCat = (trackingEnabled and '[[Category:Portal templates with too many portals]]' or '')
		return portals, trackingCat, errMsg
	end
	if not args.redlinks or trackingEnabled then
		-- make new list of portals that exist
		local existingPortals = {}
		for _, portal in ipairs(portals) do
			local portalTitle = mw.title.new(portal,"Portal")
			-- if portal exists, put it into list
			if portalTitle and portalTitle.exists then
				table.insert(existingPortals,portal)
			-- otherwise set tracking cat
			elseif trackingEnabled then
				trackingCat = "[[Category:Portal templates with redlinked portals]]"
			end
		end
		-- If redlinks is off, use portal list purged of redlinks
		portals = args.redlinks and portals or existingPortals
		-- if nothing left after purge, set tracking cat
		if #portals == 0 and trackingEnabled then
			trackingCat = trackingCat.."[[Category:Pages with empty portal template]]" 
		end
	end
	return portals, trackingCat, errMsg
end

function p._portal(portals, args)
	-- This function builds the portal box used by the {{portal}} template.
	
	-- Normalize all arguments
	if args.redlinks == 'include' then args.redlinks = true end
	args.addBreak = args['break']
	for key, default in pairs({left=false,tracking=true,nominimum=false,
		                       redlinks=false,addBreak=false,border=true}) do
		if args[key] == nil then args[key] = default end
		args[key] = yesno(args[key], default)
	end

	local root = mw.html.create('div')
		:attr('role', 'navigation')
		:attr('aria-label', 'Portals')
		:addClass('noprint plainlist')
		:addClass(sandboxVersion('portalbox'))
		:addClass(args.border and sandboxVersion('portalborder') or '')
		:addClass(args.left and 'tleft' or 'tright')
		:css('margin', args.margin or nil)
		:newline()

	local trackingCat = ''
	local errMsg = nil
	args.minPortals = args.nominimum and 0 or 1
	args.maxPortals = -1
	portals, trackingCat, errMsg = p._checkPortals(portals, args)
	root:wikitext(trackingCat)
	-- if error message, put it in the box and return
	if errMsg then
		if args.border then -- suppress error message when border=no
			local errTag = root:tag('strong')
			errTag:addClass('error')
			errTag:css('padding','0.2em')
			errTag:wikitext('Error: '..errMsg)
		end
		return tostring(root)
	end
	-- if no portals (and no error), just return tracking category
	if #portals == 0 then
		return trackingCat
	end

	-- Start the list. This corresponds to the start of the wikitext table in the old [[Template:Portal]].
	local listroot = root:tag('ul')
		:css('width', (tonumber(args.boxsize) or 0) > 0 and (args.boxsize .. 'px') or args.boxsize)

	-- Display the portals specified in the positional arguments.
	for _, portal in ipairs(portals) do
		local image = getImageName(portal)

		-- Generate the html for the image and the portal name.
		listroot
			:newline()
			:tag('li')
				:tag('span')
					:wikitext(string.format('[[File:%s|32x28px|class=noviewer]]', image))
					:done()
				:tag('span')
					:wikitext(string.format('[[Portal:%s|%s%sportal]]', portal, portal, args.addBreak and '<br />' or ' '))
	end
	return tostring(root)
end

function p._image(portal,nostrip)
	-- Wrapper function to allow getImageName() to be accessed through #invoke.
	-- backward compatibility: if table passed, take first element
	if type(portal) == 'table' then
		portal = portal[1]
	end
	local name = getImageName(portal)
	-- If nostrip is yes (or equivalent), then allow all metadata (like image borders) to be returned
	local strip = not yesno(nostrip)
	return strip and name:match('^(.-)|') or name -- FIXME: use a more elegant way to separate borders etc. from the image name
end

local function getAllImageTables()
	-- Returns an array containing all image subpages (minus aliases) as loaded by mw.loadData.
	local images = {}
	for i, subpage in ipairs{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'other'} do
		images[i] = mw.loadData('Module:Portal/images/' .. subpage .. sandbox)
	end
	return images
end

function p._displayAll(portals, args)
	-- This function displays all portals that have portal images. This function is for maintenance purposes and should not be used in
	-- articles, for two reasons: 1) there are over 1500 portals with portal images, and 2) the module doesn't record how the portal
	-- names are capitalized, so the portal links may be broken.
	local lang = mw.language.getContentLanguage()
	local count = 1
	for _, imageTable in ipairs(getAllImageTables()) do
		for portal in pairs(imageTable) do
			portals[count] = lang:ucfirst(portal)
			count = count + 1
		end
	end
	return p._portal(portals, args)
end

function p._imageDupes()
	-- This function searches the image subpages to find duplicate images. If duplicate images exist, it is not necessarily a bad thing,
	-- as different portals might just happen to choose the same image. However, this function is helpful in identifying images that
	-- should be moved to a portal alias for ease of maintenance.
	local exists, dupes = {}, {}
	for _, imageTable in ipairs(getAllImageTables()) do
		for portal, image in pairs(imageTable) do
			if not exists[image] then
				exists[image] = portal
			else
				table.insert(dupes, string.format('The image "[[:File:%s|%s]]" is used for both portals "%s" and "%s".', image, image, exists[image], portal))
			end
		end
	end
	if #dupes < 1 then
		return 'No duplicate images found.'
	else
		return 'The following duplicate images were found:\n* ' .. table.concat(dupes, '\n* ')
	end
end

local function processPortalArgs(args)
	-- This function processes a table of arguments and returns two tables: an array of portal names for processing by ipairs, and a table of
	-- the named arguments that specify style options, etc. We need to use ipairs because we want to list all the portals in the order
	-- they were passed to the template, but we also want to be able to deal with positional arguments passed explicitly, for example
	-- {{portal|2=Politics}}. The behaviour of ipairs is undefined if nil values are present, so we need to make sure they are all removed.
	args = type(args) == 'table' and args or {}
	local portals = {}
	local namedArgs = {}
	for k, v in pairs(args) do
		if type(k) == 'number' and type(v) == 'string' then -- Make sure we have no non-string portal names.
			table.insert(portals, k)
		elseif type(k) ~= 'number' then
			namedArgs[k] = v
		end
	end
	table.sort(portals)
	for i, v in ipairs(portals) do
		portals[i] = args[v]
	end
	return portals, namedArgs
end

-- Entry point for sorting portals from other named arguments
function p._processPortalArgs(args)
	return processPortalArgs(args)
end

function p.image(frame)
	local origArgs = getArgs(frame)
	local portals, args = processPortalArgs(origArgs)
	return p._image(portals[1],args.border)
end

local function makeWrapper(funcName)
	-- Processes external arguments and sends them to the other functions.
	return function (frame)
		-- If called via #invoke, use the args passed into the invoking
		-- template, or the args passed to #invoke if any exist. Otherwise
		-- assume args are being passed directly in from the debug console
		-- or from another Lua module. 
		-- Also: trim whitespace and remove blank arguments
		local origArgs = getArgs(frame)
		-- create two tables to pass to func: an array of portal names, and a table of named arguments.
		local portals, args = processPortalArgs(origArgs)
		local results = ''
		if funcName == '_portal' or funcName == '_displayAll' then
			results = frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} }
		end
		return results .. p[funcName](portals, args) 
	end
end

for _, funcName in ipairs{'portal', 'imageDupes', 'displayAll'} do
	p[funcName] = makeWrapper('_' .. funcName)
end

return p
肺大泡用什么药 孕妇应该多吃什么水果 虫草适合什么人吃 什么叫转基因 触媒是什么意思
梦见下大雨是什么预兆 职称有什么用 龙生九子下一句是什么 补肾最好的药是什么药 囊肿是什么引起的
rv是什么品牌 阿奇霉素主治什么病 荸荠又叫什么 市政协秘书长是什么级别 副团级是什么军衔
吃什么增肥最快 小孩干呕是什么原因 男人脚肿是什么原因 糖尿病吃什么 孕妇肚子疼是什么原因
莲花代表什么生肖hcv8jop2ns1r.cn 促进钙吸收吃什么hcv8jop1ns8r.cn wt是什么意思hcv9jop5ns3r.cn 脚气挂什么科hcv7jop9ns5r.cn 大乌龙是什么意思hcv9jop6ns4r.cn
二级医院是什么意思imcecn.com 宫闱是什么意思hcv8jop1ns4r.cn 螳螂吃什么食物adwl56.com 核糖是什么hcv9jop8ns0r.cn 董监高是什么意思hcv8jop4ns6r.cn
ieg是什么意思hcv8jop0ns8r.cn 全身发冷是什么原因hcv9jop6ns9r.cn 交易是什么意思hcv9jop5ns4r.cn 吃苹果有什么好处gysmod.com 三维b片主治什么病hcv8jop9ns1r.cn
脐炎用什么药xianpinbao.com 难免流产什么意思hcv7jop5ns3r.cn 祖师香是什么意思hcv7jop6ns3r.cn burberry是什么档次hcv9jop6ns9r.cn 现在当兵需要什么条件hcv9jop8ns3r.cn
百度