diff options
author | filip <filip.komar@gmail.com> | 2015-04-28 23:26:42 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2015-04-28 23:26:42 +0200 |
commit | 55df803f3a7cf403bc2c31c9a06cb1806a42fccc (patch) | |
tree | 84d8cb2ade35426c79be2d0885541c97c1b25302 /lib/news.php | |
parent | 10185d2fdab43c181ea4bb08d22c13934e65603b (diff) | |
download | www-55df803f3a7cf403bc2c31c9a06cb1806a42fccc.tar www-55df803f3a7cf403bc2c31c9a06cb1806a42fccc.tar.gz www-55df803f3a7cf403bc2c31c9a06cb1806a42fccc.tar.bz2 www-55df803f3a7cf403bc2c31c9a06cb1806a42fccc.tar.xz www-55df803f3a7cf403bc2c31c9a06cb1806a42fccc.zip |
add a date separator (|) between blog title and it's date
Diffstat (limited to 'lib/news.php')
-rw-r--r-- | lib/news.php | 11 |
1 files changed, 6 insertions, 5 deletions
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('<h3><a href="%s">%s</a></h3>', $link, $title); @@ -124,9 +125,9 @@ function show_feed($locale, $title, $link, $feed, $count = 5, $skip = null, $spl $source = null; } - $s .= sprintf('<li>%s<a href="%s">%s</a> <span class="dt">%s%s</span></li>', - $prefix, $d['link'], $title, news_date($d['date'], $locale), $source); - $prefix = null; + $s .= sprintf('<li>%s<a href="%s">%s</a> %s<span class="dt">%s%s</span></li>', + $discrete_title, $d['link'], $title, $date_separator, news_date($d['date'], $locale), $source); + $discrete_title = null; } $s .= '</ul>'; echo $s; |