View Full Version : Working on a full RSS feed ... formatting?
pgrote
07-15-2004, 05:34 PM
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.
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, 05:58 PM
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, 06:16 PM
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:
Author: 09/19/03 IP Tracker Issues The following in an email sent by Christal Skaggs, Lead Desktop Analyst, on 1/29/03 regarding IP Tracker. Here 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, 06:32 PM
So you actually want to have parsed HTML?
Then use this:
require_once('./includes/functions_bbcodeparse.php');
echo "\t\t<content:encoded><![CDATA[". htmlspecialchars_uni(parse_bbcode2($thread['preview'], false, true, false, true)) ."]]></content:encoded.\r\n";
pgrote
07-15-2004, 06:50 PM
So you actually want to have parsed HTML?
Then use this:
require_once('./includes/functions_bbcodeparse.php');
echo "\t\t<content:encoded><![CDATA[". htmlspecialchars_uni(parse_bbcode2($thread['preview'], false, true, false, true)) ."]]></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:
<b>Author: </b> <i>09/19/03</i><br />
<br />
<font size="3"><b>IP Tracker Issues</b></font><br />
<font size="2"><font color="DarkOrange"><br />
<b>The following in an email sent by
Contrast that to the PHPBB feed we were able to generate on our old forums:
Author: <a href="http://veswebdev.mcilink.com/phpbb2/profile.php?mode=viewprofile&u=10" target="_blank">Me</a><br />
Subject: End of Shift-Me-07/15/04<br />
Posted: Thu Jul 15, 2004 1:22 pm (GMT -5)<br />
Topic Replies: 0<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, 07: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:
require_once('./includes/functions_bbcodeparse.php');
echo "\t\t<content:encoded><![CDATA[". parse_bbcode2($thread['preview'], false, true, false, true) ."]]></content:encoded.\r\n";
Or do you want to remove BBCode, but have newlines converted to <br />?
Use this:
echo "\t\t<content:encoded><![CDATA[". nl2br(strip_bbcode($thread['preview'])) ."]]></content:encoded.\r\n";
Or the same but encoded?
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, 07: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:
require_once('./includes/functions_bbcodeparse.php');
echo "\t\t<content:encoded><![CDATA[". parse_bbcode2($thread['preview'], false, true, false, true) ."]]></content:encoded>\r\n";
Thanks again! hopefully that will help someone else out as well! :)
pgrote
07-15-2004, 07:12 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:
require_once('./includes/functions_bbcodeparse.php');
echo "\t\t<content:encoded><![CDATA[". parse_bbcode2($thread['preview'], false, true, false, true) ."]]></content:encoded.\r\n";
Or do you want to remove BBCode, but have newlines converted to <br />?
Use this:
echo "\t\t<content:encoded><![CDATA[". nl2br(strip_bbcode($thread['preview'])) ."]]></content:encoded.\r\n";
Or the same but encoded?
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, 08:56 AM
@pgrote:
have you in mind to share the code and publish it here?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.