Since you are passing a string and not a table to ismapDM, then you must here use the string.
function ismapDM ( mapName )
if string.find( mapName, "[DM]", 1, true ) then
return 1
elseif string.find( mapName, "[DD]", 1, true ) then
return 2
elseif string.find( mapName, "[FUN]", 1, true ) then
return 3
end
end