Difference between revisions of "Module:InfoboxImage"

From Betting Wiki
Jump to navigation Jump to search
en>WOSlinker
en>WOSlinker
Line 2: Line 2:
  
 
function i.InfoboxImage(frame)
 
function i.InfoboxImage(frame)
     if frame.args["image"] == "" or frame.args["image"] == nil then
+
     local image = frame.args["image"];
 +
   
 +
    if image == "" or image == nil then
 
         return ""
 
         return ""
 
     end
 
     end
 +
   
 
     if string.sub(frame.args["image"],1,2) == "[[" then
 
     if string.sub(frame.args["image"],1,2) == "[[" then
 
         return frame.args["image"];
 
         return frame.args["image"];
 
     else
 
     else
         return "[[File:" .. frame.args["image"] .. "|frameless]]" ;
+
         local size = frame.args["size"];
 +
        local sizedefault = frame.args["sizedefault"];
 +
        local alt = frame.args["alt"];
 +
        local result = "";
 +
       
 +
        result = "[[File:" .. frame.args["image"];
 +
        result = result .. "|frameless]]";
 +
       
 +
        return result;
 
     end
 
     end
 
end
 
end
  
 
return i;
 
return i;

Revision as of 19:01, 28 August 2012

Documentation for this module may be created at Module:InfoboxImage/doc

local i = {};

function i.InfoboxImage(frame)
    local image = frame.args["image"];
    
    if image == "" or image == nil then
        return ""
    end
    
    if string.sub(frame.args["image"],1,2) == "[[" then
        return frame.args["image"];
    else
        local size = frame.args["size"];
        local sizedefault = frame.args["sizedefault"];
        local alt = frame.args["alt"];
        local result = "";
        
        result = "[[File:" .. frame.args["image"];
        result = result .. "|frameless]]";
        
        return result;
    end
end

return i;