The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Adding New Buttons to the Editor Toolbar
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: Code:
<td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="20" alt="" /></td> Code:
<td><div class="imagebutton" id="{$editorid}_cmd_wrap0_BBCODE"><img src="$stylevar[imgdir_editor]/YOURBUTTONIMAGE" width="21" height="20" alt="$vbphrase[YOURALTPHRASE]" /></div></td> 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: Code:
case 'PHP': { this.apply_format('removeformat'); } Code:
case 'BBCODE': { useoption = true; } Done! If anyone wants to add some information on how to make the buttons perform your own functions, do it. |
#12
|
|||
|
|||
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:
HTML Code:
<div align=justify>{param}</div> 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. |
#13
|
||||
|
||||
A big thank for this nice tutorial Very usefull
|
#14
|
|||
|
|||
I cannot seem to get this right. Maybe someone can see what I am doing wrong.
editor_toolbar_on HTML Code:
<if condition="$show['php_bbcode']"> <td><div class="imagebutton" id="{$editorid}_cmd_wrap0_php"><img src="$stylevar[imgdir_editor]/php.gif" width="21" height="20" alt="$vbphrase[wrap_php_tags]" /></div></td> </if> <td><div class="imagebutton" id="{$editorid}_cmd_wrap0_VBA"><img src="$stylevar[imgdir_editor]/vba.gif" width="21" height="20" alt="Wrap [VBA] tags" /></div></td> $vBeditTemplate[extrabuttons] </tr> </table> PHP Code:
Any ideas? Thanks for you assistance. Jake |
#15
|
|||
|
|||
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; } |
#16
|
||||
|
||||
Yet another useful tutorial, thanks PV.
|
#17
|
|||
|
|||
Anyone know how to make a button when you can press it and it will check to see for a change. I need to be able to do this so say your typing and i want to check for a change, or i want to see when someone is typing. Would it be possible to check what they are typing. I want to be able to do this so i can check for certain things that people type and then have my function change something about it.
Kind of like if someone were to type then right when i hit space or what not it would change the to something else. I basically just need to know how to check on change as i know how to get the text from the text box. Another thing how do you move the cursor to the last position. Thats another thing i cant seem to figure out. Thanks. |
#18
|
||||
|
||||
How would you go on to make a dropdown, like the smileybox? Would like one of those for ALL my custom BB-codes, as they just takes up space :P
|
#19
|
|||
|
|||
how do we add Hiden and Center button to Editor tool bar??
can some1 gimme a code please thx u |
#20
|
|||
|
|||
hi
i want to add new editor button to insert flash (.swf file) when make new thread ie: button when press it, popup window come with box to put url in it and ask me for hight and width and finally run this code [flash=url] WIDTH=450 HEIGHT=250[/flash] i make your method but the code run like that "url" instead of [flash=url] WIDTH=450 HEIGHT=250[/flash] how to get that please??? thanks |
#21
|
|||
|
|||
Quote:
anyone please can help us. and a button for put the flash too tnhks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|