MyBB Community Forums

Full Version: Add custom BBcodes to formatting box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi again,

I was just wondering is it possible to add custom bbcodes to the text formatting box when making a post. I have a few custom bbcodes that I'd like to add a button for. Is it just a template to edit?

Andy
Edit your codebuttons template.
It will require some CSS, Javascript and template changes I think. There are some tutorials around if you search for them in the User Submitted Tutorials forum IIRC (I tried looking but couldn't find any but there are definetely some there). Smile
It's in your Ungrouped Templates set.
I think this is the most up-to-date tutorial, you just need to register to view it - http://www.mybbextras.com/showthread.php?tid=1

(2010-09-10, 07:45 PM)BrianRR Wrote: [ -> ]It's in your Ungrouped Templates set.

You can't add buttons just by editing that template, it's more complex than that.
Hmm, that template folder has no recognisable css, it just includes the javascript file.
I went to the javascript file and edited the following section:

this.options.lang.title_image},
				{type: 'button', name: 'url', sprite: 'link', insert: 'url', title: this.options.lang.title_hyperlink},
				{type: 'button', name: 'email', sprite: 'email', insert: 'email', extra: 1, title: this.options.lang.title_email},
				{type: 'separator'},
				{type: 'button', name: 'box', sprite: 'box', insert: 'box', title: this.options.lang.title_box},
				{type: 'button', name: 'quote', sprite: 'quote', insert: 'quote', title: this.options.lang.title_quote},
				{type: 'button', name: 'code', sprite: 'code', insert: 'code', title: this.options.lang.title_code},
				{type: 'button', name: 'php', sprite: 'php', insert: 'php', title: this.options.lang.title_php},
				{type: 'button', name: 'video', insert: 'video', image: 'television.gif', dropdown: true, title: this.options.lang.title_video, options: this.videos}
			]
		});

See the "box" code. And that worked, however it shows a 'B', the same as Bold. I tried using the 'image: television.gif' but it didnt change, so im guessing there is another file that I need to edit. Any ideas?

Andy
Oh, you sent a tutorial. Looking now, cheers Smile
Woo, I finally got it.

After 15 minutes of editing the default folder, and wondering why the picture wouldn't show up, I thought hmm.... I use the Office 2007 editor....

Once I edited the correct files it worked perfectly! Cheers for your help guys.

I've got a cool little [box] box now Big Grin

[Image: editorb.gif]
Maybe you could make a newer tutorial on how to do this? I want to add a Spoiler button to my editor.
The tutorial above works fine. I was just editing the wrong file Smile