MyBB Community Forums
[MyCode] Horizontal color - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: [MyCode] Horizontal color (/thread-70322.html)



[MyCode] Horizontal color - afzulnizam - 2010-05-25

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]


RE: [MyCode] Horizontal color - FBI - 2010-05-25

nice Wink


RE: [MyCode] Horizontal color - MrBrechreiz - 2011-12-20

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:
   

I hope I've forgotten anything.Wink


RE: [MyCode] Horizontal color - ranjani - 2011-12-20

^ fine @MrBrechreiz Smile


RE: [MyCode] Horizontal color - Omar G. - 2011-12-20

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]



RE: [MyCode] Horizontal color - MrBrechreiz - 2011-12-21

DonĀ“t work....Parse error Huh