MyBB Community Forums

Full Version: [MyCode] Horizontal color
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Normally people use
[hr]
in mybb to make horizontal line for example like this line:

That's black color right? So why we not try to color that line?
Here is the simple mycode to let u color it that Horizontal.

Title: Horizontal color
Short Description: color horizontal line
Regular Expression:
\[hrc\](.*?)\[/hrc\]

Replacement :
<hr style="height: 1px; color: $1; background-color: $1" />

Enabled?: Yes

To use or test it, use this code :
[hrc]color here[/hrc]
for example
[hrc]blue[/hrc]
with result
[Image: 84583619.jpg]
nice Wink
Here is my modified Code.
Regular Expression:
\[hrc=(.*?)\](.*?)\[/hrc\]


Replacement:
<hr style="width: $1; height: 2px; color: $2; background-color: $2; float:left;" />
You can change the position of the line.


Enabled?: Yes

Use this Code:
[hrc=100px]#229017[/hrc]
Give the lenght in "px".

Result:
[attachment=25081]

I hope I've forgotten anything.Wink
^ fine @MrBrechreiz Smile
What about:
Regular Expression:
[hr=([a-z\-]+|#?[0-9a-fA-F]{6})\]

Replacement:
<hr style="color:$1;background-color:$1;" />

Example:
[hr=red]
[hr=#ff0000]

Or this for the second one:
Regular Expression:
[hr=([a-z\-]+|#?[0-9a-fA-F]{6}),([0-9]+)\]

Replacement:
<hr style="color:$1;background-color:$1;margin-left:0;width:$2px;height:2px;" />

Example:
[hr=red,100]
[hr=#ff0000,99999]
DonĀ“t work....Parse error Huh