1
turnerrw
News RSS Feed "full"
  • 2010/4/29 2:35

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


I have a syndication partner asking for a "full" RSS feed from my site. We publish news using the News module.

Is there an edit/hack or easy way to extend backend.php to include the bodytext field in addition to the hometext field in the RSS feed?

Cheers,
-Robert

2
ghia
Re: News RSS Feed "full"
  • 2010/4/29 7:16

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Just add the bodytext field to the query and result string.

However, you defeat the system of RSS being a teaser and luring people to your site, when they click on the article link to read the article in full.

3
turnerrw
Re: News RSS Feed "full"
  • 2010/4/29 16:51

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


You know, you're right and I pushed back on them re: the full RSS feed.

Now what I'd like to do is to add content to the bottom of the feed that includes two hyperlinks:

1) Read more ... that links to the article; and

2) Another link to the article that displays the full URL.

--

Now for the newbie question... "how do I do this?"

I've analyzed the backend.php script and my first guess is that I add code to this section:

foreach ($sarray as $story) {
            
$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
        }


Am I correct. Is there another place I need to edit? I tried adding a reference to bodytext in this section with no luck.


4
ghia
Re: News RSS Feed "full"
  • 2010/4/29 22:44

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


By replacing
$story->hometext()
with
$story->hometext().$story->bodytext()
?

5
turnerrw
Re: News RSS Feed "full"
  • 2010/4/30 0:13

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


Ghia - Thanks for your help.

Your last suggestion was exactly what was needed to create a "full" rss feed.

To add a linkback at the end of each story I added some code inside a CDATA callout in the system_rss.html template.

I should have thought of this sooner. Unfortunately, I'm not a professional coder and even after working with XOOPS for 6 years I'm still not completely up to speed on the architecture and which files you need to edit to get certain results.

Many thanks to the XOOPS Team/Project for creating a great platform! This site gets several million unique visitors per year, has 8,000 members and has over 12,000 articles in the stories table...and it runs flawlessly!

Cheers,
-Robert

6
Mamba
Re: News RSS Feed "full"
  • 2010/4/30 0:28

  • Mamba

  • Moderator

  • Posts: 11377

  • Since: 2004/4/23


Quote:
Many thanks to the XOOPS Team/Project for creating a great platform! This site gets several million unique visitors per year, has 8,000 members and has over 12,000 articles in the stories table...and it runs flawlessly!

We LOVE to hear such stories!

Thanks for sharing!!!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Login

Who's Online

451 user(s) are online (177 user(s) are browsing Support Forums)


Members: 0


Guests: 451


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits