PDA

View Full Version : [HR] bbcode, is this OK?


Mutt
03-31-2009, 03:54 PM
I like having a horizontal rule BBCode but I'm not quite sure how to handle it. you can't use the regular custom BBCode admin becasue the tags need an end tag and can't be empty. the thought of using something like [hr]- just to force it to work annoys me. I tried using the replacements but it gets messed up on edit.

what I would up with was a plugin at bbcode_parse_complete with this code

$text = str_replace("[hr]", "<hr>", $text);

it appears to work 100%. I'm going to see what I can do to control who can use it. I assume i can limit it somehow.

my question is, is there a problem with handling a custom BBCode like this? Is there a more efficient way? I saw a great explanation on how to parse custom BBCodes here (https://vborg.vbsupport.ru/showpost.php?p=1712936&postcount=10) but it's for tags w/ a beginning and ending tag.

thanks in advance.

TigerC10
03-31-2009, 04:23 PM
There's nothing wrong with doing it that way, the only issue you have is that it won't be added to the bbcode help page (https://vborg.vbsupport.ru/misc.php?do=bbcode) listing.

As far as limiting who can use it, I don't think that there's any reason to limit that bbcode. The way you would limit it is at the beginning like bbcode_parse_start, you would match/replace with a blank.

Mutt
04-04-2009, 08:27 PM
thanks