From 839bbd4d10979b508c687563a195d0d3429d6e40 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 31 Dec 2004 07:42:22 +0000 Subject: [PATCH] This block now works without blog --- blocks/rss_client/block_rss_client.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 30718ee9de..19023e5b19 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -20,9 +20,10 @@ class block_rss_client extends block_base { } function get_content() { - require_once($CFG->dirroot .'/rss/templib.php'); global $CFG, $editing; + require_once($CFG->dirroot .'/rss/templib.php'); + if($this->content !== NULL) { return $this->content; } @@ -30,9 +31,8 @@ class block_rss_client extends block_base { $this->content = new stdClass; $this->content->footer = ''; - if (empty($this->instance) || empty($CFG->blog_version)) { - // Either we're being asked for content without - // an associated instance of the Blog module has never been installed. + if (empty($this->instance)) { + // We're being asked for content without an associated instance $this->content->text = ''; return $this->content; } @@ -48,7 +48,7 @@ class block_rss_client extends block_base { if (!empty($this->config)) { if (!empty($this->config->rssid)) { - if (blog_array_count($this->config->rssid)) { + if (is_array($this->config->rssid)) { // rssid is an array of rssids $rssidarray = $this->config->rssid; } else { @@ -125,8 +125,6 @@ class block_rss_client extends block_base { for ($y = 0; $y < $count_to; $y++) { if ($rss->items[$y]['title'] == '') { -// $rss->items[$y]['description'] = blog_unhtmlentities($rss->items[$y]['description']); - //Daryl Hawes note: might want to define an additional instance/admin config item for this (20) - max_description_length $rss->items[$y]['title'] = substr(strip_tags($rss->items[$y]['description']), 0, 20) . '...'; } @@ -155,4 +153,4 @@ class block_rss_client extends block_base { } } -?> \ No newline at end of file +?> -- 2.39.5