Module:Favilink: Difference between revisions

9 bytes added ,  17:09, 31 July 2020
m
no edit summary
mNo edit summary
mNo edit summary
Line 53: Line 53:
local displayname = result[1]['DisplayName'] or name
local displayname = result[1]['DisplayName'] or name
local image = (result[1]['Image'] ~= '' and result[1]['Image']~=nil) and result[1]['Image'] or 'None'
local image = (result[1]['Image'] ~= '' and result[1]['Image']~=nil) and result[1]['Image'] or 'None'
local display = result[1]['Display']
local displayimg = result[1]['Display']
local displaychar = result[1]['DisplayChar'] or '•'
local displaychar = result[1]['DisplayChar'] or '•'


Line 77: Line 77:
end
end


local img = display
local img = displayimg
if string.len(display) > 4 then
if string.len(display) > 4 then
   if string.sub(display, -4) == '.png' then
   if string.sub(display, -4) == '.png' then
       img = '[[File:' .. display.. '|16px|link='..pagelink..']]'
       img = '[[File:' .. displayimg.. '|16px|link='..pagelink..']]'
   end
   end
end
end