vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: bb code parsing. - View Topic
Topic Rating: *****
Printable View
I Anoop I
Junior Member
**

[Avatar]
No Thanks.

Posts: 47
Status: Offline
Gender: Male
Location: New York
Joined:  
Reputation: 0%  


pmwwwmsnaim
bb code parsing. (24th Feb 08 at 10:53pm UTC)
i want to use BB code on my shoutbox, how would i parse it with PHP?

Image
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: bb code parsing. (24th Feb 08 at 10:54pm UTC)
Code your own parser using RegExp.

Make it take the inputted string, and change the UBBC items to HTML items! {Smile}
Jason
Moderator
*****

[Avatar]
www.random-image.net

Posts: 223
Status: Offline
Gender: Male
Location: University of Waterloo, Canada
Age: 35
Joined:  

Additional Groups:
Spell Checker
**


Reputation: 22%  


pmwww
Re: bb code parsing. (24th Feb 08 at 10:55pm UTC)
 
i want to use BB code on my shoutbox, how would i parse it with PHP?


Regular Expressions is the best method I know, and it works quite well on my shoutbox. Peter (former PBsupport mod) claims there is a more 1337 method, but he never got back to me on what that was {Tongue Out}

How much do you know about regular expressions?

Image Randomizers - official vForums partner
Image
^ Live stats {Grin} ^
I Anoop I
Junior Member
**

[Avatar]
No Thanks.

Posts: 47
Status: Offline
Gender: Male
Location: New York
Joined:  
Reputation: 0%  


pmwwwmsnaim
Re: bb code parsing. (24th Feb 08 at 10:56pm UTC)
That's not a bad idea!

Would that be easier than preg_replace?

Image
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: bb code parsing. (24th Feb 08 at 11:10pm UTC)
 
That's not a bad idea!

Would that be easier than preg_replace?


preg_replace() is Regular Expressions. {Wink}

rroll.to— Shorten a link, rickroll your friends.
I Anoop I
Junior Member
**

[Avatar]
No Thanks.

Posts: 47
Status: Offline
Gender: Male
Location: New York
Joined:  
Reputation: 0%  


pmwwwmsnaim
Re: bb code parsing. (25th Feb 08 at 12:16am UTC)
oopsie, thanks.

Image
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: bb code parsing. (26th Feb 08 at 12:19am UTC)
 
 
i want to use BB code on my shoutbox, how would i parse it with PHP?


Regular Expressions is the best method I know, and it works quite well on my shoutbox. Peter (former PBsupport mod) claims there is a more 1337 method, but he never got back to me on what that was {Tongue Out}

How much do you know about regular expressions?


Well I know one alternative method is to split the string into sections and walk through each section rebuilding the formatted text as you go. That's how I wrote both the table parser and the quote parser here. But that still uses some regular expressions and I don't see how it'd make parsing simplier tags such as bold or italic any better.

Image
Paddy
Full Member
***
Insane Clown

[Avatar]

Posts: 288
Status: Offline
Gender: Male
Location: Buffalo, New York
Age: 34
Joined:  
Reputation: 7%  


pmwwwtwitterskypeaimgtalk
Re: bb code parsing. (26th Feb 08 at 2:11am UTC)
There are ones premade you can use.

http://www.corz.org has a nice one. ^_^

~Artemis
 Printable View

All times are GMT+0 :: The current time is 8:10am
Page generated in 0.879 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums