MyBB Community Forums

Full Version: How do I add a functioning button to the message editor?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using the code some kind person put on this forum I have been able to add a MyCode function on my forum so that people can embed Soundcloud players into my site.

So using the MyCode [sc][/sc] I can have a Soundcloud flash player embed on my site. The only problem is that I don't know a way to display this as a button in the menu editor so that a pop-up box appears where they just enter the Soundcloud url and it posts it to the site.

Apologies if this has been asked before, I haven't found it whilst searching.

Thank you I will try that shortly.
OK, so that tutorial tells me how to add a button, how do I connect that button to the MyCode so that it actually functions?

See my MyCode is, I've tried inserting the code for the insert section as the tutorial says, but it results in displaying the code like the MyCode

\[sc\](.*?)\[/sc\]
is the MyCode, adding that in the code results in

[[sc](.*?)[/sc]][/[sc](.*?)[/sc]]

Taking away the [] and [/] as the tutorial says, I insert \sc\(.*?)\sc\
which I don't think is right but nevertheless tried and it ends up not displaying the editor bar at all on the forum, confirming to me that the code is not right.

For reference, the code that the MyCode is replacing is
<object height="81" width="100%"> 
<param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&secret_url=false&amp;color=990000"></param>
<param name="allowscriptaccess" value="always"></param> 
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&secret_url=false&amp;color=990000" type="application/x-shockwave-flash" width="100%"></embed> </object>

and together with adding this
\[sc\](.*?)\[/sc\]
as the MyCode as above, I only need use [sc][/sc] in my forum to display the embed code and thus embed a SoundCloud player.

What is the correct code to insert into my forum?
Use the attached editor.js - [attachment=22194]
Oh it was just the 'sc' that was needed. How simple haha. Aren't these things always that way.

Thank you.