MyBB Community Forums

Full Version: Adding BBcode buttons for new MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I just got finished adding the spoiler tag and it works great.
But having to type out [spoiler][/spoiler] ....well, we are lazy!
I used the Spoiler Mycode found here
What I would like to do is add either the same as adding a link or image ( popup to enter url then text ) or even the simple B I or U type buttons/functions would work.

Thanks in advance Smile
Thank you!
Can current buttons be replaced?
I do not think the PHP tag will be used at all and if I could replace that with the spoiler tag that way I don't have to make a new bar below.This way I can keep it inline.
Can that be done?
You can also change this:
areaContainer.style.height = parseInt(editor.style.height)-parseInt(toolBar.style.height)-parseInt(toolbar2.style.height)-subtract+"px";
to:
areaContainer.style.height = parseInt(editor.style.height)-parseInt(toolBar.style.height)-parseInt(toolbar2.style.height)-parseInt(toolbar3.style.height)-subtract+"px";
Note the addition "-parseInt(toolbar3.style.height)" you need to change toolbar3 to the name you added your new toolbar as.

Or if you just wanna change the buttons you can change this line:
this.insertStandardButton(elements, "php", "images/codebuttons/php.gif", "php", "", this.options.lang.title_php);
Thank you for your help.
I'm not sure I understand though where you add any of that stuff you just posted.Not sure if that is also an addition to the link you gave or is theis to replace the php function I asked about?

Forgive my small knowledge on php, still sorta learning the ways. Toungue
That is javascript not PHP. I just thought you would understand as you already had modified jscripts/editor.js
Ok, I took the option to do that last thing you posted which was.....

EDITOR.JS
this.insertStandardButton(elements, "php", "images/codebuttons/php.gif", "php", "", this.options.lang.title_php);
I replaced with...
this.insertStandardButton(elements, "spoiler", "images/codebuttons/spoil.gif", "spoiler", "", this.options.lang.title_spoiler);
I ONLY did that and it seems to do as I want it to so thank you for the help.
One problem, well not really a problem.When you hover over those little tag images, they tell you what they do.Well the new one reads undefined
How do I change this to say something like Insert Spoiler Text
I thought by going into global_lang.php and replacing the 'php' texting with 'spoiler' would do it but it only gives me errors at the top of my forum.
I find
$l['editor_title_php'] = "Insert formatted PHP code";
and replace with
$l['editor_title_spoiler'] = "Insert formatted spoiler code";

But I get those nasty errors
information - headers already sent by (output started at /home/site/public_html/nocturna/inc/languages/english/global.lang.php:1) in /home/site/public_html/nocturna/inc/functions.php on line 1121

So as of now all is good and works great without errors.I just wanted it to have the hover text.Not that big a deal I guess.
======================================

Thank you for all your help Smile
Check that you haven't made an accidental space or 'new line' at the top of global.lang.php
Are you using notepad to edit the file? Try using some other program. Also upload in text/ASCII mode, and not binary (if your FTP client supports that option)
Thank you Dennis.Will try this later.
Pages: 1 2