aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2015-12-27 19:27:37 +0100
committerfilip <filip.komar@gmail.com>2015-12-27 19:27:37 +0100
commitf9de80a72443af9d2e2951ba06d877bd8f6a188f (patch)
tree941ff7b475ac15937a28f875a3423e2259f0e732
parent13245808535022957688b90aade8e4f3e68d09a3 (diff)
downloadwww-f9de80a72443af9d2e2951ba06d877bd8f6a188f.tar
www-f9de80a72443af9d2e2951ba06d877bd8f6a188f.tar.gz
www-f9de80a72443af9d2e2951ba06d877bd8f6a188f.tar.bz2
www-f9de80a72443af9d2e2951ba06d877bd8f6a188f.tar.xz
www-f9de80a72443af9d2e2951ba06d877bd8f6a188f.zip
improved feed presentation
-rw-r--r--en/community/index.php6
-rw-r--r--lib/news.php8
2 files changed, 7 insertions, 7 deletions
diff --git a/en/community/index.php b/en/community/index.php
index 569a6ae4f..ecd277e50 100644
--- a/en/community/index.php
+++ b/en/community/index.php
@@ -49,10 +49,10 @@ include '../../lib/news.php';
<div class="para" style="width: 400px;">
<section>
<?php
- if (_r('https://planet.mageia.org/en/') != 'https://planet.mageia.org/en/') {
- show_feed($locale, _r('News'), _r('https://planet.mageia.org/en/'), _r('https://planet.mageia.org/en/') . '?type=rss10', 9, null, true);
+ if (('en' == $locale) || (_r('https://planet.mageia.org/en/') != 'https://planet.mageia.org/en/')) {
+ show_feed($locale, _r('News') . ' (' . _r('Planet') . ')', _r('https://planet.mageia.org/en/'), _r('https://planet.mageia.org/en/') . '?type=rss10', 9, null, true);
} else {
- show_feed($locale, _r('News'), _r('https://blog.mageia.org/en/'), _r('https://blog.mageia.org/en/') . '?feed=rss', 9, null, true);
+ show_feed($locale, _r('News') . ' (' . _r('Blog') . ')', _r('https://blog.mageia.org/en/'), _r('https://blog.mageia.org/en/') . '?feed=rss', 9, null, true);
}
// don't work:
//show_feed('Mageia MLs', '', 'https://ml.mageia.org/l/rss/active_lists?count=20&for=10');
diff --git a/lib/news.php b/lib/news.php
index 90effbb22..601785770 100644
--- a/lib/news.php
+++ b/lib/news.php
@@ -136,7 +136,7 @@ function show_feed($locale, $news_title, $link, $feed, $count = 5, $skip = null,
if ($split && strpos($d['title'], ') : ') !== false) {
$title = explode(') : ', $d['title']);
- $source = ' / ' . array_shift($title) . ')';
+ $source = array_shift($title) . '): ';
$source = (is_null($date_separator) ? $source : null);
$title = implode(' : ', $title);
} else {
@@ -144,14 +144,14 @@ function show_feed($locale, $news_title, $link, $feed, $count = 5, $skip = null,
$source = null;
}
- $s .= sprintf('<li>%s<a href="%s">%s</a> %s<span class="dt">%s</span></li>',
- $discrete_title, $d['link'], $title, $date_separator, news_date($d['date'], $locale));
+ $s .= sprintf('<li>%s<a href="%s">%s%s</a> %s<span class="dt">%s</span></li>',
+ $discrete_title, $d['link'], $source, $title, $date_separator, news_date($d['date'], $locale));
$discrete_title = null;
}
$s .= '</ul>';
if (is_null($date_separator)) {
- $header = sprintf('<h2><a href="%s">%s%s</a></h2>', $link, $news_title, $source);
+ $header = sprintf('<h2><a href="%s">%s</a></h2>', $link, $news_title);
}
$s = $header . $s;