aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-04-19 15:30:30 +0000
committerRomain d'Alverny <rda@mageia.org>2011-04-19 15:30:30 +0000
commit0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54 (patch)
treed07a2d9596357bb255148d2274f1fb07ba9eb6d4
parent449ce650e432a5fc2ff69aafe2aecdb78e823036 (diff)
downloadwww-0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54.tar
www-0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54.tar.gz
www-0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54.tar.bz2
www-0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54.tar.xz
www-0a3a3441a4646aadf2bc4a91ce154d7ac90e2d54.zip
release counter
-rw-r--r--fr/index.php14
-rw-r--r--release_counter.php58
2 files changed, 66 insertions, 6 deletions
diff --git a/fr/index.php b/fr/index.php
index 4af3f2e96..689782ae3 100644
--- a/fr/index.php
+++ b/fr/index.php
@@ -31,6 +31,7 @@
(<a href="#announce">voir l&rsquo;annonce originale</a>).</p>
</div>
</div>
+ <?php include '../release_counter.php'; ?>
<div class="yui-g bb1">
<div class="yui-u first rb1">
<div class="para" id="news">
@@ -60,17 +61,18 @@
<li><a href="mailto:press@mageia.org">press@mageia.org</a></li>
<li>attendez une réponse dans les 2 jours</li>
</ul></li>
- <li><a href="http://www.twitter.com/mageia_org">twitter.com/mageia_org</a></li>
- <li><a href="http://identi.ca/mageia">identi.ca/mageia</a></li>
</ul>
- <!--
- <p>Please do not use this address for discussions that can happen on above mailing-lists
- or IRC channels.</p>
- -->
</div>
</div>
<div class="yui-u">
<div class="para">
+ <p>
+ <a href="http://blog.mageia.org/fr/?feed=rss"><img src="/g/images/smi/feed-32x32.png" alt="Mageia Blog (français)"></a>
+ <a href="http://www.twitter.com/mageia_org"><img src="/g/images/smi/twitter-32x32.png" alt="@mageia_org"></a>
+ <a href="http://identi.ca/mageia"><img src="/g/images/smi/identica-32x32.png" alt="@mageia"></a>
+ <a href="http://www.facebook.com/Mageia"><img src="/g/images/smi/facebook-32x32.png" alt="Mageia"></a>
+ <a href="http://www.flickr.com/photos/mageia_org"><img src="/g/images/smi/flickr-32x32.png"></a>
+ </p>
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FMageia%2F157247240967735&amp;width=320&amp;connections=10&amp;stream=false&amp;header=false&amp;height=255" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:320px; height:255px;" allowTransparency="true"></iframe>
</div>
</div>
diff --git a/release_counter.php b/release_counter.php
new file mode 100644
index 000000000..dfa2bf9f2
--- /dev/null
+++ b/release_counter.php
@@ -0,0 +1,58 @@
+<?php
+/**
+*/
+
+if (isset($_GET['l'])) {
+ $locale = $_GET['l'];
+}
+else {
+ $path = explode('/', $_SERVER['REQUEST_URI']);
+ $locale = $path[1];
+ if (strlen($locale) > 5)
+ $locale = 'en';
+}
+
+$locales = array(
+ 'en' => array('template' => 'Mageia 1 <span>%s</span> %d %s', 'minus' => 'minus', 'day' => 'day', 'days' => 'days'),
+ 'fr' => array('template' => 'Mageia 1 <span>%s</span> %d %s', 'minus' => 'moins', 'day' => 'jour', 'days' => 'jours')
+);
+if (!array_key_exists($locale, $locales))
+ $locale = 'en';
+
+$l = $locales[$locale];
+
+// Mageia 1 on June 1st, 2011
+$release_ts = strtotime('2011/06/01 12:00:00');
+$now_ts = time();
+$diff = $release_ts - $now_ts;
+$s = '';
+
+if ($diff < 0) {
+ // todo (rda)
+}
+else {
+ $diff = floor($diff / 3600 / 24);
+ $s = sprintf('<h2>Mageia 1 <span>%s</span>%d %s</h2>',
+ $l['minus'],
+ $diff,
+ $diff > 1 ? $l['days'] : $l['day']);
+}
+
+echo <<<S
+<!-- from http://mageia.org/release_counter.php?l={your_locale} -->
+<style>
+div#mgacount { font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif; color: #fff;
+ background: #3494D3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#3494D3), color-stop(60%, #3494D3), to(#2383C2));
+ background: -moz-linear-gradient(top, #ffffff 50%, #f0f0f0);
+ background: -webkit-linear-gradient(top, #ffffff 50%, #f0f0f0);
+ background: linear-gradient(top, #ffffff 50%, #f0f0f0);
+
+
+ margin: 0; padding: 0;
+ text-align: center; }
+#mgacount h2 { padding: 0.6em; font-size: 220%; color: #fff; font-weight: normal; margin-bottom: 0; }
+#mgacount h2 span { font-size: 35%; vertical-align: 50%; margin: 0 1em; }
+</style>
+<div id="mgacount">{$s}</div>
+S;