From 55df803f3a7cf403bc2c31c9a06cb1806a42fccc Mon Sep 17 00:00:00 2001 From: filip Date: Tue, 28 Apr 2015 23:26:42 +0200 Subject: add a date separator (|) between blog title and it's date --- lib/news.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/news.php b/lib/news.php index 7e01dae21..d39d6529e 100644 --- a/lib/news.php +++ b/lib/news.php @@ -95,11 +95,11 @@ function get_feed($url, $count = 5, $cache_timeout = 5) * @param integer $count how many items to return * @param string $skip url whose element we want to skip (why?) * @param boolean split title that has been built by aggregator - * @param string $prefix discrete title + * @param string $discrete_title more discrete title * * @return string */ -function show_feed($locale, $title, $link, $feed, $count = 5, $skip = null, $split = false, $prefix = null) { +function show_feed($locale, $title, $link, $feed, $count = 5, $skip = null, $split = false, $discrete_title = null) { if (!is_null($skip)) $count += 5; @@ -107,6 +107,7 @@ function show_feed($locale, $title, $link, $feed, $count = 5, $skip = null, $spl $data = get_feed($feed, $count); $s = ''; + $date_separator = (is_null($discrete_title) ? null : ' | '); if (!is_null($title)) $s .= sprintf('

%s

', $link, $title); @@ -124,9 +125,9 @@ function show_feed($locale, $title, $link, $feed, $count = 5, $skip = null, $spl $source = null; } - $s .= sprintf('
  • %s%s %s%s
  • ', - $prefix, $d['link'], $title, news_date($d['date'], $locale), $source); - $prefix = null; + $s .= sprintf('
  • %s%s %s%s%s
  • ', + $discrete_title, $d['link'], $title, $date_separator, news_date($d['date'], $locale), $source); + $discrete_title = null; } $s .= ''; echo $s; -- cgit v1.2.1