Jump to content
Menyu yikuru
Menyu yikuru
move to sidebar
kubisa
Mayendelo
Jani likulu
Vidumbizgano vya chikaya
Vakuchitika vasono
Kusintha kuphya
Jani lililose
Wovwili
To Do
Vyakuti vinozgeke
Vinyake
Mafumbo
Mazgo ghakomi
Helpful Pages (Wovwili)
Need for Fix
Need for Review
Admin Pages
Home pages
Home templates
Kufufuza
Kufufuza
Kaonekelo
Chakupeleka
Panga akaunti
Njila
Vilwelo vyako
Chakupeleka
Panga akaunti
Njila
Pages for logged out editors
learn more
vyakulemba
Pakuchezgela
Kulemba
Module:Highest archive number
Sazgapo viyowoyelo
Module
Kudumbizgana
English
Ŵelengani
Kulemba source
Kuona umo mayambilo
Vilwelo
Vilwelo
move to sidebar
kubisa
Vyakuchita
Ŵelengani
Kulemba source
Kuona umo mayambilo
Vya masiku ghose
Ivo vikwiza pano
Vyaku sintha
Kwezgela chinthu
Va jani lino
Penjani URL yakufupikizgika
Sangululani kodi ya QR
Kaonekelo
move to sidebar
kubisa
Chenjezgo:
Mundanjile mu akaunti yinu. Pala mulembenge chilichose IP adilesi yinu waliyose waionenge. Pala
mwanjila
mu akaunti yinu
panji
mwapanga akaunti
, vyakulemba vinu vyose viŵenge mu zina linu, na uwemi unyake.
Anti-spam check. Do
not
fill this in!
-- This module finds the highest existing archive number for a set of talk -- archive pages. local expSearch = require('Module:Exponential search') local p = {} local function raiseStartNumberError(start) error(string.format( 'Invalid start number "%s" supplied to [[Module:Highest archive number]] (must be an integer)', tostring(start) ), 3) end local function pageExists(page) local success, exists = pcall(function() return mw.title.new(page).exists end) return success and exists end function p._main(prefix, start) -- Check our inputs if type(prefix) ~= 'string' or not prefix:find('%S') then error('No prefix supplied to [[Module:Highest archive number]]', 2) end if start ~= nil and (type(start) ~= "number" or math.floor(start) ~= start) then raiseStartNumberError(start) end start = start or 1 -- Do an exponential search for the highest archive number local result = expSearch(function (i) local archiveNumber = i + start - 1 local page = prefix .. tostring(archiveNumber) return pageExists(page) end, 10) if result == nil then -- We didn't find any archives for our prefix + start number return nil else -- We found the highest archive, but the number is always 1-based, so -- adjust it for our start number return result + start - 1 end end function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { trim = false, removeBlanks = false, wrappers = 'Template:Highest archive number' }) local prefix = args[1] -- Get the start archive number, if specified. local start = args.start if start == "" then start = nil elseif start then start = tonumber(start) if not start then raiseStartNumberError(args.start) end end return p._main(prefix, start) end return p
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Kuleka
Wowili wakalembelo
(julani mu windo lanyuwani)
Preview page with this template
Nkhwaska yagwiliskika apa:
Module:Highest archive number/doc
(
lemba
)
Kufufuza
Kufufuza
Kulemba
Module:Highest archive number
Sazgapo viyowoyelo
Add topic