Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2011, 12:11 PM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Add custom bbcodes to quick reply

A while back I had some code in my showthread_quickreply that added in the custom buttons that appear in the advanced editor. It has stopped working in a recent version. I'm on 4.1.5

Anyone know how I can get this working again?
Here's the code I used to use.

Code:
<!-- Add custom BBCodes to quickreply box -->
<vb:if condition="$extrabuttons">
						<li>
							<vb:each from="extrabuttons" value="button">
								<img src="{vb:raw button.buttonimage}" class="imagebutton" id="{vb:raw editorid}_cmd_wrap{vb:raw button.twoparams}_{vb:raw button.bbcodetag}" width="21" height="20" alt="{vb:rawphrase wrap_x_tags, {vb:raw button.tag}}" />
							</vb:each>
						</li>
					</vb:if>
<!-- End Add custom BBCodes to quickreply box -->
Reply With Quote
  #2  
Old 09-20-2011, 05:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hook location - editor_toolbar_filter
PHP Code:
// for editor_toolbar_filter
if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('BBCode1','BBCode2'); 
Reply With Quote
  #3  
Old 09-21-2011, 10:15 AM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne
Where your code says [BBCode1] am I meant to replace that with the "BB Code Tag Name"?
If so, then I have tried your suggestion, but nothing appears in the quick reply box. I'm on 4.1.5
Reply With Quote
  #4  
Old 09-21-2011, 05:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You replace it with the BBCode Title.
Reply With Quote
Благодарность от:
charlesr
  #5  
Old 09-21-2011, 08:35 PM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Smart. That worked. A bit counter-intuitive, but all good thanks!
Reply With Quote
  #6  
Old 10-28-2011, 12:24 PM
khalid khalid is offline
 
Join Date: Nov 2001
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
hook location - editor_toolbar_filter
PHP Code:
// for editor_toolbar_filter
if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('BBCode1','BBCode2'); 
Thanks for this piece of code. It helped to insert text alignment in the quickreply.
Reply With Quote
  #7  
Old 02-11-2012, 08:55 PM
Emeralda's Avatar
Emeralda Emeralda is offline
 
Join Date: Oct 2011
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for posting in an old thread, but it seems it has the solution I'm looking for but I totally don't understand it. This allows adding custom bbcodes to the quick reply editor, right? Like Youtube, Spoiler, etc? Which of those codes should I add where?
Reply With Quote
  #8  
Old 02-13-2012, 04:55 PM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Plugins / Add new plugin
Add Lynne's code and use hook location: editor_toolbar_filter
Where her code says BBCode1 instead use the BBCode title you assigned when making the BBCode.
Reply With Quote
Благодарность от:
Emeralda
  #9  
Old 02-13-2012, 05:31 PM
Emeralda's Avatar
Emeralda Emeralda is offline
 
Join Date: Oct 2011
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Rawr, worked great. I was using a solution posted here: https://vborg.vbsupport.ru/showthread.php?t=278422 but this one seperates the buttons and let me chose which bbcodes I want.

Now a question: http://prntscr.com/63wet <- would it be possible to make it so Strike-thru would be next to BIU buttons?
And how to do this for when you press edit button? http://prntscr.com/63whr
Reply With Quote
  #10  
Old 02-14-2012, 07:30 AM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure of the details, but to move the strikethru I'm guessing you'd have to do something similar with "cke_toolgroup" as the hook (install Firebug in Firefox to see what different vbulletin areas are called). If you get it to work, please post
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 07:06 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.12283 seconds
  • Memory Usage 2,266KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)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
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete