vb.org Archive

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

Emeralda 02-11-2012 02:51 PM

How to add custom bbcodes to quick reply editor?
 
I remember there was a mod for this for 3.8, quick editor improver or something like that. But I couldn't find anything that might allow it on vB4.

kh99 02-11-2012 03:05 PM

There's this mod: https://vborg.vbsupport.ru/showthread.php?t=264219 but to be honest I'm really sure if it does what you want.

Emeralda 02-11-2012 03:21 PM

Yeah, not a word about adding buttons for custom bbcodes, but just revamping how the editor works all together.

kh99 02-11-2012 09:10 PM

Try this, in a plugin using hook editor_toolbar_set:

Code:

if ($this->editor_type == 'qr')
{
  $this->addCustomToolbarButtons();
}


Emeralda 02-11-2012 09:19 PM

Quote:

Originally Posted by kh99 (Post 2298679)
Try this, in a plugin using hook editor_toolbar_set:

Code:

if ($this->editor_type == 'qr')
{
  $this->addCustomToolbarButtons();
}


What does the bolded part mean? I'm a total baka with this >.<

kh99 02-11-2012 09:28 PM

In the adminCP, under "Plugins and Products", click on "Add New Plugin".

- Select editor_toolbar_set from the dropdown menu for Hook Location
- Enter something for the title that will let you remember what it does when you look at it later
- Paste the code that I posted above in the Plugin PHP Code box
- Click the Yes radio button next to Plugin is Active

Then press save. If there are any problems go back to the Plugin Manager and you can edit or disable that plugin.

Emeralda 02-11-2012 09:43 PM

Oh, rawr, great kudos to you. Would you incidentally know what sizes the icons have to be? The old ones are too big with vB4.

kh99 02-11-2012 09:52 PM

I'm not sure, but it kind of looks like 16x16 would be a good size.

Emeralda 02-11-2012 11:23 PM

Awkward, I tried searching for the editor icons, but the only ones I found in the images folder, were the ones from the old editor.

--------------- Added [DATE]1329080773[/DATE] at [TIME]1329080773[/TIME] ---------------

Uhm, new question - how to add this to quick editor in edit mode? http://prntscr.com/632ev

Emeralda 03-26-2012 09:46 AM

Uhm, so like, which hooks should I add this to for quick edit editor, quick replies for private messages http://prntscr.com/7f78l, visitor messages http://prntscr.com/7f77x, and view conversations http://prntscr.com/7f789?

cellarius 03-26-2012 11:01 AM

Try:
Code:

if ($this->editor_type != "fe")
{
  $this->addCustomToolbarButtons();
}

(Adds buttons to all editors but full editor).

Emeralda 03-26-2012 11:34 AM

Uhm... where do I put it? I tried replacing the previous code with yours, but nothing appeared.

Badshah93 04-26-2012 03:22 PM

for adding any particular custom bbcode to Quick Reply, create new plugin

Hook: editor_construct
Title: bbcode button
plugin code:

PHP Code:

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


Replace xxx with Title of custom bbcode, to get title of bbcode open BB Code Manager in admincp.

cjwinternet 11-16-2012 01:40 PM

Quote:

Originally Posted by Badshah93 (Post 2323754)
for adding any particular custom bbcode to Quick Reply, create new plugin

Hook: editor_construct
Title: bbcode button
plugin code:

PHP Code:

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


Replace xxx with Title of custom bbcode, to get title of bbcode open BB Code Manager in admincp.

That works great, thanks.

Sworm 12-05-2012 10:31 AM

I'm using this one for all the custom BBcodes in QR and QE:

Hook: editor_construct
Code:

if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$this->addCustomToolbarButtons();
}

and this one to add "code" - "php" - "html" in the Quick Reply/Edit

Hook: editor_toolbar_filter
Code:

if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$toolbar[] = array('Code', 'Html', 'Php');
}

They working for me.

msau 11-20-2014 06:03 PM

Quote:

Originally Posted by Badshah93 (Post 2323754)
for adding any particular custom bbcode to Quick Reply, create new plugin

Hook: editor_construct
Title: bbcode button
plugin code:

PHP Code:

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


Replace xxx with Title of custom bbcode, to get title of bbcode open BB Code Manager in admincp.

nOOb to a lot of this stuff, this worked great, thanks a lot. :)

jamoss 04-20-2015 05:29 PM

Quote:

Originally Posted by kh99 (Post 2298679)
Try this, in a plugin using hook editor_toolbar_set:

Code:

if ($this->editor_type == 'qr')
{
  $this->addCustomToolbarButtons();
}


Perfect! Just what I needed.

thetechgenius 04-21-2015 04:49 PM

Quote:

Originally Posted by Sworm (Post 2388624)
I'm using this one for all the custom BBcodes in QR and QE:

Hook: editor_construct
Code:

if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$this->addCustomToolbarButtons();
}

and this one to add "code" - "php" - "html" in the Quick Reply/Edit

Hook: editor_toolbar_filter
Code:

if ($this->editor_type == 'qr' || $this->editor_type == 'qe')
{
$toolbar[] = array('Code', 'Html', 'Php');
}

They working for me.

Wow, that worked perfect! Thank you!

The only problem I have is, the PHP, HTML, and Code BBcodes show up twice in the Quick Reply Box. And I only have the first plugin active, when I have both plugins active, the PHP/HTML/Code BBCodes show up 3 times. Without the second plugin active, they show up twice.

Here is a screenshot:
https://vborg.vbsupport.ru/external/2015/04/10.png


All times are GMT. The time now is 04:54 AM.

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.01119 seconds
  • Memory Usage 1,762KB
  • 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
  • (8)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete