Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Remove Buttons from Editor with Plugin
RLShare
Join Date: Jun 2008
Posts: 499

by RLShare RLShare is offline 01 Dec 2008

I recently ran into a problem with a style I was creating where the editor in the userCP was just too wide for the style because of the userCP sidebar. I tried editing the CSS for the editor but there is a point where the editor will not get any smaller because of the buttons, and that was still too wide for the style I was working with. After a little searching through code I figured out how to remove some of the buttons to allow the editor to be smaller, its pretty simple.

First off, this will be done in a plug-in and the hook location will be 'editor_toolbar_start'. From this hook location you have access to a variable $forumid, if your making a post in a forum this variable will hold the forum ID, but if your using another section of the site such as creating a PM or editing your signature this variable will hold the values telling you that as well.

Possible values for $forumid:
'privatemessage'
'usernote'
'calendar'
'announcement'
'signature'
'visitormessage'
'groupmessage'
'picturecomment'
'nonforum'
Or it will be the forumID of the forum in which a post is being edited/created



Just like most areas of VB there is an array named 'show' that holds a list of true/false values of which things need to be shown. Such as which buttons to show in the editor.

Possible $show items:
$show['img_bbcode'] = image embed button
$show['font_bbcode'] = fonts drop down
$show['size_bbcode'] = font sizes drop down
$show['color_bbcode'] = font color drop down
$show['align_bbcode'] = align buttons
$show['list_bbcode'] =list buttons
$show['code_bbcode']= code button
$show['html_bbcode'] = html button
$show['php_bbcode'] = php button
$show['basic_bbcode'] = Bold/Italic/Underline all in one
$show['url_bbcode'] = embed link button
$show['quote_bbcode'] = quote button
$show['smiliebox'] = show the smilie box


Setting any of those values to false in a plugin with the hook location of 'editor_toolbar_start' will tell VB not to show the items in the editors toolbar.

Here is the plug-in I created to remove buttons on the PM/Edit Signature pages of my style to give you an example of how its done...


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


And thats pretty much it, its really simple.
Attached Images
File Type: bmp sample.bmp (1,018.9 KB, 114 views)

Last edited by RLShare; 01 Dec 2008 at 01:02..
Views: 3197
Reply With Quote
Comments
  #2  
Old 23 Jun 2009, 10:48
MarioN70 MarioN70 is offline
 
Join Date: Jun 2009
Buttons

Thanks helped me a lot, if I want to hide a button in all editors that I have just put:

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

Reply With Quote
  #3  
Old 18 Oct 2009, 14:46
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Originally Posted by MarioN70 View Post
Thanks helped me a lot, if I want to hide a button in all editors that I have just put:

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

I wouldn't recommend putting spaces in between


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

Reply With Quote
Reply

Similar Article
Article Author Type Replies Last Post
New Posting Features PNG Editor Buttons Wayne Luke vBulletin 3.7 Template Modifications 173 31 Mar 2013 19:21
New Editor Buttons vmacedonia Miscellaneous Images 64 19 Dec 2010 17:51
New Posting Features dark_vb_v2 Editor Buttons! bitdefuser Miscellaneous Images 18 05 Oct 2010 04:01



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 10:40.

Layout Options | Width: Wide Color: