Module:UserLinks: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
add a file uploads link per protected edit request, and make the API function compatible with other projects
(make an api function, as this was generating errors)
(add a file uploads link per protected edit request, and make the API function compatible with other projects)
Line 155:
 
local function makeApiLink()
-- Find the full domain, as the API can't be accessed through the interwiki system.
if u.project or u.lang then
local fulldomain
table.insert( trackingCategories, '[[Category:UserLinks transclusions with unresolvable interwiki links]]' )
local lang = u.lang or 'en'
if u.project or u.langprojectCode then
local domain = interwikiTable[u.projectCode].domain
local takesLangPrefix = interwikiTable[u.projectCode].takes_lang_prefix
if not takesLangPrefix then
fulldomain = domain
else
fulldomain = lang .. '.' .. domain
end
else
fulldomain = lang .. '.wikipedia.org'
end
return '[//en.wikipedia.org/w/api.php?action=query&list=users&usprop=editcount&ususers=' .. u.usernameHtml .. ' api]'
-- Return the API link
return '[//en' .wikipedia.org fulldomain .. '/w/api.php?action=query&list=users&usprop=editcount&ususers=' .. u.usernameHtml .. ' api]'
end
 
local function makeUploadsLink()
return '[[' .. u.interwiki .. 'Special:ListFiles/' .. u.username .. '|uploads]]'
end
 
Line 188 ⟶ 205:
{'ren' , makeRenamesLink},
{'rfa' , makeRfaLink},
{'api' , makeApiLink},
{'up' , makeUploadsLink}
}
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu