aboutsummaryrefslogtreecommitdiffstats
path: root/lib/news.php
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 /lib/news.php
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
Diffstat (limited to 'lib/news.php')
-rw-r--r--lib/news.php47
1 files changed, 28 insertions, 19 deletions
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;
+}