Jump to content


Photo

Require help with BBCode Code boxes


  • Please log in to reply
2 replies to this topic

#1 Jayenkai

Jayenkai
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 September 2006 - 10:47 AM

Note : I tried to search, but you try searching for "BBCode Code"..  It really doesn't work!! ;)

I pretty much managed to get the rest of my BBCode working, but when a user posts some code into a code box, the BBCode messes up the code box.
I managed, via the preg_match('{code}',),  split, etc, routine to deal with all the code boxes last, and remove <br>'s and things like that, but what I can't figure out, is how to NOT deal with the code boxes, when doing everything else.

If anyone has a quicky illustration as to how to start with $txt, split out the code, deal with the Not code area, then shove it all back together, in the right order*, then I'd love the help.  

Thanks..

* I had to specify that, since when I tried one method, it ended up dumping all the code boxes at the bottom of the posts!


#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 16 September 2006 - 11:43 AM

Note : I tried to search, but you try searching for "BBCode Code"..  It really doesn't work!! ;)

I pretty much managed to get the rest of my BBCode working, but when a user posts some code into a code box, the BBCode messes up the code box.
I managed, via the preg_match('

',),  split, etc, routine to deal with all the code boxes last, and remove <br>'s and things like that, but what I can't figure out, is how to NOT deal with the code boxes, when doing everything else.

If anyone has a quicky illustration as to how to start with $txt, split out the code, deal with the Not code area, then shove it all back together, in the right order*, then I'd love the help.  

Thanks..

* I had to specify that, since when I tried one method, it ended up dumping all the code boxes at the bottom of the posts!


If this is your code, I am sure it doesn't work!

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.

#3 Jayenkai

Jayenkai
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 September 2006 - 11:49 AM

oopsy, messed up sticking an actual {code}  in my post!  Aw well..  I'll edit it in a jiffy.

Thanks for your comment, it helped immensly.
I'll go and do that, now.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users