aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-06-29 16:17:11 +0000
committerRomain d'Alverny <rda@mageia.org>2011-06-29 16:17:11 +0000
commita495f0cbd603d33e8c8d69afdadf81d3aa92ebd2 (patch)
treeeff9dc41d52fd338cee729dd4c61e83a8fb48de1
parentb6db535862a15c3b4473ab3b324878cbfa792283 (diff)
downloadwww-a495f0cbd603d33e8c8d69afdadf81d3aa92ebd2.tar
www-a495f0cbd603d33e8c8d69afdadf81d3aa92ebd2.tar.gz
www-a495f0cbd603d33e8c8d69afdadf81d3aa92ebd2.tar.bz2
www-a495f0cbd603d33e8c8d69afdadf81d3aa92ebd2.tar.xz
www-a495f0cbd603d33e8c8d69afdadf81d3aa92ebd2.zip
republish news on home page, bottom
-rw-r--r--en/index.php24
-rw-r--r--lib/news.php47
2 files changed, 40 insertions, 31 deletions
diff --git a/en/index.php b/en/index.php
index 851676247..52f112684 100644
--- a/en/index.php
+++ b/en/index.php
@@ -48,18 +48,22 @@ $_t = i18n::get_strings($_t, $locale, $i18n_fallback_rules);
<p><a href="http://twitter.com/mageia_org" class="twitter-follow-button" data-lang="<?php echo $locale; ?>">Follow @mageia_org</a>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script></p>
</div></div>
- <?php /*
- <div class="yui-g bb1">
- <div class="para"><p><?php echo $_t['about'][0]; ?></p>
+
+ <div class="yui-g">
+ <div class="para bb1" id="news">
+ <?php
+ include '../lib/news.php';
+ echo sprintf('<h2><a href="%s">%s</a></h2>', blog_link($locale), $_t['news']);
+ echo html_news($locale);
+ ?>
+ </div>
+ <div class="para bb1"><p><?php echo $_t['about'][0]; ?></p>
<p><?php echo $_t['about'][1]; ?></p>
</div>
</div>
+ <?php /*
<div class="yui-g bb1">
<div class="yui-u first rb1">
- <div class="para" id="news">
- <h2><a href="http://blog.mageia.org/"><?php echo $_t['news']; ?></a></h2>
- <?php include '../lib/news.php'; echo html_news($locale); ?>
- </div>
</div>
<div class="yui-u">
<div class="para">
@@ -68,6 +72,7 @@ $_t = i18n::get_strings($_t, $locale, $i18n_fallback_rules);
</div>
</div>
</div>
+
<div class="yui-g bb1">
<div class="yui-u first">
<div class="para" id="contact">
@@ -92,11 +97,6 @@ $_t = i18n::get_strings($_t, $locale, $i18n_fallback_rules);
</p>
</div>
</div>
- <div class="yui-u">
- <div class="para">
- <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>
</div>
*/ ?>
</div>
diff --git a/lib/news.php b/lib/news.php
index 69f1eccb1..f2d9b2cb3 100644
--- a/lib/news.php
+++ b/lib/news.php
@@ -63,25 +63,7 @@ function news_date($dt, $locale = 'en')
*/
function get_news($locale = 'en', $count = 5, $cache_timeout = 5)
{
- $news = array(
- 'en' => 'http://blog.mageia.org/',
- 'fr' => 'http://blog.mageia.org/fr/',
- 'es' => 'http://blog.mageia.org/es/',
- 'de' => 'http://blog.mageia.org/de/',
- 'el' => 'http://blog.mageia.org/el/',
- 'it' => 'http://blog.mageia.org/it/',
- 'pt' => 'http://blog.mageia.org/pt-br/', // @fixme => /pt/ once blog is moved
- 'ro' => 'http://blog.mageia.org/ro/',
- 'tr' => 'http://blog.mageia.org/tr/',
- 'pl' => 'http://blog.mageia.org/pl/',
- 'ru' => 'http://blog.mageia.org/ru/',
- /* missing: et, fi, lv, nb, nl, sl, zh-cn, zh-tw */
- );
-
- if (!array_key_exists($locale, $news))
- $locale = 'en';
-
- $source_url = $news[$locale];
+ $source_url = blog_link($locale);
include_once G_APP_ROOT . '/lib/simplepie/simplepie.inc';
$feed = new SimplePie($source_url,
@@ -106,3 +88,30 @@ function get_news($locale = 'en', $count = 5, $cache_timeout = 5)
return $items;
}
+
+/**
+*/
+function blog_link($locale)
+{
+ $news = array(
+ 'el' => 'http://blog.mageia.org/el/',
+ 'en' => 'http://blog.mageia.org/en/',
+ 'es' => 'http://blog.mageia.org/es/',
+ 'fr' => 'http://blog.mageia.org/fr/',
+ 'de' => 'http://blog.mageia.org/de/',
+ 'it' => 'http://blog.mageia.org/it/',
+ 'pl' => 'http://blog.mageia.org/en/', // pl when up to date
+ 'pt' => 'http://blog.mageia.org/pt/',
+ 'ro' => 'http://blog.mageia.org/ro/',
+ 'ru' => 'http://blog.mageia.org/en/', // ru, when up to date
+ 'tr' => 'http://blog.mageia.org/tr/',
+ /* missing: et, fi, lv, nb, nl, sl, zh-cn, zh-tw */
+ );
+
+ if (!array_key_exists($locale, $news))
+ $locale = 'en';
+
+ $source_url = $news[$locale];
+
+ return $source_url;
+}