codeigniter simplepie

时间:2009-10-27 23:05:39

标签: codeigniter simplepie

我想提一下,我的easypie在我的开发环境中工作,但是一旦我上传了网站,我就无法将信息输入到我的主页。有任何想法吗?这是适用于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>

2 个答案:

答案 0 :(得分:2)

使用GitHub配置文件中最新的“前沿”,它排除了PHP 5.3的几个问题,这些问题使得Apache因太多错误而爆炸。

在撰写本文时,前沿标记为v1.2.1-dev

答案 1 :(得分:0)

我遇到过这个问题,当我的托管设置没有安装cURL,并且error_reporting已关闭....

尝试在SimplePie配置文件中将var $force_fsockopen = false;设置为var $force_fsockopen = true;以查看它是否有所作为