PDA

View Full Version : [vB 4.1.4] Easily add PHP/HTML/CODE buttons to showthread Quick Reply


Lynne
27 Jun 2011, 15:32
By default, the showthread Quick Reply editor does not show the PHP/HTML/CODE buttons. If you want those to show up in Quick Reply, then just create a plugin to do so.

Hook Location - editor_toolbar_filter

if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('Code', 'Html', 'Php');

This does NOT add these buttons if you are using the Basic Editor because there are no buttons when you use that editor. Also, this only works for the ckeditor which first came out in vB4.1.4.

Igel1
27 Jun 2011, 23:33
Thank you Lynne,

how can I add BBCode button?

How can i set the new button a line below the first row?

Lynne
28 Jun 2011, 03:10
Thank you Lynne,

how can I add BBCode button?

How can i set the new button a line below the first row?
I don't know as I have not looked into that. This is a Quick Tips forum and I had seen users want to know how to do this and it's very easy. I think for adding other bbcode to the Quick Reply, it may require a bit more than a two line plugin.

kh99
28 Jun 2011, 17:47
how can I add BBCode button?

How can i set the new button a line below the first row?

Do you mean the custom bbcode buttons? Try this, using editor_construct:

if ($this->editor_type == 'qr')
{
$this->config['toolbar'][] = '/';
$this->config['toolbar'][] = array();
$this->addCustomToolbarButtons();
}


Sorry if this is OT.

Igel1
29 Jun 2011, 01:18
Many thanks kh99,

it's done

matthew1111
01 Jul 2011, 00:07
I'm confused on editor_toolbar_filter :P

All I have is:
editor_toolbar_colors, fontname, fontsize, off, on

Any help? Sorry if I'm like completely off.

kh99
01 Jul 2011, 14:53
editor_toolbar_filter is a hook location. You would need to create a new plugin (Plugins and Products > Add New Plugin) and select that as the Hook Location.

Sworm
11 Apr 2012, 14:28
By default, the showthread Quick Reply editor does not show the PHP/HTML/CODE buttons. If you want those to show up in Quick Reply, then just create a plugin to do so.

Hook Location - editor_toolbar_filter

if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('Code', 'Html', 'Php');This does NOT add these buttons if you are using the Basic Editor because there are no buttons when you use that editor. Also, this only works for the ckeditor which first came out in vB4.1.4.

It's working great, but should be good to have the work in quick edit too.

--------------- Added 11 Apr 2012 at 15:41 ---------------

I'm not a coder, i 'm worken on the Lynne and KH99 posts xD , and i have done... i hope.

I have created a new plugin that i called
ADV QR Button
on the hook "editor toolbar filter"
the code is:
if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$toolbar[] = array('Code', 'Html', 'Php');
}And now the buttons are showed in the qr and qe....

Is it a good solution? Or there's something wrong? Actually this solution are working fine in my board.... hoping that it is a correct work....

Thanks

mhmtozek
09 Sep 2014, 13:40
if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('Code', 'Html', 'Php');

This adds the icons to advanced editor, but how can i add them to quick reply editor?

The suggestion of Sworm did not work either. I use vBulletin 4.2.2

thetechgenius
25 Jan 2015, 20:41
It's working great, but should be good to have the work in quick edit too.

--------------- Added 11 Apr 2012 at 15:41 ---------------

I'm not a coder, i 'm worken on the Lynne and KH99 posts xD , and i have done... i hope.

I have created a new plugin that i called
ADV QR Button
on the hook "editor toolbar filter"
the code is:
if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$toolbar[] = array('Code', 'Html', 'Php');
}And now the buttons are showed in the qr and qe....

Is it a good solution? Or there's something wrong? Actually this solution are working fine in my board.... hoping that it is a correct work....

Thanks

Thank you! And thank you Lynne! I now have the Code, HTML, and PHP Buttons in Quick Reply and the Quick Editor.

Raptor
19 Jul 2015, 00:32
superb - very useful, thanks

(works on vb 4.2.3)

Meestor_X
18 Sep 2015, 01:36
This works great! I used it to add my custom BBCode buttons to the qe and qr menu.

Now, how can I add these BBCode buttons ONLY in a certain forum or for certain usergroups?