Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[vB 4.1.4] Easily add PHP/HTML/CODE buttons to showthread Quick Reply
Lynne's Avatar
Lynne
Join Date: Sep 2004
Posts: 41,180

 

California/Idaho
Show Printable Version Email this Page Subscription
Lynne Lynne is offline 06-26-2011, 10:00 PM

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.
Reply With Quote
  #2  
Old 06-27-2011, 09:33 PM
Igel1 Igel1 is offline
 
Join Date: May 2010
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Lynne,

how can I add BBCode button?

How can i set the new button a line below the first row?
Reply With Quote
  #3  
Old 06-28-2011, 01:10 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Igel1 View Post
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.
Reply With Quote
  #4  
Old 06-28-2011, 03:47 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Igel1 View Post
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.
Reply With Quote
  #5  
Old 06-28-2011, 11:18 PM
Igel1 Igel1 is offline
 
Join Date: May 2010
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Many thanks kh99,

it's done
Reply With Quote
  #6  
Old 06-30-2011, 10:07 PM
matthew1111 matthew1111 is offline
 
Join Date: Jun 2011
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 07-01-2011, 12:53 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 04-11-2012, 12:28 PM
Sworm Sworm is offline
 
Join Date: Feb 2008
Posts: 422
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
Благодарность от:
Conehead555
  #9  
Old 09-09-2014, 11:40 AM
mhmtozek mhmtozek is offline
 
Join Date: Mar 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 01-25-2015, 06:41 PM
thetechgenius's Avatar
thetechgenius thetechgenius is offline
 
Join Date: Jun 2014
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sworm View Post
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.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 08:46 AM.


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.07592 seconds
  • Memory Usage 2,303KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete