vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=97295

Adding New Buttons to the Editor Toolbar
by akanevsky
01 Oct 2005 17:01

Start by opening the editor_toolbar_on template.
That is the only template you need to edit, since in vBulletin this same template corresponds to both the standard editor and the wysiwig.

Find:
$vBeditTemplate[extrabuttons]

Before that row is where you should add buttons. However, you can add them anywhere you want if you know what you are doing.

Now about the buttons themselves:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Standard vBulletin Button Separator, does not do anything except separating buttons.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

BBCODE - this part is what defines the bbcode to be insterted. Whatever you put instead of "BBCODE" goes into the square tag brackets.
YOURBUTTONIMAGE and YOURALTPHRASE are respectively the image and the descriptive phrase for that image.
You can also change the width of the image, but everything else should not be touched - esspecially the DIV ID (except the BBCODE part).

So far so good. But this does not allow a user to define a parameter for the bbcode tag.
To fix, open vbulletin_textedit.js located in clientscript folder, and find:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And below add:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Where BBCODE, of course, is the same bbcode you added earlier. Must be capitalized.

Done!

If anyone wants to add some information on how to make the buttons perform your own functions, do it.

Kirk Y 01 Oct 2005 18:29

Excellent! I'll definately be using this! Will this affect the Quick Reply box or would something different need to be edited?

ProperMethodz 04 Oct 2005 04:57

yay! I did this before and didn't know what the hell I was doing! I added a glow button.

Actually... If I remember correctly there is an area in the ADMINCP that allows you to do this automatically.

Regardless, this is sick because it now shows me the code effected.

Thanks!

o0Hubba0o 23 Oct 2005 03:34

Quote:

Originally Posted by ProperMethodz
yay! I did this before and didn't know what the hell I was doing! I added a glow button.

When you add bbcode through the bbcode manager the last option is:
Quote:

Button Image (Optional) If you would like this bbcode to appear as a clickable button on the message editor toolbar, enter the URL of an image 21 x 20 pixels in size that will act as the button to insert this bbcode.
But like you said it's nice to where this is affected.

deathemperor 23 Oct 2005 10:28

I thought when creating a new bbcode vbulletin let us insert a new button in the toolbar already ?

akanevsky 23 Oct 2005 11:47

Yes, it does.

But:
- You cannot use it for pre-existing bbcodes, such as thread and post
- You cannot use it for CUSTOM hardcoded bbcodes, such as ones found in my [HIDE] hack.

Omranic 11 Nov 2005 12:13

ok thats very nice
but how can I make my bbcode converted or displayed right in both standard & wysiwig editors ?
& is the bbcode manager in admincp can replace the js file editing ?

sory but i didn't understand the role of this file editing & i'm new to the tool box 3.5

akanevsky 11 Nov 2005 12:20

The role of file editing: It tells the script that the tag has an OPTION, which makes it pop up the input box.
When you do the template edit, it works for both standard and wysiwyg editors.

Omranic 11 Nov 2005 13:15

i do my best & try to make mmy own buttons & teel you the results ( am sure i'll need help :) )

BoYagoob 21 Nov 2005 11:25

Great!
Thanks a lot :)

simsimt 21 Dec 2005 09:29

1 Attachment(s)
I've added a custom BB code at my board which justifies text equally to margin. I did that through the Admin CP's BB Code Manager. I put a one line code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then designed a 21 x 20 button image for it.

Everything goes alright & the text was showing justified correctly without any problems. But, when I switch to the advanced mode (WYSIWYG) & selecting some text to justify it, it only show between the [justify][justify/] tags! (though they then justified correctly in the post).

My question is: how can I make that BB code takes effect "visually" as a "WYSIWYG"?

Also, how can I place the button image in other place in the editor interface? By default, it's added to the right (See the attached image).

I have to say that I asked these questions at vBulletin.com & I were told they simply can't be done! I got a little disappointed for I thought these were simple things to customize in vBulletin.

cclaerhout 21 Dec 2005 23:00

A big thank for this nice tutorial :) Very usefull

DRJ 26 Feb 2006 21:48

I cannot seem to get this right. Maybe someone can see what I am doing wrong.

editor_toolbar_on

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

vbulletin_textedit.js


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It is a code for VBA formatting, and I just need the button to wrap the text in [VBA][/VBA]. But with these changes there is nothing on the toolbar.

Any ideas?

Thanks for you assistance.

Jake

Kungfu 06 Oct 2006 00:29

Nice tut, got me on the right track. Im making a custom function for a button. So just a side not if you want to make a function do a return false; at the end, this way it wont add the bbcode.

case 'Function':
{
put your code here and what not then
like you want to create a popup window or whatever you want to do here.
return false;
}

ericgtr 06 Oct 2006 20:21

Yet another useful tutorial, thanks PV. :)


All times are GMT. The time now is 02:36.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.