Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, Adding New Buttons to the Editor Toolbar in vBulletin; <div> Adding New Buttons to the Editor Toolbar Start by opening the editor_toolbar_on template. That is the only template you ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3359


Reply
LinkBack Thread Tools Display Modes
Adding New Buttons to the Editor Toolbar
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
10-09-2008, 06:53 PM
 
<div> 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:

<div style="margin: 5px 10px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:
PHP Code:
     <td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="20" alt="" /></td>
Standard vBulletin Button Separator, does not do anything except separating buttons.

<div style="margin: 5px 10px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:
PHP 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> [img]file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot-8.jpg[/img][img]file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot-9.jpg[/img][img]file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot-10.jpg[/img]
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:

<div style="margin: 5px 10px;"> <div class="smallfont" style="margin-bottom: 2px;">Code:
PHP Code:
     case 'PHP':
{
    
this.apply_format('removeformat');
}
And below add:

<div style="margin: 5px 10px;"> Code:
PHP Code:
     case 'BBCODE':
{
    
useoption = true;
}
Where BBCODE, of course, is the same bbcode you added earlier. Must be capitalized.

Done!
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, Adding New Buttons to the Editor Toolbar in vBulletin; <div> Adding New Buttons to the Editor Toolbar Start by opening the editor_toolbar_on template. That is the only template you ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3359


Bookmarks

Tags
adding, buttons, editor, toolbar


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RapidShare Search Engine Toolbar 1.0 Developer Software and Programs 3 13-05-2009 09:44 AM
Adding Editor to your Mods Developer Articles 0 28-12-2008 04:27 PM
Editor Buttons newliner Developer Mods for 3.6.x 0 20-10-2008 08:01 PM
Indexes (Indicies) Live Toolbar Developer Mods for 3.7.x 0 24-09-2008 03:56 AM
Full Quickreply Toolbar ( without install any plugin ) Developer Mods for 3.7.x 0 12-09-2008 05:04 AM