Parsing bbcode

Discussion forum for MOD Writers regarding MOD Development.
Locked
keiths
Registered User
Posts: 95
Joined: Sun Apr 07, 2002 5:01 pm

Parsing bbcode

Post by keiths »

I am writing a page outside of phpbb but it uses all of the functions of phpbb. I want to be able to use all of the bbcode functions. I am doing the following:

generate_text_for_storage($r['comment'], $uid, $bitfield, $options, true, true, true);
$pagetext = generate_text_for_display($r['comment'], $uid, $bitfield, $options);

This will give me access to bold, italic, etc. bbcode however the quote bbcode doesn't work. Does quote need to be done a different way?

Thanks
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Parsing bbcode

Post by A_Jelly_Doughnut »

That probably means the bitfield is incorrect. Try an echo ($bitfield); in between teh function calls and see what that give you.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
keiths
Registered User
Posts: 95
Joined: Sun Apr 07, 2002 5:01 pm

Re: Parsing bbcode

Post by keiths »

I'll check it out. I'm not sure how the bitfield works. What should it be?

bitfield is set to nothing in between the function calls.

Also I declare

$uid = $bitfield = $options = '';

Above the function calls.
keiths
Registered User
Posts: 95
Joined: Sun Apr 07, 2002 5:01 pm

Re: Parsing bbcode

Post by keiths »

Anyone?
KFCSpike
Registered User
Posts: 26
Joined: Wed May 18, 2005 11:27 am

Re: Parsing bbcode

Post by KFCSpike »

I could be wrong (usually am), but I think you need to include some CSS into your page as well for the quote bbcode to show properly.

Sorry I can't be more specific - was trying this a while back so speaking from memory.
keiths
Registered User
Posts: 95
Joined: Sun Apr 07, 2002 5:01 pm

Re: Parsing bbcode

Post by keiths »

Now that you mention it, when i just use [quote][/quote] it displayed weird. I will check and see if I need any additional bbcode for it.

However when I type [quote="keiths"] it just displays the text.
KFCSpike
Registered User
Posts: 26
Joined: Wed May 18, 2005 11:27 am

Re: Parsing bbcode

Post by KFCSpike »

Looking again at my old code, I think you need some CSS from \styles\prosilver\theme\content.css
Look for

Code: Select all

/* BB Code styles
in there.

(if you use other styles, you would need to check what one your User is using)
Locked

Return to “[3.0.x] MOD Writers Discussion”