Jump to content

Module:Professional wrestling profiles

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Silverfish (talk | contribs) at 12:45, 26 May 2016 (Split function into separate functions and other changes). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

function getpropertyvalue(ent, prop)
	return ent:formatPropertyValues(prop).value;
end

function getpropertyvaluewithdefaultvalues(ent, prop, value1, value2)
	local value = value1 or ""; if value == "" then value = value2 or "" end
    if value == "" then value = getpropertyvalue(ent, prop) end
end	

function getname(frame, name1, name2)
	local name = name1 or ""; if name == "" then name = name2 or "" end
    if name == "" then name = frame:expandTemplate{title = 'PAGENAMEBASE'} end
    return name
end	

local p = {}
function p.getpropertyvalue(frame)
ent = mw.wikibase.getEntityObject();
prop = frame.args[1];
return getpropertyvalue(ent, prop);
end	

function p.cagematch(frame)
	ent = mw.wikibase.getEntityObject(); 
    id = getpropertyvaluewithdefaultvalues(ent, 'P2728', frame.args[1], frame.args["id"]);	
    name = getname(frame, frame.args[2], frame.args["name"]);
	code = "[http://www.cagematch.net/?id=2&nr=" .. id .. " " ..	name .. "]";
    return code
end


function p.profiles(frame)
			
	
	
end	

return p