views:

32

answers:

1

So i just made my first RSS feed, or so i tought, in combination with CI. Now my view DOES display the top of my rss page (Title and Description), But all items are omitted. When i rightclick->view source it DOES contain all the items within the item tags.

Can anyone help me?

View (rss.php):

<?php echo '<?xml version="1.0" encoding="'.$encoding.'"?>'."\n"; ?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/"&gt;

<channel>
    <title><?php echo $feed_name; ?></title>
    <link><?php echo $feed_url; ?></link>
    <description><?php echo $page_description; ?></description>
    <dc:language><?php echo $page_language; ?></dc:language>
    <dc:creator><?php echo $creator_email; ?></dc:creator>
    <dc:rights>Copyright <?php echo gmdate("%Y", time()); ?></dc:rights>
    <dc:date><?php echo gmdate("%Y-%m-&#xdT;%H:%i:%s%Q", time()); ?></dc:date>
    <admin:generatorAgent rdf:resource="http://www.codeigniter.com/" />
  <?php foreach($items as $entry): ?>
  <?php $entry_url = base_url().$this->lang->lang().$localized_news[$this->lang->lang()].'/'.print_date(strtotime($entry->published), "{year}/{month2}").'/'.$entry->slug; ?>
      <item>
        <title><?php echo xml_convert($entry->title); ?></title>
        <link><?php echo $entry_url; ?></link>
        <guid><?php echo $entry_url; ?></guid>

        <description><?php echo $entry->summary; ?></description>
     <pubDate><?php echo date('r', $entry->published); ?></pubDate>
      </item>
  <?php endforeach; ?>
</channel>

This is what the output looks like: screenshot

and in the source, every item needed to be displayed is there. with <item> <link> <description> <guid> and <pubdate> tags.

Ive been looking for the cause for about 1.5 hours now. and i cant find anything. Can someone tell me if i did anything wrong? Appreciate the help!

~Menno

+4  A: 

First port of call: The W3C feed validator.

I'll bet* an Amstel beer against a delicious Kölsch that the validator will reveal what's wrong.

Characters outside the current character set, for example, can block the rendering of the whole feed.

* = must be 18 or older to participate. Prize must be claimed in downtown Cologne.

Pekka
didn't even read, +1 for the asterisk
Lo'oris
Cant up you yet, but i found thwe problem, was in the date formatting. Send me your postal adres and ill send you an Amstel beer!
Quaze
@Quaze that's all right! I think it would explode If I opened it after a postal ride. Just have one for me next time you're out drinking. :)
Pekka
@Pekka hehe allright, that'll be tonight ;) Thanks and have a nice weekend!
Quaze