模組:Infobox body of water tracking
呢個模組已經被保護。呢個係周圍都見到嘅模組,已經大量用或被頻繁subst。由於破壞或者失誤會影響諸多版面,即使細小嘅改動都可能導致大量伺服器負荷,因此已被半保護,唔可以編輯。 |
呢個模組係俾Template:Infobox body of water用嘅.
Usage
編輯{{#invoke:Infobox body of water tracking|tracking}}
Tracking/maintenance categories
編輯- Category:Wikipedia infobox body of water articles needing maintenance (0)
- Category:用咗水體明細模嘅文引用過時參數 (17)
- Category:用咗水體明細模嘅文重複引用參數 (0)
- Category:冇坐標嘅用咗水體明細模嘅文 (1)
- Category:冇圖片嘅用咗水體明細模嘅文 (0)
- Category:用咗水體明細模嘅文引用不明參數 (0)
上面嘅解係穿透包含咗自模組:Infobox body of water tracking/doc。 (改 | 史) 編者可以響呢個模組嘅沙盤 (開 | 鏡)同埋試例 (開)版度試驗佢。 呢個模組嘅細版。 |
local p = {}
function p.tracking(frame)
local function isblank( val )
return (val == nil) or val:match('^[%s]*$')
end
local function hasnoconvert( val )
local res = nil
val = mw.text.killMarkers(val)
if val:match('[0-9]') then
res = 1
if val:match('[%(][−0-9%.]') and val:match('[%)]') then
res = nil
end
end
return res
end
local cats = ''
local args = frame:getParent().args
local AZ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if (isblank(args['coords']) and isblank(args['coordinates']) and isblank(args['圖']) and isblank(args['相'])) then
cats = cats .. '[[Category:冇坐標嘅用咗水體明細模嘅文]]'
end
local duplicate_parameters = 0
local unknown_parameters = 0
if (args['child'] and args['embed']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['name'] and args['lake_name']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['image'] and args['image_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['alt'] and args['alt_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['caption'] and args['caption_lake']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['coordinates'] and args['coords']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['lake_type'] and args['type']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['ocean_type'] and args['type']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['part_of'] and args['parent']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['basin_countries'] and args['countries']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['catchment_km2'] and args ['catchment']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['length_km'] and args['length']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['width_km'] and args['width']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['area_km2'] and args['area']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['depth_m'] and args['depth']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['max-depth_m'] and args['max-depth']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['volume_km3'] and args['volume']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['shore_km'] and args['shore']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['elevation_m'] and args['elevation']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['settlements'] and args['cities']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['extra'] and args['nrhp']) then
duplicate_parameters = duplicate_parameters + 1
end
if (args['extra'] and args['embedded']) then
duplicate_parameters = duplicate_parameters + 1
end
if (duplicate_parameters > 0) then
cats = cats .. '[[Category:用咗水體明細模嘅文' ..
'重複引用參數|' ..
string.sub(AZ, duplicate_parameters, duplicate_parameters+1) .. ']]'
end
local deprecated_parameters = 0
if hasnoconvert(args['catchment'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['length'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['width'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['area'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['depth'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['max-depth'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['volume'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['shore'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['elevation'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['temperature_low'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if hasnoconvert(args['temperature_high'] or '') then
deprecated_parameters = deprecated_parameters + 1
end
if (deprecated_parameters > 0) then
cats = cats .. '[[Category:用咗水體明細模嘅文' ..
'引用過時參數|' ..
string.sub(AZ,deprecated_parameters, deprecated_parameters+1) .. ']]'
end
if (unknown_parameters > 0) then
cats = cats .. '[[Category:用咗水體明細模嘅文引用不明參數]]'
end
return cats
end
return p