Page 1 of 1

[SOLVED] Fatal error: Call to undefined function get_items()

Posted: Mon May 18, 2009 9:26 pm
by visualharmony
I am having quite a hard time getting a simple php rss parser installed within CMSMS (1.5.4).

I am using Simplepie to pull weather from MSN's weather feed.  When I set it up outside of CMSMS, everything worked perfectly.  To bring it in, I made two UDTs (one for calling SimplePie and the other to place the weather on the page).  No matter what I have tried, I have been unsuccessful in getting past the following error:

"Fatal error: Call to undefined function get_items() in *directory_structure_removed*/cms/lib/content.functions.php(857) : eval()'d code on line 1"

Here's the SimplePie UDT:

Code: Select all

require_once('inc/simplepie.inc');
  
$feed = new SimplePie('http://weather.msn.com/RSS.aspx?wealocations=wc:USFL0355&weadegreetype=F');
  
$feed->enable_cache(true);
$feed->set_cache_location('cache');
$feed->set_cache_duration(3600);
  
$feed->init();
  
$feed->handle_content_type();
And the part from the weather UDT where it ends in error:

Code: Select all

foreach ($feed->get_items(1,2) as $item):
I haven't made any changes to the core or anything like that.  Has anyone experienced this with another PHP script and maybe found a work around?  TIA!!!

Re: Fatal error: Call to undefined function get_items()

Posted: Mon May 18, 2009 11:27 pm
by visualharmony
Nevermind–I fixed the problem.  I had to combine the UDTs into one UDT.  I was trying to match up the code to be exactly how I had it when it was working outside of CMSMS, which was in two separate PHP snippets.  It hadn't crossed my mind to combine them til after I had made this post.

Cheers,
VH