EasyCFM.COM ColdFusion Forums / PHP to CFML / phpBB bbcode string needs to be replaced with HTML

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: phpBB bbcode string needs to be replaced with HTML

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

tjrockjockwv
02-01-2007 @ 12:12 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 49
Joined: May 2006

many of you may be familiar with bbCode used in php based message forums.

The agency I'm working for now was using phpBB as a press release system. My plans is to move that mysql data into SQL Server and into a more user-friendly, functional system.

How would someone go about stripping the bbcode and replacing it with standard bbcode?



Life is like a binary string, you're either on or off.

mquack
02-01-2007 @ 12:15 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

quote:


How would someone go about stripping the bbcode and replacing it with standard bbcode?


1) Do you actually mean replacing it with HTML?
2) Do you want to do this when it's rendered, or have it replaced in the database?


http://www.rachelqueensg.com

tjrockjockwv
02-01-2007 @ 7:17 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 49
Joined: May 2006

yes. . .bbcode to html.



Life is like a binary string, you're either on or off.

mquack
02-01-2007 @ 7:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

regEx

http://www.rachelqueensg.com

tjrockjockwv
02-07-2007 @ 7:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 49
Joined: May 2006

okay. . . let's say for instance I have this string.
(and keep in mind this is shortened quite a bit from what I'll be faced with (entire posts FULL of bbcode)

[i:56a7309fdd]Originally Released:April 14, 2005 [/i:56a7309fdd]


Where as the "56a7309. . ." is the bbcode_uid unique to each post.

The goal is here:
- pull from their mySQL database, covert the bbCode into HTML, then insert into MS-SQL, then pump out a PDF file as it goes along.   All but the bbcode mess is taken care of and completed.

I just can't remember for the life of me the trick here.

Any takers?

Life is like a binary string, you're either on or off.

mquack
02-07-2007 @ 7:52 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

The answer is regEx.  Use regEx to convert it into the format that you want it, and insert it into the new db.

http://www.rachelqueensg.com

tjrockjockwv
02-07-2007 @ 8:26 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 49
Joined: May 2006

yes, I know it can be done thru regEx. . . .but I was looking for a slight, refreshing friendly nudge in the right direction. . . .

sorry to annoy you with a innocent request

Life is like a binary string, you're either on or off.

mquack
02-07-2007 @ 8:34 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

Not sure how much more "slight" or "friendly" I can "nudge".  I pointed you in the right direction.  You've done absolutely nothing other than to ask a very general question, to which you received a very general answer.

Your posts come across as if you're wanting us to magically have the full code/solution to your plight.  We don't.  And, speaking for myself here, I'm not the slightest bit concerned with writing code for you for free.  I'm more than willing to lend a hand in helping you fix the code that you write, but you've shown us absolutely nothing.  Just a general question.

Throw us a bone.

What have you tried?
What worked?
What didn't?
If it didn't work, did it error?
Did it just not provide the desired result?
What result did it provide?



http://www.rachelqueensg.com

mquack
02-07-2007 @ 8:38 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

By the way, I don't use phpBB; never have, never will.  So I have absolutely no earthly idea what the code that you're trying to re-format even looks like.  And I'm certainly not going to go research phpBB to find out.  That's where you come into the picture.  Something like:

"Hey, I have this block in my source database:

[id:33817]My Whatever[/id:33817]

I need to reformat it as:

My Whatever

I've tried this:

<!--- relevant code you've tried --->


But it's not providing the desired result.  Instead I get {insert example result or error message}"



http://www.rachelqueensg.com


Website Designed and Developed by Pablo Varando.