views:

170

answers:

2

hey,

I wanted to mention, i have simplepie working in my development environment but as soon as I uploaded the site I cannot get feeds into my homepage. Any ideas? here is the code that works on localhost:

function Homepage()
{
   parent::Controller();
   $this->base = $this->config->item('base_url');
   $this->css = $this->config->item('css');
   $this->images = $this->config->item('images');
   $this->load->library('simplepie');
   $this->simplepie->set_feed_url('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml');    
   $this->simplepie->set_cache_location(APPPATH.'cache/rss');
   $this->simplepie->init();
   $this->simplepie->handle_content_type();
}

function index()
{
  $data['rssdata'] = array(
    "title" => $this->simplepie->get_title(),
    "description" => $this->simplepie->get_description(),
    "items" => $this->simplepie->get_items(0,5)
    );
    $this->load->view($data)
}

this is the code that is in the view:

 <h3 class="ui-widget-header"><?= $rssdata['title']?></h3>
<div id="accordion" >
<div>
<h5><?= $rssdata['description']?></h5>
<p><?php foreach($rssdata['items'] as $item) :?>
<ul>
<li><?php anchor($item->get_link(),$item->get_title());?></li>
<li class="rssfeed"><?php echo $item->get_description();?></li>
</ul>
<p><small>Posted on <?php echo $item->get_date('j F Y g:i a');?></small></p>
<?php endforeach;?>
</div>
A: 

I've had this problem once, when my hosting setup did not have cURL installed, and error_reporting was off....

try setting var $force_fsockopen = false; to var $force_fsockopen = true; in the SimplePie config file to see if it makes a difference

pǝlɐɥʞ
hi ekhaled, did what you suggested and nothing. error suppression is something I think is messing with what i can do. I will keep pluggin away though and see what happens
Eagletrophy
+1  A: 

Use the newest "bleeding edge" from their GitHub profile, it sorts out several problems with PHP 5.3 which were making Apache explode from too many errors.

At time of writing, the bleeding edge is marked as v1.2.1-dev.

Phil Sturgeon