<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.alakihel.ovh/index.php?action=history&amp;feed=atom&amp;title=Module%3AConflitdujour</id>
	<title>Module:Conflitdujour - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alakihel.ovh/index.php?action=history&amp;feed=atom&amp;title=Module%3AConflitdujour"/>
	<link rel="alternate" type="text/html" href="https://wiki.alakihel.ovh/index.php?title=Module:Conflitdujour&amp;action=history"/>
	<updated>2026-04-09T21:29:34Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.alakihel.ovh/index.php?title=Module:Conflitdujour&amp;diff=6284&amp;oldid=prev</id>
		<title>Alakihel : Page créée avec « local p = {}  -- Fonction pour lire la liste depuis Liste/Conflits local function lireListeDepuisPage()     local titreListe = mw.title.new(&quot;Liste/Conflits&quot;)     if not titreListe or not titreListe.exists then         return {}     end      local contenu = titreListe:getContent()     if not contenu then         return {}     end      local resultats = {}     for ligne in mw.ustring.gmatch(contenu, &quot;[^\n]+&quot;) do         ligne = mw.text.trim(ligne)         ligne = m... »</title>
		<link rel="alternate" type="text/html" href="https://wiki.alakihel.ovh/index.php?title=Module:Conflitdujour&amp;diff=6284&amp;oldid=prev"/>
		<updated>2025-07-18T17:27:08Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « local p = {}  -- Fonction pour lire la liste depuis Liste/Conflits local function lireListeDepuisPage()     local titreListe = mw.title.new(&amp;quot;Liste/Conflits&amp;quot;)     if not titreListe or not titreListe.exists then         return {}     end      local contenu = titreListe:getContent()     if not contenu then         return {}     end      local resultats = {}     for ligne in mw.ustring.gmatch(contenu, &amp;quot;[^\n]+&amp;quot;) do         ligne = mw.text.trim(ligne)         ligne = m... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Fonction pour lire la liste depuis Liste/Conflits&lt;br /&gt;
local function lireListeDepuisPage()&lt;br /&gt;
    local titreListe = mw.title.new(&amp;quot;Liste/Conflits&amp;quot;)&lt;br /&gt;
    if not titreListe or not titreListe.exists then&lt;br /&gt;
        return {}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local contenu = titreListe:getContent()&lt;br /&gt;
    if not contenu then&lt;br /&gt;
        return {}&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local resultats = {}&lt;br /&gt;
    for ligne in mw.ustring.gmatch(contenu, &amp;quot;[^\n]+&amp;quot;) do&lt;br /&gt;
        ligne = mw.text.trim(ligne)&lt;br /&gt;
        ligne = mw.ustring.gsub(ligne, &amp;quot;^[%s%p%c‣•·‥●◦‧]+&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
        ligne = mw.ustring.gsub(ligne, &amp;quot;&amp;amp;nbsp;&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
        if ligne ~= &amp;quot;&amp;quot; and not ligne:match(&amp;quot;&amp;lt;&amp;quot;) then&lt;br /&gt;
            table.insert(resultats, ligne)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return resultats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Tirage au hasard&lt;br /&gt;
local function pageAleatoire()&lt;br /&gt;
    math.randomseed(os.time())&lt;br /&gt;
    local liste = lireListeDepuisPage()&lt;br /&gt;
    if #liste == 0 then return nil end&lt;br /&gt;
    return liste[math.random(#liste)]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Fonction principale&lt;br /&gt;
function p.conflitDuJour(frame)&lt;br /&gt;
    local titrePage = pageAleatoire()&lt;br /&gt;
    local pageExiste = false&lt;br /&gt;
&lt;br /&gt;
    if not titrePage then&lt;br /&gt;
        titrePage = nil&lt;br /&gt;
    else&lt;br /&gt;
        local page = mw.title.new(titrePage)&lt;br /&gt;
        pageExiste = page and page.exists&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local contenu = (pageExiste and mw.title.new(titrePage):getContent()) or nil&lt;br /&gt;
    local theme = contenu and mw.ustring.match(contenu, &amp;quot;|%s*Theme%s*=%s*(%a+)&amp;quot;) or &amp;quot;conflit&amp;quot;&lt;br /&gt;
    local extrait = contenu and mw.ustring.match(contenu, &amp;quot;&amp;lt;!%-%-%s*extrait%s*%-%-&amp;gt;(.-)&amp;lt;!%-%-%s*/extrait%s*%-%-&amp;gt;&amp;quot;) or nil&lt;br /&gt;
&lt;br /&gt;
    local texteExtrait = extrait and mw.getCurrentFrame():preprocess(extrait)&lt;br /&gt;
        or &amp;quot;&amp;lt;span style=&amp;#039;color:gray;&amp;#039;&amp;gt;Aucun extrait disponible pour ce conflit.&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    local charteModule = require(&amp;quot;Module:Charte&amp;quot;)&lt;br /&gt;
    local couleurHR = charteModule.couleur{ args = { charte = theme, type = &amp;quot;hr&amp;quot; } }&lt;br /&gt;
&lt;br /&gt;
    local html = {}&lt;br /&gt;
    table.insert(html, &amp;quot;&amp;lt;div class=&amp;#039;&amp;quot; .. theme .. &amp;quot;-picto&amp;#039; style=&amp;#039;flex: 1 1 54%; border:1px solid #aaa; border-radius:10px; box-shadow:1px 1px 3px #ccc; overflow:hidden; display:flex; flex-direction:column;&amp;#039;&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    table.insert(html, &amp;quot;&amp;lt;div style=&amp;#039;padding:12px; flex:1;&amp;#039;&amp;gt;&amp;quot;)&lt;br /&gt;
    table.insert(html, &amp;quot;&amp;lt;div style=&amp;#039;font-size:1.2em; font-weight:bold;&amp;#039;&amp;gt;Évènement du jour&amp;lt;/div&amp;gt;&amp;quot;)&lt;br /&gt;
    table.insert(html, &amp;quot;&amp;lt;hr style=&amp;#039;border:none; border-top:1px solid &amp;quot; .. couleurHR .. &amp;quot;; margin:0; margin-bottom:12px;&amp;#039;&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    if titrePage then&lt;br /&gt;
        table.insert(html, &amp;quot;&amp;lt;div style=&amp;#039;font-size:1.1em; font-weight:bold; margin-bottom:4px;&amp;#039;&amp;gt;[[&amp;quot; .. titrePage .. &amp;quot;]]&amp;lt;/div&amp;gt;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        table.insert(html, &amp;quot;&amp;lt;div style=&amp;#039;font-size:1.1em; font-weight:bold; margin-bottom:4px;&amp;#039;&amp;gt;Conflit inconnu&amp;lt;/div&amp;gt;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    table.insert(html, texteExtrait)&lt;br /&gt;
&lt;br /&gt;
    if titrePage and pageExiste then&lt;br /&gt;
        table.insert(html, &amp;quot;&amp;lt;div style=&amp;#039;text-align:right; font-size:90%; margin-top:8px;&amp;#039;&amp;gt;[[&amp;quot; .. titrePage .. &amp;quot;|→ Vers l’article]]&amp;lt;/div&amp;gt;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    table.insert(html, &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    return table.concat(html, &amp;quot;\n&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alakihel</name></author>
	</entry>
</feed>