RSS Feed not showing description

Permalink Browser Info Environment
Hello there,

I love this addon but I need the RSS feed to be working perfectly because I'm updating client's facebook page with the feed, but the the feed only shows the News Title, the Source and the published date. Here's the feed entry source:
<entry>
   <title>Latest News</title>
   <link rel="alternate" type="text/html" href="http://mywebsite.com/v2/noticias/latest-news/"/>
   <published>2011-08-23T03:31:00+01:00</published>
   <updated>2011-08-23T03:31:00+01:00</updated>
   <id>http://mywebsite.com/v2/noticias/latest-news/</id>
   <author>
     <name>admin</name>
   </author>
</entry>

How can I add the description of the News to the feed?!

Thanks.
Pedro

Type: Discussion
Status: New
pribeiro
View Replies: View Best Answer
hanicker replied on at Permalink Best Answer Reply
hanicker
Thanks you for notifying this bug!
You can fix it very easily by opening
packages/easy_news/tools/rss.php
and changing line 44 from
$item->description = $page->getCollectionDescription;

to
$item->description = $page->getCollectionDescription();


Hope this helps.

Nick
pribeiro replied on at Permalink Reply
pribeiro
Thanks man. You just made my day.
pribeiro replied on at Permalink Reply
pribeiro
Now what about (not crucial, but it would be nice) If I had an image in the description of the news (which is the case), is it possible to show it in the RSS feed?! Now the feed is perfect, only missing this little detail:
<entry>
   <title>Latest News</title>
   <link rel="alternate" type="text/html" href="http://mywebsite.com/v2/noticias/latest-news/"/>
   <published>2011-08-23T03:31:00+00:00</published>
   <updated>2011-08-23T03:31:00+00:00</updated>
   <id>http://mywebsite.com/v2/noticias/latest-news/</id>
   <author>
     <name>admin</name>
   </author>
   <summary>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus fringilla dictum consequat. Maecenas sem leo, molestie et lobortis lacinia, cursus rutrum sem. Praesent tempus ultrices libero, vitae elementum massa ultricies id. Ut nunc justo, molestie eu scelerisque vitae, vestibulum eu lorem. Nulla blandit aliquet quam, lobortis lacinia elit sodales in. Nam tristique, augue sed rhoncus accumsan, risus turpis iaculis sapien, et iaculis lorem magna ac tortor. Morbi sit amet ipsum libero, vitae aliquam justo. Integer eget tempus nulla.</summary>
</entry>


If this is possible and easy to implement I would be apreciated :)

Thanks again.
hanicker replied on at Permalink Reply
hanicker
Actually I have to leave, but I'll try to do it later.

As the actual format of the feed is Atom, I don't think it's allowed
as shown inhttp://answers.oreilly.com/topic/1302-atom-syndication-format/...

Maybe I'll have to switch to RSS spec. Does it cause any harm to you?
pribeiro replied on at Permalink Reply
pribeiro
No it doesn't. I only want the RSS feed because of facebook updates, I use the RSS GRAFFITI application and it supports RSS 2.0, so no problem ;)

Appreciate your support.
Thanks
hanicker replied on at Permalink Reply
hanicker
Ok, let's try changing, in same file, line 57 from
$rss->outputFeed("ATOM1.0");

to
$rss->outputFeed("RSS2.0");


Hope it works
pribeiro replied on at Permalink Reply
pribeiro
Hi there,

with this replacement the feed is now valid RSS 2.0, but images are not showing up yet. Maybe it has something to do with feedcreator.class.php file?? At line 1112 we have:
for ($i=0;$i<count($this->items);$i++) {
   $feed.= "        <item>\n";
   $feed.= "        <title>".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100)."</title>\n";
   $feed.= "        <link>".htmlspecialchars($this->items[$i]->link)."</link>\n";
   $feed.= "        <description>".$this->items[$i]->getDescription()."</description>\n";
   if ($this->items[$i]->author!="") {
      $feed.= "     <author>".htmlspecialchars($this->items[$i]->author)."</author>\n";
   }


In the <description></description> field it doesn't mention anything about an image, and it doesn't have an <image></image> field too.
hanicker replied on at Permalink Reply
hanicker
Ok, the solution seems about adding and Enclosure to items using
$item->enclosure = new EnclosureItem();
    $item->enclosure->url='http://http://www.dailyphp.net/media/image.jpg';
    $item->enclosure->length="950230";
    $item->enclosure->type='image/jpeg';


So we have parse text for images and add them in that format.

Part of the solution may be
$eb = $page->getBlocks('Main');
   foreach($eb as $b) {
      if($b->getBlockTypeHandle()=='content')
         $newsBody = $b->getInstance()->getContent();
   }         
   $pattern = "/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";
   preg_match_all($pattern, $newsBody, $images);
   if(isset($images[1])&&isset($images[1][0])){
      $item->enclosure = new EnclosureItem();
      $item->enclosure->url=$images[1][0];
      $item->enclosure->length="";
      $item->enclosure->type='image/jpeg';
   }

That should work except for length and some error in the path (so you can use SITE_PATH constant). Sorry if the solution is not complete.
pribeiro replied on at Permalink Reply
pribeiro
Hi there,

Sorry for this (maybe silly) question, but....where do I put this code block you just write here?! I've tryed to put it on both of the files (rss.php and feedcreator.class.php) and I keep getting an error:

"Fatal error: Call to a member function getBlocks() on a non-object..."

You know, I'm not a programmer, just a designer that really likes to challenge himself ;)

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.