Difference between revisions of "Module:Sandbox/SiBr4"

From blackwiki
Jump to navigation Jump to search
blackwiki>SiBr4
blackwiki>SiBr4
Line 3: Line 3:
 
-------------------------
 
-------------------------
  
function p.listdata(frame)
+
function p.test(frame)
  
local args = require('Module:Arguments').getArgs(frame,{removeBlanks=false})
+
return ""
 
 
local list = ""
 
if args[1] then
 
  list = mw.html.create('table')
 
  list:css("background-color","#ecfcf4")
 
  for n,c in ipairs(args) do
 
    if c~="" then
 
      local p = "Template:Country data "..c
 
      local link
 
      if require('Module:Redirect').luaIsRedirect(p) then
 
        link = "["..mw.title.new(p):fullUrl("redirect=no").." "..p.."]"
 
      else
 
        link = "[["..p.."]]"
 
      end
 
      local var = args["var"..n] or ""
 
      local vartext = var=="" and "" or " (<code>"..var.."</code> variant)"
 
      local note = args["note"..n] or ""
 
 
 
      local row = list:tag("tr")
 
      row:tag("td"):css("padding","0px 10px"):addClass("plainlinks"):wikitext(link..vartext)
 
      row:tag("td"):css("padding","0px 10px"):wikitext(require("Module:Flagg").luaMain(frame,{"usc", c, variant=var}))
 
      row:tag("td"):css("padding","0px 10px"):wikitext(note)
 
    end
 
  end
 
end
 
  
local head = ""
 
if args["header"] and args["header"]~="" then
 
  if args["header"]=="related" then
 
    head = "====Related templates====\nPlease see the following related <code>country_data</code> templates:\n"
 
  elseif string.sub(args["header"],1,4)=="for:" then
 
    head = "<code>Country_data</code> templates are also available for "..string.sub(args["header"],5,-1)..":\n"
 
  else
 
    head = args["header"].."\n"
 
  end
 
 
end
 
end
  
return head..tostring(list)
 
 
end
 
 
-------------------------
 
-------------------------
  
Line 57: Line 20:
 
   return "?"
 
   return "?"
 
end
 
end
 
end
 
 
-------------------------
 
 
function p.test(frame)
 
 
return ""
 
  
 
end
 
end

Revision as of 10:19, 9 February 2016

local p = {}

-------------------------

function p.test(frame)

return ""

end

-------------------------

function p.ec(frame)

local p = frame:preprocess("{{Wikipedia:List of Wikipedians by number of edits/5001–6000}}")
local i = string.find(p,"User:SiBr4")
if i then
  return string.sub(p,i-10,i-6)
else
  return "?"
end

end

-------------------------

return p