Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 07-15-2004, 05:34 PM
pgrote pgrote is offline
 
Join Date: Feb 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 07-15-2004, 05:58 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 07-15-2004, 06:16 PM
pgrote pgrote is offline
 
Join Date: Feb 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-15-2004, 06:32 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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"
Reply With Quote
  #5  
Old 07-15-2004, 06:50 PM
pgrote pgrote is offline
 
Join Date: Feb 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #6  
Old 07-15-2004, 07:09 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 07-15-2004, 07:10 PM
pgrote pgrote is offline
 
Join Date: Feb 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #8  
Old 07-15-2004, 07:12 PM
pgrote pgrote is offline
 
Join Date: Feb 2002
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!!
Reply With Quote
  #9  
Old 07-20-2004, 08:56 AM
scotty's Avatar
scotty scotty is offline
 
Join Date: Oct 2001
Location: Mannheim, Germany
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05453 seconds
  • Memory Usage 2,297KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (14)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete