CodeIgniter Forums

Full Version: RSS Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

CI Peepz, I've got a problem. If anyone has an answer, it would be very much appreciated.

I have an RSS feed I've created for someone, and it validates and everything is all cool. Same with the Atom feed. Here is the RSS feed:

Here is the atom:

As you might be able to guess from the URL, these are being generated from a controller and then generated in a view from a database.

So it shows up fine everywhere, but our client is all about Netvibes. Netvibes doesn't like these RSS feeds. Doesn't show the last 4 or so on the RSS feed, and maybe the last 1 on the atom, although it handles the Atom much better. I know Netvibes has a bit of delay, but on RSS its not just the delay - its been a few days. It just plain refuses to update the last few. Very strange.

Now here is the funny part, the RSS feed we created replaced an old feed, and the new feed is identical to the old one in every way. The old on apparently had no update problems.

I'm really confused as to why this is happening. Can anyone venture a guess?

El Forum

Can you show us some code please?

El Forum

Yes, here is the code generating the rss feed:

echo '<?xml version="1.0" encoding="utf-8"?>' . "

<rss version="2.0"

    &lt;title&gt;&lt;?php echo $feed_name; ?&gt;&lt;/title&gt;
    &lt;link&gt;&lt;?php echo $feed_url; ?&gt;&lt;/link&gt;
    <description>&lt;?php echo $page_description; ?&gt;</description>
    <pubDate>&lt;?php echo rss_date_format($last_date);?&gt;</pubDate>
    <lastBuildDate>&lt;?php echo rss_date_format($last_date);?&gt;</lastBuildDate>
    <language>&lt;?php echo $page_language; ?&gt;</language>
    <managingEditor>&lt;?php echo $creator_email; ?&gt;</managingEditor>

    <dc:rights>Copyright &lt;?php echo gmdate("Y", time()); ?&gt;</dc:rights>

    &lt;?php foreach($posts->result() as $entry): ?&gt;

          &lt;title&gt;&lt;?php echo xml_convert($entry->title); ?&gt;&lt;/title&gt;
          &lt;link&gt;&lt;?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?&gt;&lt;/link&gt;
          <guid>&lt;?php echo $this->config->item('link_url').$type."/entry/".$entry->id ?&gt;</guid>

    &lt;?php endforeach; ?&gt;

And here is the code generating the atom feed:

echo '&lt;?xml version="1.0" encoding="utf-8"?&gt;' . "

<feed >

&lt;link href=";?=$type;?&gt;" rel="self"/&gt;
&lt;link href=""/&gt;
   <name>CEOs For Cities</name>
<id>&lt;?php if($type=="blog"){ ?&gt;tag:www-ceosforcities-org,2008:/conversations/blog//1&lt;?php }else{?&gt;tag:www-ceosforcities-org,2008:/&lt;?=$type;?&gt;&lt;?php } ?&gt;</id>

    &lt;?php foreach($posts->result() as $entry): ?&gt;



    &lt;link rel="alternate" type="text/html" href="&lt;?php echo $this-&gt;config->item('link_url').$type."/entry/".$entry->id ?&gt;" />
    &lt;link rel="service.edit" type="application/atom+xml" href="&lt;?php echo $this-&gt;config->item('link_url').$type."/entry/".$entry->id ?&gt;" title="&lt;?=$entry->title;?&gt;" />

   <id>&lt;?php if($entry->entry_atom_id){ echo $entry->entry_atom_id;} else{?&gt;,&lt;?=dashes($entry->created_on);?&gt;:/&lt;?=$type;?&gt;/entry/&lt;?=$entry->id;?&gt;&lt;?php } ?&gt;</id>
   <summary>&lt;![CDATA[&lt;?=strip_tags(word_limiter($entry->body, 100));?&gt;]]></summary>
       <name>CEOs for Cities</name>
   <content type="html" xml:lang="en" xml:base="">

    &lt;?php endforeach; ?&gt;


atom_date, rss_date_format, and dashes are just formatting a the date from a datetime stamp. The output validates, and you can see that in the Atom/RSS feed output I linked to above.

The atom feed is also designed to smoothly work with the old one, hence some maneuvering around to keep old atom ids.

El Forum

I can't find any error..or something

only a tip although you know it..
&lt;?php echo
should be replaced with [code]&lt;?=[code]

just hang on someone will help u here for sure.. Smile

El Forum

Might not be of much help but I loaded your RSS feed in Netvibes and I got 30 items, including what seems to be your oldest item in the item "Great Cities Attract Ambitious People." Dunno if I'm missing something but it looks ok to me?

El Forum

After a lot of banging my head against the wall, it appears that Netvibes can sometimes have a problem with an RSS feed that is just coming from a url without a file extension.

For example, this didn't seem to work:

But this worked fine:


Thanks Yash and Parrots for taking a look at this - I really appreciate it. The info of trying switching your RSS feed to have a file extension is nowhere to be found on the net so hopefully this is helpful to someone at some point. Doesn't make sense, I know, but Netvibes was having a terrible time updating it correctly for some reason.

El Forum

Hello guys
i want to write view in a file.
The view contains all data
<summary>&lt;![CDATA[&lt;?=strip_tags(word_limiter($entry->body, 100));?&gt;]]></summary>


if ( ! write_file('file.php', $data)Wink
echo 'Unable to write the file';
echo 'File written!';

The file.php contain "Array" text.

My questions is how to write view in a file.

El Forum

@vinod_ci: Please start your own thread.