vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   RSS Feed & HTML code (https://vborg.vbsupport.ru/showthread.php?t=277017)

vAsia 01-15-2012 01:43 PM

RSS Feed & HTML code
 
Hello,

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

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

like:
str_replace("&#39 ;'", "", $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:
Code:

                       
$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/functio...ity-decode.php

vAsia 01-15-2012 07:08 PM

Thank you for your time. =)

--------------- Added [DATE]1326693867[/DATE] at [TIME]1326693867[/TIME] ---------------

PHP Code:

$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?


All times are GMT. The time now is 10:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01054 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete