I am filtering them out manually now not sure if there is a better way
though?
public function index()
{
$rssMaxCharDescription = 500;
// Check to see if the users has requested an rss feed
$isFeed = ife($this->RequestHandler->prefers('rss') == 'rss',
true,
false);
// Strip al html for the rss feed
if ($isFeed)
{
$articles = $this->paginate('Article',
array('published' =>
'yes'));
foreach ($articles as $key => $value)
{
// Remove html
$articles[$key]['Article']['article'] =
strip_tags($articles[$key]
['Article']['article']);
// Shorten the text
if
(strlen($articles[$key]['Article']['article']) >
$rssMaxCharDescription)
{
$articles[$key]['Article']['article'] =
substr($articles[$key]
['Article']['article'],0, $rssMaxCharDescription);
// Add ...
$articles[$key]['Article']['article']
.= '...';
}
}
$this->set('articles', $articles);
}
else
{
// Get all articles paginated which are published
$this->set('articles', $this->paginate('Article',
array('published' => 'yes')));
}
}
On Aug 19, 3:16 pm, Mech7 <[EMAIL PROTECTED]> wrote:
> I have tried to make the rss functionality as described
> here:http://jirikupiainen.com/2007/05/30/creating-rss-feeds-with-cakephp-12/
>
> Only there is one problem, it converts the entire text to html
> entities, so things like the images stay in the xml, is there anyway
> to filter these out?
>
> Like: <img src="/uploaded/image/Tree.jpg" border="
> 0" align="left" />
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---