RSS Feed help
2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 27, 2009 (RSS)
By yallaf1 - October 26, 2009
Hi
My RSS feed (below) works fine.However I would like to show the entire article including images. How would this be done?
Thanx in advance
Current RSS code:
<?xml version="1.0" encoding="UTF-8"?>
<rss
version="2.0">
<channel>
<title>YallaF1 Top Formula 1 Stories</title>
<description>YallaF1 Top Formula 1 Stories</description>
<link>http://www.yallaf1.com/stories.php</link>
<language>en-us</language>
<lastBuildDate>Mon, 26 Oct 2009 23:22:46 +0400</lastBuildDate>
<pubDate>Mon, 26 Oct 2009 23:22:43 +0400</pubDate>
<generator>FeedForAll v2.0 (2.0.2.9) unlicensed version http://www.feedforall.com</generator>
<?php foreach ($top_storiesRecords as $record): ?>
<?php endforeach ?>
<?php?>
<?php echo htmlspecialchars($record['title']) ?><item>
<title><?php
$text = $record['introduction'];
if (strlen($text)> 247):
$minCharsToRemove = strlen($text) - 247;
$text = preg_replace('/^(.*\S)\b.*?.{'.$minCharsToRemove.'}$/s', '\\1', $text) . "...";
endif;
echo htmlspecialchars($text);
?></title>
<description>http://www.yallaf1.com%3C?php%20echo%20$record%5B'_link'%5D%20?%3E</description>
<link isPermaLink="true">php echo $record['_link']</link>
<guid><?php echo date("r", strtotime($record['date'])) ?></guid>
<pubDate><?php echo date"r", strtotime($record['date'])) ?>(</pubDate>
</item>
</channel>
</rss>
My RSS feed (below) works fine.However I would like to show the entire article including images. How would this be done?
Thanx in advance
Current RSS code:
<?xml version="1.0" encoding="UTF-8"?>
<rss
version="2.0">
<channel>
<title>YallaF1 Top Formula 1 Stories</title>
<description>YallaF1 Top Formula 1 Stories</description>
<link>http://www.yallaf1.com/stories.php</link>
<language>en-us</language>
<lastBuildDate>Mon, 26 Oct 2009 23:22:46 +0400</lastBuildDate>
<pubDate>Mon, 26 Oct 2009 23:22:43 +0400</pubDate>
<generator>FeedForAll v2.0 (2.0.2.9) unlicensed version http://www.feedforall.com</generator>
<?php foreach ($top_storiesRecords as $record): ?>
<?php endforeach ?>
<?php?>
<?php echo htmlspecialchars($record['title']) ?><item>
<title><?php
$text = $record['introduction'];
if (strlen($text)> 247):
$minCharsToRemove = strlen($text) - 247;
$text = preg_replace('/^(.*\S)\b.*?.{'.$minCharsToRemove.'}$/s', '\\1', $text) . "...";
endif;
echo htmlspecialchars($text);
?></title>
<description>http://www.yallaf1.com%3C?php%20echo%20$record%5B'_link'%5D%20?%3E</description>
<link isPermaLink="true">php echo $record['_link']</link>
<guid><?php echo date("r", strtotime($record['date'])) ?></guid>
<pubDate><?php echo date"r", strtotime($record['date'])) ?>(</pubDate>
</item>
</channel>
</rss>
Re: [yallaf1] RSS Feed help
By Dave - October 27, 2009
If you have a field called uploads you could display them like this:
Also, if you find there are many more changes required and you have a sample of the output file you are trying to create we could also do it for you through consulting. If you'd like to do that feel free to email me at dave@interactivetools.com.
Hope that helps!
<?php foreach ($top_storiesRecords['uploads'] as $upload): ?>
<?php echo $upload['urlPath'] ?>
<?php echo $upload['width'] ?>
<?php echo $upload['height'] ?>
<?php endforeach ?>
Also, if you find there are many more changes required and you have a sample of the output file you are trying to create we could also do it for you through consulting. If you'd like to do that feel free to email me at dave@interactivetools.com.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com