Results 1 to 2 of 2

Thread: Bbcode Help

  1. #1

    Thread Starter
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Bbcode Help

    okay i have sum BBCODE most works fine...
    PHP Code:
    $replace = array ('/(\[[Bb]\])(.+)(\[\/[Bb]\])/',
    '/(\[url=)(.+)(\])(.+)(\[\/url\])/',
    '/(\[[CODE]\])(.+)(\[\/[CODE]\])/',
    '/(\[FONT=)(.+)(\])(.+)(\[\/FONT\])/',
    '/(\[[Uu]\])(.+)(\[\/[Uu]\])/',
    '/(\[[marquee]\])(.+)(\[\/[marquee]\])/'
    ); 
    PHP Code:
    $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>',
    ); 
    For some reason, anythin with more then 1 letter dont work... with the exeption of the ones with (=) in it. plz help....
    Last edited by PlaGuE; Sep 11th, 2005 at 10:31 AM.
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Bbcode Help

    have u tried,
    PHP Code:
     $replace = array ('/(\[[Bb]\])(.*?)(\[\/[Bb]\])/',
    '/(\[url=)(.*?)(\])(.*?)(\[\/url\])/',
    '/(\[[CODE]\])(.*?)(\[\/[CODE]\])/',
    '/(\[FONT=)(.*?)(\])(.*?)(\[\/FONT\])/',
    '/(\[[Uu]\])(.*?)(\[\/[Uu]\])/',
    '/(\[[marquee]\])(.*?)(\[\/[marquee]\])/'
    ); 
    Im not 100% sure if that will fix your problem but it works for me.

    The pattern syntax is here if you didnt know:
    http://uk2.php.net/manual/en/referen...ern.syntax.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width