PDA

View Full Version : RSS Feed & HTML code


vAsia
01-15-2012, 01:43 PM
Hello,

When I use RSS Feed, it displays html code such as "' ;'" in the fetch

Does anyone know how to replace html code with its non-html code?

like:
str_replace("' ;'", "", $rss);

I don't know exactly where to put this code so it can replace those html code the way I want it to.

Thanks.

kh99
01-15-2012, 02:07 PM
I haven't tried it at all, but in includes/cron/rssposter.php, around line 317, there's this:

$pagetext = $feed['xml']->parse_template($body_template, $item);
if ($feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['html2bbcode'])
{



So if you wanted to do something to the text before it's posted you could insert it between those first two lines. Also there's a php function html_entity_decode() which you might be able to use to convert any of those kind of things without listing them all in a str_replace().

Disasterpiece
01-15-2012, 03:29 PM
why re-invent the wheel?

http://www.php.net/manual/en/function.html-entity-decode.php

vAsia
01-15-2012, 07:08 PM
Thank you for your time. =)

--------------- Added 1326693867 at 1326693867 ---------------


$pagetext = $feed['xml']->parse_template($body_template, $item);
$pagetext = html_entity_decode($pagetext);
if ($feed['rssoptions'] & $vbulletin->bf_misc_feedoptions['html2bbcode'])
{


I have tried putting the 2nd line (line 2) in-between, but it didn't work.
I still see output html code in both the subject and the body of the post. Any advice?