https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AInfoboxImage Modul:InfoboxImage - Versionsgeschichte 2025-07-17T23:27:23Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.10 https://de.wikipedia.org/w/index.php?title=Modul:InfoboxImage&diff=150151447&oldid=prev K22b: /* erstellt auf Grundlage des Moduls aus der :en:Wikipedia */ 2016-01-13T07:51:38Z <p><span class="autocomment">erstellt auf Grundlage des Moduls aus der :en:Wikipedia</span></p> <p><b>Neue Seite</b></p><div>-- copied from the :en:Modul:InfoboxImage <br /> -- 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 /> -- Outputs:<br /> -- Formatted image.<br /> -- More details available at the &quot;Module:InfoboxImage/doc&quot; page<br /> <br /> local i = {};<br /> <br /> local placeholder_image = {<br /> &quot;Blue - Replace this image female.svg&quot;,<br /> &quot;Blue - Replace this image male.svg&quot;,<br /> &quot;Female no free image yet.png&quot;,<br /> &quot;Flag of None (square).svg&quot;,<br /> &quot;Flag of None.svg&quot;,<br /> &quot;Flag of.svg&quot;,<br /> &quot;Green - Replace this image female.svg&quot;,<br /> &quot;Green - Replace this image male.svg&quot;,<br /> &quot;Image is needed female.svg&quot;,<br /> &quot;Image is needed male.svg&quot;,<br /> &quot;Location map of None.svg&quot;,<br /> &quot;Male no free image yet.png&quot;,<br /> &quot;Missing flag.png&quot;,<br /> &quot;No flag.svg&quot;,<br /> &quot;No free portrait.svg&quot;,<br /> &quot;No portrait (female).svg&quot;,<br /> &quot;No portrait (male).svg&quot;,<br /> &quot;Red - Replace this image female.svg&quot;,<br /> &quot;Red - Replace this image male.svg&quot;,<br /> &quot;Replace this image female (blue).svg&quot;,<br /> &quot;Replace this image female.svg&quot;,<br /> &quot;Replace this image male (blue).svg&quot;,<br /> &quot;Replace this image male.svg&quot;,<br /> &quot;Silver - Replace this image female.svg&quot;,<br /> &quot;Silver - Replace this image male.svg&quot;,<br /> &quot;Replace this image.svg&quot;,<br /> &quot;Cricket no pic.png&quot;,<br /> &quot;CarersLogo.gif&quot;,<br /> &quot;Diagram Needed.svg&quot;,<br /> &quot;Example.jpg&quot;,<br /> &quot;Image placeholder.png&quot;,<br /> &quot;No male portrait.svg&quot;,<br /> &quot;Nocover-upload.png&quot;,<br /> &quot;NoDVDcover copy.png&quot;,<br /> &quot;Noribbon.svg&quot;,<br /> &quot;No portrait-BFD-test.svg&quot;,<br /> &quot;Placeholder barnstar ribbon.png&quot;,<br /> &quot;Project Trains no image.png&quot;,<br /> &quot;Image-request.png&quot;,<br /> &quot;Sin bandera.svg&quot;,<br /> &quot;Sin escudo.svg&quot;,<br /> &quot;Replace this image - temple.png&quot;,<br /> &quot;Replace this image butterfly.png&quot;,<br /> &quot;Replace this image.svg&quot;,<br /> &quot;Replace this image1.svg&quot;,<br /> &quot;Resolution angle.png&quot;,<br /> &quot;Image-No portrait-text-BFD-test.svg&quot;,<br /> &quot;Insert image here.svg&quot;,<br /> &quot;No image available.png&quot;,<br /> &quot;NO IMAGE YET square.png&quot;,<br /> &quot;NO IMAGE YET.png&quot;,<br /> &quot;No Photo Available.svg&quot;,<br /> &quot;No Screenshot.svg&quot;,<br /> &quot;No-image-available.jpg&quot;,<br /> &quot;Null.png&quot;,<br /> &quot;PictureNeeded.gif&quot;,<br /> &quot;Place holder.jpg&quot;,<br /> &quot;Unbenannt.JPG&quot;,<br /> &quot;UploadACopyrightFreeImage.svg&quot;,<br /> &quot;UploadAnImage.gif&quot;,<br /> &quot;UploadAnImage.svg&quot;,<br /> &quot;UploadAnImageShort.svg&quot;,<br /> &quot;CarersLogo.gif&quot;,<br /> &quot;Diagram Needed.svg&quot;,<br /> &quot;No male portrait.svg&quot;,<br /> &quot;NoDVDcover copy.png&quot;,<br /> &quot;Placeholder barnstar ribbon.png&quot;,<br /> &quot;Project Trains no image.png&quot;,<br /> &quot;Image-request.png&quot;,<br /> }<br /> <br /> function i.IsPlaceholder(image)<br /> -- change underscores to spaces<br /> image = mw.ustring.gsub(image, &quot;_&quot;, &quot; &quot;);<br /> assert(image ~= nil, &#039;mw.ustring.gsub(image, &quot;_&quot;, &quot; &quot;) must not return nil&#039;)<br /> -- if image starts with [[ then remove that and anything after |<br /> if mw.ustring.sub(image,1,2) == &quot;[[&quot; then<br /> image = mw.ustring.sub(image,3);<br /> image = mw.ustring.gsub(image, &quot;([^|]*)|.*&quot;, &quot;%1&quot;);<br /> assert(image ~= nil, &#039;mw.ustring.gsub(image, &quot;([^|]*)|.*&quot;, &quot;%1&quot;) must not return nil&#039;)<br /> end<br /> -- Trim spaces<br /> image = mw.ustring.gsub(image, &#039;^[ ]*(.-)[ ]*$&#039;, &#039;%1&#039;);<br /> assert(image ~= nil, &quot;mw.ustring.gsub(image, &#039;^[ ]*(.-)[ ]*$&#039;, &#039;%1&#039;) must not return nil&quot;)<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 .. &quot;:&quot;) 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, &#039;^[ ]*(.-)[ ]*$&#039;, &#039;%1&#039;);<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[&quot;image&quot;];<br /> <br /> if image == &quot;&quot; or image == nil then<br /> return &quot;&quot;;<br /> end<br /> if image == &quot;&amp;nbsp;&quot; then<br /> return image;<br /> end<br /> if frame.args[&quot;suppressplaceholder&quot;] ~= &quot;no&quot; then<br /> if i.IsPlaceholder(image) == true then<br /> return &quot;&quot;;<br /> end<br /> end<br /> <br /> if mw.ustring.lower(mw.ustring.sub(image,1,5)) == &quot;http:&quot; then<br /> return &quot;&quot;;<br /> end<br /> if mw.ustring.lower(mw.ustring.sub(image,1,6)) == &quot;[http:&quot; then<br /> return &quot;&quot;;<br /> end<br /> if mw.ustring.lower(mw.ustring.sub(image,1,7)) == &quot;[[http:&quot; then<br /> return &quot;&quot;;<br /> end<br /> if mw.ustring.lower(mw.ustring.sub(image,1,6)) == &quot;https:&quot; then<br /> return &quot;&quot;;<br /> end<br /> if mw.ustring.lower(mw.ustring.sub(image,1,7)) == &quot;[https:&quot; then<br /> return &quot;&quot;;<br /> end<br /> if mw.ustring.lower(mw.ustring.sub(image,1,8)) == &quot;[[https:&quot; then<br /> return &quot;&quot;;<br /> end<br /> <br /> if mw.ustring.sub(image,1,2) == &quot;[[&quot; then<br /> -- search for thumbnail images and add to tracking cat if found<br /> if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, &quot;|%s*thumb%s*[|%]]&quot;) or mw.ustring.find(image, &quot;|%s*thumbnail%s*[|%]]&quot;)) then<br /> return image .. &quot;[[Category:Pages using infoboxes with thumbnail images]]&quot;;<br /> else<br /> return image;<br /> end<br /> elseif mw.ustring.sub(image,1,2) == &quot;{{&quot; and mw.ustring.sub(image,1,3) ~= &quot;{{{&quot; then<br /> return image;<br /> elseif mw.ustring.sub(image,1,1) == &quot;&lt;&quot; then<br /> return image;<br /> elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127)..&quot;UNIQ&quot; then<br /> -- Found strip marker at begining, so pass don&#039;t process at all<br /> return image;<br /> else<br /> local result = &quot;&quot;;<br /> local page = frame.args[&quot;page&quot;];<br /> local size = frame.args[&quot;size&quot;];<br /> local maxsize = frame.args[&quot;maxsize&quot;];<br /> local sizedefault = frame.args[&quot;sizedefault&quot;];<br /> local alt = frame.args[&quot;alt&quot;];<br /> local link = frame.args[&quot;link&quot;];<br /> local title = frame.args[&quot;title&quot;];<br /> local border = frame.args[&quot;border&quot;];<br /> local upright = frame.args[&quot;upright&quot;] or &quot;&quot;;<br /> local thumbtime = frame.args[&quot;thumbtime&quot;] or &quot;&quot;;<br /> local center= frame.args[&quot;center&quot;];<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 .. &quot;:&quot;) then<br /> image = mw.ustring.sub(image, mw.ustring.len(name) + 2);<br /> break<br /> end<br /> end<br /> <br /> if maxsize ~= &quot;&quot; and maxsize ~= nil then<br /> -- if no sizedefault then set to maxsize<br /> if sizedefault == &quot;&quot; or sizedefault == nil then<br /> sizedefault = maxsize<br /> end<br /> -- check to see if size bigger than maxsize<br /> if size ~= &quot;&quot; and size ~= nil then<br /> local sizenumber = tonumber(mw.ustring.match(size,&quot;%d*&quot;)) or 0;<br /> local maxsizenumber = tonumber(mw.ustring.match(maxsize,&quot;%d*&quot;)) or 0;<br /> if sizenumber&gt;maxsizenumber and maxsizenumber&gt;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) &gt; 0 then<br /> size = size .. &quot;px&quot;;<br /> end<br /> <br /> result = &quot;[[File:&quot; .. image;<br /> if page ~= &quot;&quot; and page ~= nil then<br /> result = result .. &quot;|page=&quot; .. page;<br /> end<br /> if size ~= &quot;&quot; and size ~= nil then<br /> result = result .. &quot;|&quot; .. size;<br /> elseif sizedefault ~= &quot;&quot; and sizedefault ~= nil then<br /> result = result .. &quot;|&quot; .. sizedefault;<br /> else<br /> result = result .. &quot;|frameless&quot;;<br /> end<br /> if center == &quot;yes&quot; then<br /> result = result .. &quot;|center&quot;<br /> end<br /> if alt ~= &quot;&quot; and alt ~= nil then<br /> result = result .. &quot;|alt=&quot; .. alt;<br /> end<br /> if link ~= &quot;&quot; and link ~= nil then<br /> result = result .. &quot;|link=&quot; .. link;<br /> end<br /> if border == &quot;yes&quot; then<br /> result = result .. &quot;|border&quot;;<br /> end<br /> if upright == &quot;yes&quot; then<br /> result = result .. &quot;|upright&quot;;<br /> elseif upright ~= &quot;&quot; then<br /> result = result .. &quot;|upright=&quot; .. upright;<br /> end<br /> if thumbtime ~= &quot;&quot; then<br /> result = result .. &quot;|thumbtime=&quot; .. thumbtime;<br /> end<br /> if title ~= &quot;&quot; and title ~= nil then<br /> result = result .. &quot;|&quot; .. title;<br /> elseif alt ~= &quot;&quot; and alt ~= nil then<br /> result = result .. &quot;|&quot; .. alt;<br /> end<br /> result = result .. &quot;]]&quot;;<br /> <br /> return result;<br /> end<br /> end<br /> <br /> return i;</div> K22b