From d6501ee371381f32267d263d37183ac61e05e9d7 Mon Sep 17 00:00:00 2001 From: dhawes Date: Thu, 20 Jan 2005 01:32:58 +0000 Subject: [PATCH] if there are multiple feeds within a single block the title of each feed is shown with a horizontal rule between feeds --- blocks/rss_client/block_rss_client.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 4a443c4d30..886663f31f 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -82,9 +82,15 @@ class block_rss_client extends block_base { // Daryl Hawes note: if count of rssidarray is greater than 1 // we should possibly display a drop down menu of selected feed titles // so user can select a single feed to view (similar to RSSFeed) + $numids = count($rssidarray); + $count = 0; if (!empty($rssidarray)) { foreach ($rssidarray as $rssid) { - $output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries); + $output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false); + if ($numids > 1 && $count != $numids -1) { + $output .= '
'; + } + $count ++; } } @@ -107,7 +113,7 @@ class block_rss_client extends block_base { /** * */ - function get_rss_by_id($rssid, $display_description, $shownumentries) { + function get_rss_by_id($rssid, $display_description, $shownumentries, $showtitle=false) { global $CFG; $returnstring = ''; $rss_record = get_record('block_rss_client', 'id', $rssid); @@ -121,7 +127,10 @@ class block_rss_client extends block_base { } return; } - + + if ($showtitle) { + $returnstring .= '

'. $rss_record->title .'

'; + } if ($shownumentries > 0 && $shownumentries < count($rss->items) ) { $count_to = $shownumentries; } else { -- 2.39.5