vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Working on a full RSS feed ... formatting? (https://vborg.vbsupport.ru/showthread.php?t=67212)

pgrote 07-15-2004 04:34 PM

Working on a full RSS feed ... formatting?
 
Hello,

We are working to get external.php to spit out a feed that has full messages in it. We've managed to get it to include the whole message by replacing the thread preview part with thread.

Right now we're getting the formatting stripped out. I am sure it's in this line, but I am at a loss as to what to change now.

Quote:

echo "\t\t<content:encoded><![CDATA[". htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode($thread['preview'], false, true), $vboptions['thread'])) ."]]></content:encoded.\r\n";
Can someone tell me how to have it just put the message in there without stripping anything?

Andreas 07-15-2004 04:58 PM

PHP Code:

echo "\t\t<content:encoded><![CDATA["htmlspecialchars_uni($thread['preview']) ."]]></content:encoded.\r\n"

This should give you the full post, including all bbcodes.

pgrote 07-15-2004 05:16 PM

Quote:

Originally Posted by KirbyDE
PHP Code:

echo "\t\t<content:encoded><![CDATA["htmlspecialchars_uni($thread['preview']) ."]]></content:encoded.\r\n"

This should give you the full post, including all bbcodes.

Thank you for your response!

We gave that a shot, but it's the opposite of what we were going for. That includes the BBCODEs, but none of the original formatting.

For instance it looks like this:

PHP Code:

[b]Author: [/b] [i]09/19/03[/i] [SIZE=3][B]IP Tracker Issues[/B][/SIZE] [SIZE=2][COLOR=DarkOrange] [B]The following in an email sent by Christal SkaggsLead Desktop Analyston 1/29/03 regarding IP Tracker.[/B][/COLOR][/SIZEHere are some steps you can take in troubleshooting IPTracker issues

I had to put it as code so the formatting didn't come through. Notice the line breaks are missing on it. At this point we'd settle for something that pulled the HTML over and the linebreaks.

Thanks for any and all help you can provide.

Andreas 07-15-2004 05:32 PM

So you actually want to have parsed HTML?

Then use this:

PHP Code:

require_once('./includes/functions_bbcodeparse.php');
echo 
"\t\t<content:encoded><![CDATA["htmlspecialchars_uni(parse_bbcode2($thread['preview'], falsetruefalsetrue)) ."]]></content:encoded.\r\n"


pgrote 07-15-2004 05:50 PM

Quote:

Originally Posted by KirbyDE
So you actually want to have parsed HTML?

Then use this:

PHP Code:

require_once('./includes/functions_bbcodeparse.php');
echo 
"\t\t<content:encoded><![CDATA["htmlspecialchars_uni(parse_bbcode2($thread['preview'], falsetruefalsetrue)) ."]]></content:encoded.\r\n"


Maybe I don't want parsed HTML. :)

What we want is the HTML straight out. For instance using the code above gives us:

PHP Code:

&lt;b&gt;Author: &lt;/b&gt; &lt;i&gt;09/19/03&lt;/i&gt;&lt;br /&gt;
&
lt;br /&gt;
&
lt;font size=&quot;3&quot;&gt;&lt;b&gt;IP Tracker Issues&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
&
lt;font size=&quot;2&quot;&gt;&lt;font color=&quot;DarkOrange&quot;&gt;&lt;br /&gt;
&
lt;b&gt;The following in an email sent by 

Contrast that to the PHPBB feed we were able to generate on our old forums:

PHP Code:

Author: <a href="http://veswebdev.mcilink.com/phpbb2/profile.php?mode=viewprofile&u=10" target="_blank">Me</a><br />
SubjectEnd of Shift-Me-07/15/04<br />
PostedThu Jul 152004 1:22 pm (GMT -5)<br />
Topic Replies0<br /><br />
<
span class="postbody"><span style="color: blue">Outstanding issues: </span>
<
br />

<
br />
None
<br />

<
br />
<
span style="color: blue">Accomplishments: </span>
<
br />

<
br />
-
Monitored reps and tickets on the floor.
<
br /> 

Notice the difference in the HTML? For some reason vbulletin is sending out ampersands instead of HTML.

Does that make sense?

Thanks again for your help!

Andreas 07-15-2004 06:09 PM

Maybe you should clearly state what you actually want ... makes it easier to give an answer ;)

So you want HTML but not encoded? Then use this:
PHP Code:

require_once('./includes/functions_bbcodeparse.php');
echo 
"\t\t<content:encoded><![CDATA["parse_bbcode2($thread['preview'], falsetruefalsetrue) ."]]></content:encoded.\r\n"

Or do you want to remove BBCode, but have newlines converted to <br />?

Use this:
PHP Code:

echo "\t\t<content:encoded><![CDATA["nl2br(strip_bbcode($thread['preview'])) ."]]></content:encoded.\r\n"

Or the same but encoded?

PHP Code:

echo "\t\t<content:encoded><![CDATA["htmlspecialchars_uni(nl2br(strip_bbcode($thread['preview'])) )."]]></content:encoded.\r\n"

Or something completely different?

pgrote 07-15-2004 06:10 PM

ok nevermind I figured it out! Thanks for the help!

I noticed that the htmlspecialchars_uni function was somewhat un-doing what parse_bbcode2 was doing, so I removed it which gives me:

PHP Code:

require_once('./includes/functions_bbcodeparse.php'); 
echo 
"\t\t<content:encoded><![CDATA["parse_bbcode2($thread['preview'], falsetruefalsetrue) ."]]></content:encoded>\r\n"

Thanks again! hopefully that will help someone else out as well! :)

pgrote 07-15-2004 06:12 PM

Quote:

Originally Posted by KirbyDE
Maybe you should clearly state what you actually want ... makes it easier to give an answer ;)

So you want HTML but not encoded? Then use this:
PHP Code:

require_once('./includes/functions_bbcodeparse.php');
echo 
"\t\t<content:encoded><![CDATA["parse_bbcode2($thread['preview'], falsetruefalsetrue) ."]]></content:encoded.\r\n"

Or do you want to remove BBCode, but have newlines converted to <br />?

Use this:
PHP Code:

echo "\t\t<content:encoded><![CDATA["nl2br(strip_bbcode($thread['preview'])) ."]]></content:encoded.\r\n"

Or the same but encoded?

PHP Code:

echo "\t\t<content:encoded><![CDATA["htmlspecialchars_uni(nl2br(strip_bbcode($thread['preview'])) )."]]></content:encoded.\r\n"

Or something completely different?


haha yes the first one, I had figured it out...thanks for all of your help!!

scotty 07-20-2004 07:56 AM

@pgrote:
have you in mind to share the code and publish it here?


All times are GMT. The time now is 01:05 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.03152 seconds
  • Memory Usage 1,793KB
  • 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
  • (14)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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