This block now works without blog
authormoodler <moodler>
Fri, 31 Dec 2004 07:42:22 +0000 (07:42 +0000)
committermoodler <moodler>
Fri, 31 Dec 2004 07:42:22 +0000 (07:42 +0000)
blocks/rss_client/block_rss_client.php

index 30718ee9de8d53230777b3248f8a36baf07dd58e..19023e5b1947edabfe61f9a353234012cc73f3ab 100644 (file)
@@ -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
+?>