• Hello

    I’m using WP version 2.8.4 and one of the plug-ins I have installed is RSSphoto version 0.6.1. Frequently when my blog pages load I get this error message:

    Warning: Invalid argument supplied for foreach() in /home/myaccount/public_html/Blog/wp-content/plugins/rssphoto/RSSPhoto.class.php on line 96

    Even though the message displays, the pics from my rss feed load and the slideshow works.

    From the file RSSPhoto.class.php this is the bit it’s talking about at line 96

    I have no clue what’s wrong with this bit of code or how it should be written for my setup.

    foreach($image_url as $url)

    if it helps any, this is the section where it’s from

    // pull out image url, link
              $item_title = $item->get_title();
              $item_url = $item->get_link(0);
              if($this->feed->get_type() & SIMPLEPIE_TYPE_RSS_ALL)
              {
                if($enclosures = $item->get_enclosures())
                  $image_url = $this->get_img_urls($enclosures,$this->img_sel,$this->num_img,'Enclosures');
                else
                  $image_url = $this->get_img_urls($item,$this->img_sel,$this->num_img,'Description');
              }
              elseif ($this->feed->get_type() & SIMPLEPIE_TYPE_ATOM_ALL)
              {
                $image_url = $this->get_img_urls($item,$this->img_sel,$this->num_img,'Content');
              }
    
              foreach($image_url as $url)
              {
                $thumb_url = $this->create_thumbnail($url,$fixed,$size,$min_size);
                if($thumb_url!=false)
                {
                  $this->add_image($thumb_url,$item_url,$item->get_description());
                }
              }
            }
            else // item==false
            {
              $this->error_msg="<p>Tried to load item #$item_idx from <a href=\"$url\">$url</a> and couldn't!</p>";
              if($this->feed->error())
              {
                $this->error_msg.="<p>The SimplePie error was ";
                $this->error_msg.=$this->feed->error();
                $this->error_msg.="</p>";
              }
              $this->title=apply_filters('widget_title', 'Oops!');
            }
          }
        }
      }
    
      function html()
      {
        switch($this->output)
        {
          case 'Slideshow':
            return $this->slideshow_html();
            break;
          case 'Static':
          default:
            return $this->static_html();
            break;
        }
      }

    I hope someone knows what the fix is. I like this plugin.

    Thanks
    ilhaverde

  • The topic ‘RSSphoto error message’ is closed to new replies.