UBB.Dev
Posted By: drkknght adding a new ubb code option - 02/28/2005 9:04 PM
how easy would it be to add a new UBB code option?

more than bold, more than italics... i'd love to create an option for "stand out text."

meaning, text that simply looks different than other text -- something that could be used for article headers, or important info that you want hilighted.

preferably, the characteristics of this text type could be controlled via the CSS stylesheet code. then, wherever the [standout][/standout] indicators appear could feature text that was a different font size or different text color, or whatever.
Posted By: Anno Re: adding a new ubb code option - 02/28/2005 9:34 PM
This should give you an idea

https://www.ubbdev.com/forum/showflat.php/Number/124699
Posted By: drkknght Re: adding a new ubb code option - 03/22/2005 5:37 AM
bah... i'm just not smart enough

i keep tinkering, but i can't figure out how to get it to work -- and even then, i can't figure out how to set it up to be css compliant
Posted By: Astaran Re: adding a new ubb code option - 03/22/2005 7:23 PM
Try something like this in the do_markup() function, located in ubbt.inc.php

$Body =preg_replace("/\[yourtag\]/i","<span class="yourclass">",$Body);
$Body =preg_replace("/\[\/yourtag\]/i","</span>",$Body);

and in undo_markup():


$Body = preg_replace("/<span class="yourclass">/","[yourtag]",$Body);
$Body = str_replace("</span>","[/yourtag]",$Body);

Replace "yourtag" with the keyword, you want to use.
Replace "yourclass" with the css classname, you want to use.
Posted By: drkknght Re: adding a new ubb code option - 03/25/2005 9:54 PM
ahh, that did the trick!!

perfect!

thanks!
© UBB.Developers