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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
visualharmony
Forum Members
Forum Members
Posts: 30
Joined: Tue Dec 02, 2008 1:20 am
Location: Ocala, Florida

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

Post 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!!!
Last edited by visualharmony on Mon May 18, 2009 11:28 pm, edited 1 time in total.
Visual Harmony, Website Design Blog

To the Devs: Thanks for making CMS Made Simple. It is great and getting better all the time!
visualharmony
Forum Members
Forum Members
Posts: 30
Joined: Tue Dec 02, 2008 1:20 am
Location: Ocala, Florida

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

Post 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
Visual Harmony, Website Design Blog

To the Devs: Thanks for making CMS Made Simple. It is great and getting better all the time!
Post Reply

Return to “Developers Discussion”