vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Add custom bbcodes to quick reply (https://vborg.vbsupport.ru/showthread.php?t=270608)

charlesr 09-20-2011 12:11 PM

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


Lynne 09-20-2011 05:01 PM

hook location - editor_toolbar_filter
PHP Code:

// for editor_toolbar_filter
if (THIS_SCRIPT == 'showthread')
$toolbar[] = array('BBCode1','BBCode2'); 


charlesr 09-21-2011 10:15 AM

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

Lynne 09-21-2011 05:16 PM

You replace it with the BBCode Title.

charlesr 09-21-2011 08:35 PM

Smart. That worked. A bit counter-intuitive, but all good thanks!

khalid 10-28-2011 12:24 PM

Quote:

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

Emeralda 02-11-2012 08:55 PM

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?

charlesr 02-13-2012 04:55 PM

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.

Emeralda 02-13-2012 05:31 PM

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

charlesr 02-14-2012 07:30 AM

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


All times are GMT. The time now is 03:46 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01405 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)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