vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do you edit default bbcode? (https://vborg.vbsupport.ru/showthread.php?t=219359)

indie2industry 07-24-2009 02:30 PM

How do you edit default bbcode?
 
How do you edit default bbcode? I forgot how to do this :(

James Birkett 07-24-2009 02:47 PM

If it's quote/code tags - look in the related template.
My forum has some SQL errors so I can't look for the other ones, sorry!

indie2industry 07-24-2009 03:01 PM

it's the [img] bbcode I'm trying to edit.

--------------- Added [DATE]1248497420[/DATE] at [TIME]1248497420[/TIME] ---------------

no one knows??? Woooooooooooooooooooooooooooow :-(

Dismounted 07-25-2009 03:47 AM

Modify the BB code handler for the IMG tag, then you can do whatever the hell you want in processing the tag.

M.C. 02-01-2012 08:40 PM

yes but where I need to go to do it?

kh99 02-02-2012 12:25 PM

I believe you would need to change the function handle_bbcode_img() in includes/class_bbcode.php.

doob 04-13-2012 09:06 AM

kh99, is that the same place you'd go to change the alt text that appears for the default Insert Image button in forum posts, etc? doing a search for insertimage.gif and "Insert Image" doesn't uncover anything in that php document.

kh99 04-13-2012 10:48 AM

That php file is only where bbcodes are processed. Using "search in phrases" I find a phrase with text "Insert Image", so that may be it (although I haven't tried it). Try adding a translation for that phrase.

doob 04-13-2012 05:18 PM

Thanks for that sugg.

FYI. It seems that if you want to override the default behavior you just add a new custom bb code with the same name as a default one. ie to override the IMG tag, just create a new custom tag and name it IMG with whatever properties you want. Fun stuff!

kh99 04-13-2012 06:58 PM

Quote:

Originally Posted by doob (Post 2319804)

FYI. It seems that if you want to override the default behavior you just add a new custom bb code with the same name as a default one. ie to override the IMG tag, just create a new custom tag and name it IMG with whatever properties you want. Fun stuff!

Thanks, I didn't know that. I thought I had tried that and had it tell me that the code already existed.

doob 04-13-2012 07:18 PM

Seems to be working, might be version dependent though? Interstingly it doesn't seem to entirely replace the default IMG behavoir, but puts mods on top of it.

Any idea what code snippit is responsible for the popup url browser generated by the insert link or insert image default buttons? And can that code be inserted in the custom bb code interface or does it have to be coded into the php doc?

I'm still looking into use of the {option} use and syntax so my answer may lie there...

kh99 04-14-2012 03:53 PM

Quote:

Originally Posted by doob (Post 2319842)
Seems to be working, might be version dependent though? Interstingly it doesn't seem to entirely replace the default IMG behavoir, but puts mods on top of it.

I think you're allow one with an option and one without - maybe that's what's going on?


Quote:

Any idea what code snippit is responsible for the popup url browser generated by the insert link or insert image default buttons?
I believe that's a ckeditor custom extension, and so is probably somewhere under the clientscript directory.


Quote:

And can that code be inserted in the custom bb code interface or does it have to be coded into the php doc?
Not sure what you're asking, but it sounds like I wouldn't be sure of the answer either. Maybe someone else will know...

demonlord 09-20-2012 02:21 AM

anyone know how to change "alt" attribute in default img bbcode?

kh99 09-20-2012 10:40 AM

Quote:

Originally Posted by demonlord (Post 2366891)
anyone know how to change "alt" attribute in default img bbcode?

You should look at the code in function handle_bbcode_img(), in file includes/class_bbcode.php. In some cases the contents of the alt attribute comes from the phrases image_larger_version_x_y_z or image_x_y_z, so you may be able to do what you want by translating those phrases. Otherwise you'd probably need to edit the php code in that file.

demo7up 09-23-2012 09:49 PM

I actually just did this in includes/class_bbcode.php look for the following function I added the red part to fit my forums fixed width.

Code:

function handle_bbcode_img_match($link, $fullsize = false)
        {
                $link = $this->strip_smilies(str_replace('\\"', '"', $link));

                // remove double spaces -- fixes issues with wordwrap
                $link = str_replace(array('  ', '"'), '', $link);

                $retval = ($fullsize ? '<div class="size_fullsize">' : '')  . '<img width="920px" src="' .  $link . '" border="0" alt="" />' . ($fullsize ? '</div>' : '');

                ($hook = vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;

                return $retval;
        }



All times are GMT. The time now is 11: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.02446 seconds
  • Memory Usage 1,746KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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