Module:YearNav: Difference between revisions

So many years I'm not sure what those underscores are doing... and the next line is throwing errors about OriginalYear so I guess something is going wrong with the previous line... play time.
(Created page with "local p = {} function p.YearNav(frame) Pattern = frame.args[1] or -1 if Pattern==-1 then Pattern = "####-10 ・・ ####-1 ・ '''####''' ・ ####+1 ・・ ####+10" --Default. Will be overwritten if something was there. for i,v in pairs(frame.args) do Pattern= i .. "=" .. v end end ThisPageTitle = mw.title.getCurrentTitle() Prefix = ThisPageTitle.nsText Namespace = ThisPageTitle.namespace PageName = ThisPa...")
 
(So many years I'm not sure what those underscores are doing... and the next line is throwing errors about OriginalYear so I guess something is going wrong with the previous line... play time.)
Tag: Reverted
Line 19: Line 19:
     --PageName = "1987 Sandwiches"
     --PageName = "1987 Sandwiches"


     _, _, OriginalYear = string.find(PageName, "(%d%d%d%d)")
     OriginalYear = string.find(PageName, "(%d%d%d%d)")
     PageWithout = string.gsub(PageName, OriginalYear, "@@@@")
     PageWithout = string.gsub(PageName, OriginalYear, "@@@@")