vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   [vB 4.1.4] Easily add PHP/HTML/CODE buttons to showthread Quick Reply (https://vborg.vbsupport.ru/showthread.php?t=265865)

Lynne 06-26-2011 10:00 PM

[vB 4.1.4] Easily add PHP/HTML/CODE buttons to showthread Quick Reply
 
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

PHP Code:

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 06-27-2011 09:33 PM

Thank you Lynne,

how can I add BBCode button?

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

Lynne 06-28-2011 01:10 AM

Quote:

Originally Posted by Igel1 (Post 2213732)
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 06-28-2011 03:47 PM

Quote:

Originally Posted by Igel1 (Post 2213732)
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:

Code:

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


Sorry if this is OT.

Igel1 06-28-2011 11:18 PM

Many thanks kh99,

it's done

matthew1111 06-30-2011 10:07 PM

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 07-01-2011 12:53 PM

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 04-11-2012 12:28 PM

Quote:

Originally Posted by Lynne (Post 2213527)
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

PHP Code:

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:
Code:

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-09-2014 11:40 AM

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 01-25-2015 06:41 PM

Quote:

Originally Posted by Sworm (Post 2319017)
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:
Code:

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.


All times are GMT. The time now is 02:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01188 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete