vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [HR] bbcode, is this OK? (https://vborg.vbsupport.ru/showthread.php?t=209969)

Mutt 03-31-2009 02:54 PM

[HR] bbcode, is this OK?
 
I like having a horizontal rule [hr] 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]-[/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

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 but it's for tags w/ a beginning and ending tag.

thanks in advance.

TigerC10 03-31-2009 03: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 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 07:27 PM

thanks


All times are GMT. The time now is 01:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01409 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete