View Full Version : Adding Buttons for BBCode-Solved
MTGDarkness
02-13-2009, 03:31 PM
So, obviously for the advanced editor, you can add a button image for a simple BBCode. But what about adding buttons for this to the quick reply editor?
And how about BBCodes that you had to manually add รก la template hooks due to the necessity of a PHP function or impracticality of HTML to describe them; I have two such that are quite important to the forum and no idea how to add buttons for them to either the advanced editor or the quick reply.
TigerC10
02-13-2009, 10:28 PM
This thread (https://vborg.vbsupport.ru/showthread.php?t=97295) has a nice tutorial for adding bbCode buttons to your advanced editor. To add buttons to the quick reply, use the same tutorial except edit the showthread_quickreply template instead of the editor_toolbar_on template.
Read the article (https://vborg.vbsupport.ru/showthread.php?t=97295) before viewing my alteration mentioned below.
However, instead of adding (just to be clear, do NOT add this) from the tutorial
case 'BBCODE':
{
useoption = true;
}
for a bbCode that has options, simply use the same code for a bbcode that has no options (with one slight alteration):
<td><div class="imagebutton" id="{$editorid}_cmd_wrap1_BBCODE"><img src="$stylevar[imgdir_editor]/YOURBUTTONIMAGE" width="21" height="20" alt="$vbphrase[YOURALTPHRASE]" /></div></td>
Changing the 0 (from the code in the tutorial) to a 1 will initiate a prompt to ask for the option value of the bbCode.
This works for bbCode that depends on a hook, too. All you need to do is chage the red BBCODE to the actual value of the bbCode... Say your hook defined bbCode is "" - then just put the word video in place of BBCODE in the sample code above.
As for more dynamic things (like a color picker drop down menu), I'm still not sure how to go about that. It would probably involve editing the /clientscript/vbulletin_textedit.js file. If you find out how to do it without altering the .js file , let me know - If I find out I'll post how.
MTGDarkness
02-14-2009, 07:30 AM
That worked, thanks! :D
How about to the quick reply editor?
TigerC10
02-14-2009, 04:47 PM
I already told you how to do that. :)
To add buttons to the quick reply, use the same tutorial except edit the showthread_quickreply template instead of the editor_toolbar_on template.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.