MyBB Community Forums

Full Version: Custom MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I created this custom mycode to basically use it to highlight certain lines of text.

\[div=(.*)\](.*?)\[/div\]

<div style="background-color: $1;">$2</div>


If I use it once in a thread, it works fine.
[Image: 94dca44cf0e2527b1933af0df979205d.png]

I use it like [div=color]text[/div].

The issue I'm having is when I use it multiple times, it either won't show either div box at all, or it will not show the first one and print the second one like [div=color;">.  If it's in a quote tag it will end the quote there as well.
Try to do that again but with excluding semicolon( ; ) meant just enter the hex codes like [div=#333]text[/div]
(2018-01-09, 04:03 AM)Dark-Power-Invader Wrote: [ -> ]Try to do that again but with excluding semicolon( ; ) meant just enter the hex codes like [div=#333]text[/div]

The funny thing is, I'm not using a semicolon.  The code for that screenshot is this:

[div=#d8c3d9]SendSplitMessage(playerid, color, string final)[/div]

If I put it in there twice it adds a semicolon and then tweaks out.

Tried removing the ; from the actual mycode html part, made no difference.

EDIT: Figured it out. Forgot the ? in div =

\[div=(.*?)\](.*?)\[/div\]

Thanks.