RSS Feed Setup
12 posts by 4 authors in: Forums > CMS Builder
Last Post: September 3, 2009 (RSS)
By Chris - September 2, 2009 - edited: September 2, 2009
Hi Nigel,
Simply replace the red text below with any of the code snippets I posted above:
Also, replacing the red text from the code snippet with:
Oh, and you'll probably want to change
to
Ugh. That's too much replacing. Here's a complete example:
Sorry that was so long-winded! Hope this helps! :D
Simply replace the red text below with any of the code snippets I posted above:
<description><?php echo htmlspecialchars($record['content']); ?></description>
Also, replacing the red text from the code snippet with:
$record['content']
Oh, and you'll probably want to change
echo $text;
to
echo htmlspecialchars($text);
Ugh. That's too much replacing. Here's a complete example:
<?php foreach ($top_storiesRecords as $record): ?>
<item>
<title><?php echo htmlspecialchars($record['title']) ?></title>
<link>http://www.yallaf1.com<?php echo $record['_link'] ?></link>
<description><?php
$text = $record['content'];
if (strlen($text) > 247):
$minCharsToRemove = strlen($text) - 247;
$text = preg_replace('/^(.*\S)\b.*?.{'.$minCharsToRemove.'}$/s', '\\1', $text) . "...";
endif;
echo htmlspecialchars($text);
?></description>
<pubDate><?php echo date("r", strtotime($record['date'])) ?></pubDate>
<guid isPermaLink="true">http://www.yallaf1.com<?php echo $record['_link'] ?></guid>
</item>
<?php endforeach ?>
Sorry that was so long-winded! Hope this helps! :D
All the best,
Chris
Chris
Re: [chris] RSS Feed Setup
Thanks so much for your advice, Chris. I'll give this a go.
Kind regards,
Kind regards,
Nigel Gordijk
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net