Module:Favilink Utility: Difference between revisions

No change in size ,  21:07, 26 October 2020
m
no edit summary
m (fix indentation)
mNo edit summary
Line 7: Line 7:
local namespaces = '(_pageNamespace="0" OR _pageNamespace="10002")'
local namespaces = '(_pageNamespace="0" OR _pageNamespace="10002")'
searchtype = searchtype or 'PlainName'
searchtype = searchtype or 'PlainName'
name = mw.text.trim(frame)
name = mw.text.trim(frame)
local wherestr = ''
local wherestr = ''


Line 35: Line 33:
end  
end  
result = cargo.query('GeneralData', fields,
result = cargo.query('GeneralData', fields,
{where=namespaces .. wherestr,
{where=namespaces .. wherestr,
default=name,
  default=name,
limit='1',
  limit='1',
orderby='_pageNamespace ASC'} )
  orderby='_pageNamespace ASC'} )
if next(result) then  
if next(result) then  
     resulttrue = 1
     resulttrue = 1
Line 62: Line 60:
     name = frame.args[1]
     name = frame.args[1]
end
end
local result = p.main(name, 'ObjectID', 'PlainName')
local result = p.main(name, 'ObjectID', 'PlainName')
if result == nil then
if result == nil then