Jump to content

Module talk:Ancient Olympiads

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 07:13, 20 April 2015 (comment). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
@Mr. Stradivarius: I have fixed the module, and everything's working fine in the debug console, but it still doesn't run in the calendar.--Hyphantes (talk) 21:18, 19 April 2015 (UTC)[reply]
@Mr. Stradivarius: It appears that the values %s and %d can be used only once in a string to produce a link. In the following script they are used twice in both functions. The following script uses them twice for two links, but in the calendar only one displays correctly.
 
		if inputYear - 1 == t.year then
			-- year of the Olympiad, test with = p._main( -495 )
			-- The input year in the calendar appears to be one year to low (-775 for the year 776 BC). This is why all values need to be corrected by 1. 
		return string.format(
			'%s [[Olympiad]] ([[%s|victor]][[Winner of the Stadion race|)¹]]',
			t.numberOl, t.winner
		)
		end
        if inputYear > t.year then
			-- Years 2-4 of the Olympiad, test with = p._main( -494 )  etc.
		return string.format(
			'%s [[Olympiad]], [[%d BC|year %d]]',
			t.numberOl, inputYear * - 1 + 1, inputYear - t.year 
		)
		end
  
In the first case the result in the calendar is:
71st Olympiad (victor
instead of
71st Olympiad (victor
In the second it is:
71st Olympiad, year 2
instead of
71st Olympiad, year 2
Is there a way to work around these problems or do I have to live with these limitations?--Hyphantes (talk) 22:58, 19 April 2015 (UTC)[reply]
@Hyphantes: Sounds like you're creating a link to the current page - those links always show up in bold. For example, on this page, if I use the code [[Module talk:Ancient Olympiads]], it looks like this: Module talk:Ancient Olympiads. This is a feature of the MediaWiki software, and you can't turn it off. It doesn't really make much sense to always generate a link to the page that a reader is looking at, so that part of the module should just be plain text, not a link. — Mr. Stradivarius ♪ talk ♪ 07:13, 20 April 2015 (UTC)[reply]