https://iiwiki.us/mediawiki/api.php?hidebots=1&urlversion=1&days=7&limit=50&target=Tsabaran_Civil_War&action=feedrecentchanges&feedformat=atomIIWiki - Changes related to "Tsabaran Civil War" [en]2024-03-29T15:56:50ZRelated changesMediaWiki 1.39.7https://iiwiki.us/wiki/EstmereEstmere2024-03-28T04:32:39Z<p><a href="/wiki/User:Santh" class="mw-userlink" title="User:Santh"><bdi>Santh</bdi></a> deleted page <a href="/mediawiki/index.php?title=Estmere&action=edit&redlink=1" class="new" title="Estmere (page does not exist)">Estmere</a> Prohibited content: Performance-damaging</p>
Santhhttps://iiwiki.us/mediawiki/index.php?title=Module:InfoboxImage&diff=784860&oldid=0Module:InfoboxImage2024-03-25T20:57:01Z<p><a href="/wiki/User:Maltropia" class="mw-userlink" title="User:Maltropia"><bdi>Maltropia</bdi></a> imported <a href="/wiki/Module:InfoboxImage" title="Module:InfoboxImage">Module:InfoboxImage</a> by file upload (1 revision)</p>
<p><b>New page</b></p><div>-- Inputs:<br />
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link<br />
-- page - page to display for multipage images (DjVu)<br />
-- size - size to display the image<br />
-- maxsize - maximum size for image<br />
-- sizedefault - default size to display the image if size param is blank<br />
-- alt - alt text for image<br />
-- title - title text for image<br />
-- border - set to yes if border<br />
-- center - set to yes, if the image has to be centered<br />
-- upright - upright image param<br />
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it<br />
-- link - page to visit when clicking on image<br />
-- class - HTML classes to add to the image<br />
-- Outputs:<br />
-- Formatted image.<br />
-- More details available at the "Module:InfoboxImage/doc" page<br />
<br />
local i = {};<br />
<br />
local placeholder_image = {<br />
"Blue - Replace this image female.svg",<br />
"Blue - Replace this image male.svg",<br />
"Female no free image yet.png",<br />
"Flag of None (square).svg",<br />
"Flag of None.svg",<br />
"Flag of.svg",<br />
"Green - Replace this image female.svg",<br />
"Green - Replace this image male.svg",<br />
"Image is needed female.svg",<br />
"Image is needed male.svg",<br />
"Location map of None.svg",<br />
"Male no free image yet.png",<br />
"Missing flag.png",<br />
"No flag.svg",<br />
"No free portrait.svg",<br />
"No portrait (female).svg",<br />
"No portrait (male).svg",<br />
"Red - Replace this image female.svg",<br />
"Red - Replace this image male.svg",<br />
"Replace this image female (blue).svg",<br />
"Replace this image female.svg",<br />
"Replace this image male (blue).svg",<br />
"Replace this image male.svg",<br />
"Silver - Replace this image female.svg",<br />
"Silver - Replace this image male.svg",<br />
"Replace this image.svg",<br />
"Cricket no pic.png",<br />
"CarersLogo.gif",<br />
"Diagram Needed.svg",<br />
"Example.jpg",<br />
"Image placeholder.png",<br />
"No male portrait.svg",<br />
"Nocover-upload.png",<br />
"NoDVDcover copy.png",<br />
"Noribbon.svg",<br />
"No portrait-BFD-test.svg",<br />
"Placeholder barnstar ribbon.png",<br />
"Project Trains no image.png",<br />
"Image-request.png",<br />
"Sin bandera.svg",<br />
"Sin escudo.svg",<br />
"Replace this image - temple.png",<br />
"Replace this image butterfly.png",<br />
"Replace this image.svg",<br />
"Replace this image1.svg",<br />
"Resolution angle.png",<br />
"Image-No portrait-text-BFD-test.svg",<br />
"Insert image here.svg",<br />
"No image available.png",<br />
"NO IMAGE YET square.png",<br />
"NO IMAGE YET.png",<br />
"No Photo Available.svg",<br />
"No Screenshot.svg",<br />
"No-image-available.jpg",<br />
"Null.png",<br />
"PictureNeeded.gif",<br />
"Place holder.jpg",<br />
"Unbenannt.JPG",<br />
"UploadACopyrightFreeImage.svg",<br />
"UploadAnImage.gif",<br />
"UploadAnImage.svg",<br />
"UploadAnImageShort.svg",<br />
"CarersLogo.gif",<br />
"Diagram Needed.svg",<br />
"No male portrait.svg",<br />
"NoDVDcover copy.png",<br />
"Placeholder barnstar ribbon.png",<br />
"Project Trains no image.png",<br />
"Image-request.png",<br />
"Noimage.gif",<br />
}<br />
<br />
function i.IsPlaceholder(image)<br />
-- change underscores to spaces<br />
image = mw.ustring.gsub(image, "_", " ");<br />
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')<br />
-- if image starts with [[ then remove that and anything after |<br />
if mw.ustring.sub(image,1,2) == "[[" then<br />
image = mw.ustring.sub(image,3);<br />
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");<br />
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')<br />
end<br />
-- Trim spaces<br />
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');<br />
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")<br />
-- remove prefix if exists<br />
local allNames = mw.site.namespaces[6].aliases<br />
allNames[#allNames + 1] = mw.site.namespaces[6].name<br />
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName<br />
for i, name in ipairs(allNames) do<br />
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then<br />
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);<br />
break<br />
end<br />
end<br />
-- Trim spaces<br />
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');<br />
-- capitalise first letter<br />
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);<br />
<br />
for i,j in pairs(placeholder_image) do<br />
if image == j then<br />
return true<br />
end<br />
end<br />
return false<br />
end<br />
<br />
function i.InfoboxImage(frame)<br />
local image = frame.args["image"];<br />
<br />
if image == "" or image == nil then<br />
return "";<br />
end<br />
if image == "&nbsp;" then<br />
return image;<br />
end<br />
if frame.args["suppressplaceholder"] ~= "no" then<br />
if i.IsPlaceholder(image) == true then<br />
return "";<br />
end<br />
end<br />
<br />
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then<br />
return "";<br />
end<br />
<br />
if mw.ustring.sub(image,1,2) == "[[" then<br />
-- search for thumbnail images and add to tracking cat if found<br />
local cat = "";<br />
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then<br />
cat = "[[Category:Pages using infoboxes with thumbnail images]]";<br />
end<br />
return image .. cat;<br />
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then<br />
return image;<br />
elseif mw.ustring.sub(image,1,1) == "<" then<br />
return image;<br />
elseif mw.ustring.sub(image,1,8) == mw.ustring.char(127).."'\"`UNIQ" then<br />
-- Found strip marker at begining, so pass don't process at all<br />
return image;<br />
else<br />
local result = "";<br />
local page = frame.args["page"];<br />
local size = frame.args["size"];<br />
local maxsize = frame.args["maxsize"];<br />
local sizedefault = frame.args["sizedefault"];<br />
local alt = frame.args["alt"];<br />
local link = frame.args["link"];<br />
local title = frame.args["title"];<br />
local border = frame.args["border"];<br />
local upright = frame.args["upright"] or "";<br />
local thumbtime = frame.args["thumbtime"] or "";<br />
local center = frame.args["center"];<br />
local class = frame.args["class"];<br />
<br />
-- remove prefix if exists<br />
local allNames = mw.site.namespaces[6].aliases<br />
allNames[#allNames + 1] = mw.site.namespaces[6].name<br />
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName<br />
for i, name in ipairs(allNames) do<br />
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then<br />
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);<br />
break<br />
end<br />
end<br />
<br />
if maxsize ~= "" and maxsize ~= nil then<br />
-- if no sizedefault then set to maxsize<br />
if sizedefault == "" or sizedefault == nil then<br />
sizedefault = maxsize<br />
end<br />
-- check to see if size bigger than maxsize<br />
if size ~= "" and size ~= nil then<br />
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;<br />
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;<br />
if sizenumber>maxsizenumber and maxsizenumber>0 then<br />
size = maxsize;<br />
end<br />
end<br />
end<br />
-- add px to size if just a number<br />
if (tonumber(size) or 0) > 0 then<br />
size = size .. "px";<br />
end<br />
-- add px to sizedefault if just a number<br />
if (tonumber(sizedefault) or 0) > 0 then<br />
sizedefault = sizedefault .. "px";<br />
end<br />
<br />
result = "[[File:" .. image;<br />
if page ~= "" and page ~= nil then<br />
result = result .. "|page=" .. page;<br />
end<br />
if size ~= "" and size ~= nil then<br />
result = result .. "|" .. size;<br />
elseif sizedefault ~= "" and sizedefault ~= nil then<br />
result = result .. "|" .. sizedefault;<br />
else<br />
result = result .. "|frameless";<br />
end<br />
if center == "yes" then<br />
result = result .. "|center"<br />
end<br />
if alt ~= "" and alt ~= nil then<br />
result = result .. "|alt=" .. alt;<br />
end<br />
if link ~= "" and link ~= nil then<br />
result = result .. "|link=" .. link;<br />
end<br />
if border == "yes" then<br />
result = result .. "|border";<br />
end<br />
if upright == "yes" then<br />
result = result .. "|upright";<br />
elseif upright ~= "" then<br />
result = result .. "|upright=" .. upright;<br />
end<br />
if thumbtime ~= "" then<br />
result = result .. "|thumbtime=" .. thumbtime;<br />
end<br />
if class ~= nil and class ~= "" then<br />
result = result .. "|class=" .. class;<br />
end<br />
-- if alt value is a keyword then do not use as a description<br />
if alt == "thumbnail" or alt == "thumb" or alt == "frameless" or alt == "left" or alt == "center" or alt == "right" or alt == "upright" or alt == "border" or mw.ustring.match(alt or "", '^[0-9]*px$', 1) ~= nil then<br />
alt = nil;<br />
end<br />
if title ~= "" and title ~= nil then<br />
-- does title param contain any templatestyles? If yes then set to blank.<br />
if mw.ustring.match(frame:preprocess(title), 'UNIQ%-%-templatestyles', 1) ~= nil then<br />
title = nil;<br />
end<br />
end<br />
if title ~= "" and title ~= nil then<br />
result = result .. "|" .. title;<br />
end<br />
result = result .. "]]";<br />
<br />
return result;<br />
end<br />
end<br />
<br />
return i;</div>Maltropia