Module:VendorPages

local p = {}

function p.fixLink( frame ) local link = frame.args.link link:gsub("=", "&#61;") link:gsub("?", "&#63;")

return link end

-- This probably won't work yet. I'm just exploring Lua scripting https://www.mediawiki.org/wiki/Lua_scripting function p.supportPageLink( frame ) local link local vendor = frame.args.vendor local model = frame.args.model local arris_p = frame.args.pf	local region = frame.args.region local supportonly = frame.args.supportonly local productType = frame.args.productType local vs_id_old = frame.args.vs_id_old local vs_id = frame.args.vs_id local pid = frame.args.pid -- Linksys/Sitecom local pname = frame.args.pname -- Sitecom

if vendor == "Amped" then link = "http://www.ampedwireless.com/support/model/" .. model .. ".html" elseif vendor == "Arris" then link = "http://arris.force.com/consumers/ConsumerProductDetail?p=" .. arris_p elseif vendor == "ASUS" then link = "https://www.asus.com/" .. function return region and region .. "/" or "" end .. function return supportonly == "true" and region .. "/" or productType and productType or "Networking" end .. "/" .. model .. "/HelpDesk/" elseif vendor == "Belkin" then link = function return frame.args.vs_id_old and "http://www.belkin.com/us/support-product?rnId=" .. frame.args.vs_id_old or "http://www.belkin.com/us/support-product?pid=" .. frame.args.vs_id end elseif vendor == "D-Link" then link = "http://support.dlink.com/ProductInfo.aspx?m=" .. model elseif vendor == "Devolo" then link = "http://www.devolo.com/en/Downloads/" .. model elseif vendor == "Encore" then link = "http://www.encore-usa.com/us/support/" .. model elseif vendor:lower == "netgear" then link = "https://www.netgear.com/support/product/" .. model elseif vendor == "Linksys" then link = "http://support.linksys.com/" .. (region or "us") .. pid and "/support-product?pid=" .. pid or model and "/support/lbc/" .. model or "" -- (Template link outdated) elseif vendor == "motorolacable" then link = "http://motorolacable.com/support/" .. model elseif vendor == "Sitecom" then link = "http://www.sitecomlearningcentre.com/products/" .. pid and pid .. "/" or "" .. pname elseif vendor == "TP-LINK" then link = "http://www.tp-link.com/en/download/" .. model .. ".html" elseif vendor == "TRENDnet" then link = "http://www.trendnet.com/support/supportdetail.asp?prod=" .. prod elseif vendor == "USRobotics" then link = "http://www.usr.com/en-support/product?prod=" .. vs_id elseif vendor == "ZyXEL" then link = "http://www.zyxel.com/support/SupportLandingSR.shtml?c=" .. region or "us" .. "&l=en&kbid=" .. kbid .. "&md=" .. model elseif frame.args[1] then link = frame.args[1] end

if link then return " • " .. "[" .. link .. " Support page]" end end

-- This is not fully implemented yet function p.productPageLink( frame ) local link = frame.args.link local vendor = frame.args.vendor local model = frame.args.model local arris_p = frame.args.pf	local region = frame.args.region local supportonly = frame.args.supportonly local productType = frame.args.productType local vs_id_old = frame.args.vs_id_old local vs_id = frame.args.vs_id local pid = frame.args.pid -- Linksys

if link and link ~= '' then return p.fixLink( frame ) else return link end end

return p