<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ar">
	<id>https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3AAncient_Olympiads</id>
	<title>وحدة:Ancient Olympiads - تاريخ المراجعة</title>
	<link rel="self" type="application/atom+xml" href="https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3AAncient_Olympiads"/>
	<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ancient_Olympiads&amp;action=history"/>
	<updated>2026-06-06T09:32:18Z</updated>
	<subtitle>تاريخ التعديل لهذه الصفحة في الويكي</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ancient_Olympiads&amp;diff=249&amp;oldid=prev</id>
		<title>عبد العزيز في 00:43، 12 يناير 2017</title>
		<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Ancient_Olympiads&amp;diff=249&amp;oldid=prev"/>
		<updated>2017-01-12T00:43:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحة جديدة&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{Ancient Olympiads}}. It converts a year in the Gregorian&lt;br /&gt;
-- calendar to the equivalent year of the ancient Greek era organized by Olympiads.&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData( &amp;#039;Module:Ancient Olympiads/data&amp;#039; )&lt;br /&gt;
local lang = mw.language.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._main( inputYear )&lt;br /&gt;
	-- Convert the input to an integer if possible. Return &amp;quot;N/A&amp;quot; if the input could&lt;br /&gt;
	-- not be converted, or if the converted input is too big or too small.&lt;br /&gt;
	inputYear = tonumber( inputYear )&lt;br /&gt;
	if not inputYear or inputYear &amp;gt; tonumber( lang:formatDate( &amp;#039;Y&amp;#039; ) ) then&lt;br /&gt;
		return &amp;quot;&amp;#039;&amp;#039;N/A&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the length of the data.&lt;br /&gt;
	-- We need the length of the data so that we can loop through it backwards.&lt;br /&gt;
	-- Normally we can get the length of tables with the # operator, but this&lt;br /&gt;
	-- doesn&amp;#039;t work with mw.loadData, as mw.loadData uses a metatable, and the&lt;br /&gt;
	-- # operator doesn&amp;#039;t work for tables that use metatables.&lt;br /&gt;
	local dataLength = 0&lt;br /&gt;
	for i, t in ipairs( data ) do&lt;br /&gt;
		dataLength = i&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the year in the data page and display the output.&lt;br /&gt;
	for i = dataLength, 1, -1 do&lt;br /&gt;
		local t = data[i]&lt;br /&gt;
		if inputYear - 1 == t.year then&lt;br /&gt;
			-- year of the Olympiad, test with = p._main( -495 )&lt;br /&gt;
			-- The input year in the calendar is one after the expected (-775 for the year 776 BC). This is why all values need to be corrected by 1. &lt;br /&gt;
			-- Year of Olympiad creates autolink to same page, therefore eliminated here&lt;br /&gt;
			return string.format(&lt;br /&gt;
				&amp;#039;ال[[أولمبياد]] %s ([[%s|المنتصر]][[Winner of the Stadion race|)¹]]&amp;#039;,&lt;br /&gt;
				t.numberOl, t.winner&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
        if inputYear &amp;gt; t.year then&lt;br /&gt;
			-- Years 2-4 of the Olympiad, test with = p._main( -494 )  etc.&lt;br /&gt;
			-- It would be nice, if the string could be as follows:&lt;br /&gt;
			-- &amp;#039;ال[[أولمبياد]] [[%s]] ،[[%d ق م|سنة %d]]&amp;#039;,&lt;br /&gt;
			-- t.numberOl, inputYear * - 1 + 1, inputYear - t.year&lt;br /&gt;
			-- but unfortunately it links to the very same page and won&amp;#039;t be displayed as a link but in bold.&lt;br /&gt;
			return string.format(&lt;br /&gt;
				&amp;#039;ال[[أولمبياد]] [[%s|%s]]، %d سنة&amp;#039;,&lt;br /&gt;
				t.yearBC, t.numberOl, inputYear - t.year &lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- If input year is before 776 BC (-775), the year of the first Olympiad.&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;%d قبل ال[[أولمبياد]] [[776 ق م|الأولى]]&amp;#039;,&lt;br /&gt;
		inputYear * -1 - 775&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main( frame )&lt;br /&gt;
	-- If you only want to run this module from another Lua module, you can get&lt;br /&gt;
	-- rid of this function entirely. This function is only used if you want to&lt;br /&gt;
	-- run this individual module from a template.&lt;br /&gt;
	local args = require( &amp;#039;Module:Arguments&amp;#039; ).getArgs( frame, {&lt;br /&gt;
		parentOnly = true&lt;br /&gt;
	} )&lt;br /&gt;
	return p._main( args[ 1 ] )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>عبد العزيز</name></author>
	</entry>
</feed>