মডিউল:Infobox body of water tracking
অবয়ব
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is semi-protected from editing. |
This module is used by Template:Infobox body of water.
ব্যবহার
[সম্পাদনা]{{#invoke:Infobox body of water tracking|tracking}}
অনুসরণকরণ/রক্ষণাবেক্ষণ বিষয়শ্রেণী
[সম্পাদনা]- বিষয়শ্রেণী:উইকিপিডিয়া তথ্যছক জলের স্থান নিবন্ধসমূহের রক্ষণাবেক্ষণ প্রয়োজন (০)
- বিষয়শ্রেণী:স্থানাঙ্ক ছাড়া নিবন্ধসমূহ তথ্যছক জলের স্থান ব্যবহার করছে (০)
- বিষয়শ্রেণী:ছবি ছাড়া নিবন্ধসমূহ তথ্যছক জলের স্থান ব্যবহার করছে (০)
- বিষয়শ্রেণী:পাতাসমূহ অ-স্বয়ংক্রিয়ভাবে রূপান্তরিত আয়তনের সাথে তথ্যছক জলের স্থান ব্যবহার করছে (০)
- বিষয়শ্রেণী:পাতাসমূহ তথ্যছক জলের স্থানের সাথে অনুরূপ প্যারামিটার ব্যবহার করছে (০)
- বিষয়শ্রেণী:পাতাসমূহ অজানা প্যারামিটারের সাথে তথ্যছক জলের স্থান ব্যবহার করছে (০)
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'
local warnmsg = {}
if (isblank(args['image']) and isblank(args['image_lake']) ) then
if mw.title.getCurrentTitle().namespace == 0 then
cats = cats .. '[[বিষয়শ্রেণী:ছবি ছাড়া নিবন্ধসমূহ তথ্যছক জলাধার ব্যবহার করছে]]'
end
end
if isblank(args['coords']) and isblank(args['coordinates']) then
if mw.title.getCurrentTitle().namespace == 0 then
cats = cats .. '[[বিষয়শ্রেণী:স্থানাঙ্ক ছাড়া নিবন্ধসমূহ তথ্যছক জলাধার ব্যবহার করছে]]'
end
end
local duplicate_parameters = 0
local duplicate_list = {
{'child', 'embed'},
{'name', 'lake_name'},
{'image', 'image_lake'},
{'alt', 'alt_lake'},
{'caption', 'caption_lake'},
{'coordinates', 'coords'},
{'lake_type', 'type'},
{'ocean_type', 'type'},
{'lake_type', 'ocean_type'},
{'part_of', 'parent'},
{'basin_countries', 'countries'},
{'catchment_km2', 'catchment'},
{'length_km', 'length'},
{'width_km', 'width'},
{'area_km2', 'area'},
{'depth_m', 'depth'},
{'max-depth_m', 'max-depth'},
{'volume_km3', 'volume'},
{'shore_km', 'shore'},
{'elevation_m', 'elevation'},
{'settlements', 'cities'},
{'extra', 'nrhp'},
{'extra', 'embedded'},
{'embedded', 'nrhp'}
}
for i, params in ipairs(duplicate_list) do
if args[params[1]] and args[params[2]] then
duplicate_parameters = duplicate_parameters + 1
table.insert(warnmsg, 'Cannot use <code>' .. params[1] .. '</code> and <code>' .. params[2] .. '</code> at the same time.')
end
end
if (duplicate_parameters > 0) then
cats = cats .. '[[বিষয়শ্রেণী:পাতাসমূহ তথ্যছক জলাধারের সাথে ' ..
'অনুরূপ প্যারামিটার ব্যবহার করছে|' ..
string.sub(AZ, duplicate_parameters, duplicate_parameters+1) .. ']]'
end
local no_convert_parameters = 0
local dim_list = {
'catchment', 'length', 'width', 'area', 'depth', 'max-depth', 'volume',
'shore', 'elevation', 'temperature_low', 'temperature_high'}
for i, param in ipairs(dim_list) do
if hasnoconvert(args[param] or '') then
no_convert_parameters = no_convert_parameters + 1
table.insert(warnmsg, 'Unconverted dimensions in <code>' .. param .. '</code>')
end
end
if (no_convert_parameters > 0) then
if mw.title.getCurrentTitle().namespace == 0 then
cats = cats .. '[[বিষয়শ্রেণী:পাতাসমূহ অ-স্বয়ংক্রিয়ভাবে রূপান্তরিত আয়তনের সাথে তথ্যছক জলাধার ব্যবহার করছে|' ..
string.sub(AZ,no_convert_parameters, no_convert_parameters+1) .. ']]'
end
end
if #warnmsg > 0 then
if frame:preprocess( "{{REVISIONID}}" ) == "" then
cats = '<div class="hatnote" style="color:red"><strong>Infobox body of water warning:</strong> ' .. table.concat(warnmsg, '<br>') .. '</div>' .. cats
end
end
return cats
end
return p