Jump to content


BBCODE help...


3 replies to this topic

#1 Jynxis

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Location:The Shadows

Posted 10 September 2005 - 10:02 PM

okay i have sum BBCODE most works fine...
$replace = array ('/(\[[Bb]\])(.+)(\[\/[Bb]\])/',
'/(\[url=)(.+)(\])(.+)(\[\/url\])/',
'/(\[[CODE]\])(.+)(\[\/[CODE]\])/',
'/(\[FONT=)(.+)(\])(.+)(\[\/FONT\])/',
'/(\[[Uu]\])(.+)(\[\/[Uu]\])/',
'/(\[[marquee]\])(.+)(\[\/[marquee]\])/'
);

$replacements = array ('<b>\\2</b>',
'<a href="\\2" target="_blank">\\4</a>', 
'<table width=80% class="CDCode">
  <tr>
    <td.><div align=left class=style1>Code:</div></td>
  </tr>
  <tr>
    <td><font color=orange>\\2</font></td>
  </tr>
</table>', 
'<font color="\\2">\\4</font>',
'<U>\\2</U>',
'<marquee>\\2</marquee>',
);

the problems lye with CODE and MARQUEE... there not working... plz help.... They work as ONE letter but i dont want one letterers.

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 11 September 2005 - 11:15 AM

That has to be the worst BBcode regex i've seen. First off, try looking at this http://www.pixel2life.com/forums/index.php...indpost&p=79888
And then show me an example of what you mean by "ONE letter." Due to how poorly done that regex is, i'll assume you mean [C]blah[/C] will work for code. If that's the case, then code and marquee aren't the only ones that will do that.

#3 Jynxis

    Young Padawan

  • Members
  • Pip
  • 132 posts
  • Location:The Shadows

Posted 11 September 2005 - 11:17 AM

your wrong
...

there the ONLY ones there... taht DONT work.

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 11 September 2005 - 11:31 AM

they're the only ones there that don't work eh? Well then change them to this...
'/(\[CODE\])(.+)(\[\/CODE\])/',
...
'/(\[marquee\])(.+)(\[\/marquee\])/'
And it's still the worst regex i've seen, and i would recommend looking over that link i gave. But this is personal opinion, you don't have to.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users