vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Editing BBCode for CP compliance (https://vborg.vbsupport.ru/showthread.php?t=263782)

cmmguy 05-17-2011 02:30 PM

Editing BBCode for CP compliance
 
I have added several BBCODES that will resize an image, play media or display other things such as youtubes, etc...

Additionaly I have users that use the settings in the Control Panel that disable pictures because they are at work or customer sites and dont want them displayed on customer/employer computers. They have asked if there was a way to make all the custom bbcodes comply with the control panel settings.

What is the best approach for "fixing" this shortcoming. I guess this might also be a good request to change VB to have a check box in the ADD BBCODE to force compliance.

Can this be coded in the REPLACEMENT code section of the bbcode or would I have to go deeper?

Thanks for your help. If there is already a solution, please point me towards it. A previous search yielded nothing.

BirdOPrey5 05-20-2011 07:43 PM

This can't be done in the Replacement for the BB Code. Nothing can be in the replacement other than HTML code. PHP or conditionals just don't work.

I actually have a system like this on my forum. I have an "article" bb code that embeds an article into an IFRAME and displays it in a post. I have a custom profile field where users can disable the iframe if they choose.

My "solution" was a plugin on postbit_display_complete. It does a string replace (or preg_replace) on the "Replacement" text of the BB Code...

The variable is $post['message']
This holds the HTML of the post. So remember you're not searching for "[B]" but "<b>."

It is an annoying and convoluted way of doing things but it works.

Also besides postbit you also have to scan for the "preview" and the "review" bits as well since the post might be rendered on those pages too.


All times are GMT. The time now is 03:53 PM.

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.01119 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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