Jump to content
xisto Community

MXBrandon

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Is there a way make nested codes work? For example, using the code provided above, if someone types in this: [colorx=red]red text[colorx=blue]blue text[/colorx]back to red[/colorx] We "want" this result: <font color="red">red text<font color="blue">blue text</font>back to red</font> However, this is the result that the code produces: <font color="red">red text[colorx=blue]blue text</font>back to red[/colorx] (note: I used 'colorx' instead of 'color' so the forum would not parse the code) For the record, different nested codes work, such as italics within bold, but like codes dont work, such as a bold inside of a bold, quote inside of a quote, color inside of a color, etc. Notice from cmatcmextra: Please use CODE tags when writing codes. Doing this also prevents the forums from parsing bbcoding.
  2. Thanks for the great tutorial, this has helped me a ton! One thing I would recommend adding however is the i modifier. This will make the bbcode case insensitive. For example: Bold and Bold will both be changed instead of just the first one. To do this, add an "i" after the last slash in each line of the regex statement. Example: $regexes = array( "/\[b\]([\D\S]+?)\[\/b\]/i" "/\[i\]([\D\S]+?)\[\/i\]/i" "/\[u\]([\D\S]+?)\[\/u\]/i" "/\+)\]([\D\S]+?)\[\/url\]/i" "/\[img\]([\D\S]+?)\[\/img\]/i" );
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.