Content deleted Content added
Dreamy Jazz (talk | contribs) sync changes |
omit tracking categories on user pages |
||
Line 9:
local getImageName = require( 'Module:Portal' ).image
local yesno = require( 'Module:Yesno' )
local isUserPage = false
local function checkIfUserPage()
local thisPage = mw.title.getCurrentTitle()
if (thisPage.namespace == 2) or (thisPage.namespace == 3) then
isUserPage = true
return true
end
isUserPage = false
return false
end
-- Builds the portal bar used by {{portal bar}}.
Line 31 ⟶ 44:
end
checkIfUserPage()
-- scan for nonexistent portals, if they exist remove them from the portals table. If redlinks=yes, then don't remove
local portallen = #portals
Line 42 ⟶ 57:
if (args.redlinks == 'yes') or (args.redlinks == 'y') or (args.redlinks == 'true') or (args.redlinks == 'include') then
-- if redlinks as been set to yes (or similar), add the cleanup category and then break the loop before the portal is removed from the list
if not (isUserPage) then
nav:wikitext('[[Category:Portal templates with redlinked portals]]')
end
break
end
Line 53 ⟶ 70:
if not (portallen == #portals) then
if #portals == 0 then
if not (isUserPage) then
return '[[Category:Portal templates with all redlinked portals]]' else
return ""
end
end
if not (isUserPage) then
nav:wikitext('[[Category:Portal templates with redlinked portals]]')
end
end
|