From 71d370dfa8e3f702c2c29a56fc2ac409297ea141 Mon Sep 17 00:00:00 2001 From: filip Date: Fri, 1 May 2015 00:47:34 +0200 Subject: reuse news title for community page + improvement of show_feed added some fallback move source of the news to their title --- en/community/index.php | 5 ++--- lib/news.php | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/en/community/index.php b/en/community/index.php index c8b13dc2e..0e927b9de 100644 --- a/en/community/index.php +++ b/en/community/index.php @@ -48,12 +48,11 @@ include '../../lib/news.php';
-

%s', $link, $title); + $header = ''; + $source = null; + $date_separator = (is_null($discrete_title) ? null : '| '); $s .= '
    '; foreach ($data as $d) { if (!is_null($skip) && strpos($d['link'], $skip) !== false) continue; - if ($split && strpos($d['title'], ' : ') !== false) { - $title = explode(' : ', $d['title']); - $source = ' / ' . array_shift($title); + if ($split && strpos($d['title'], ') : ') !== false) { + $title = explode(') : ', $d['title']); + $source = ' / ' . array_shift($title) . ')'; + $source = (is_null($date_separator) ? $source : null); $title = implode(' : ', $title); } else { $title = $d['title']; $source = null; } - $s .= sprintf('
  • %s%s %s%s%s
  • ', - $discrete_title, $d['link'], $title, $date_separator, news_date($d['date'], $locale), $source); + $s .= sprintf('
  • %s%s %s%s
  • ', + $discrete_title, $d['link'], $title, $date_separator, news_date($d['date'], $locale)); $discrete_title = null; } $s .= '
'; + + if (is_null($date_separator)) { + $header = sprintf('

%s%s

', $link, $news_title, $source); + } + + $s = $header . $s; echo $s; } -- cgit v1.2.1