News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

BBCode for Soundcloud music player!

Started by maxklr, July 30, 2009, 07:27:12 AM

Previous topic - Next topic

maxklr

Hi!

I have a feature request. It would be cool if someone were to make a Modification that allowed for posting the soundcloud player. You can check out my soundcloud profile at www.soundcloud.com/max-million to see what it looks like.

What I´m thinking is to have it the same way as the youtube MOD. where you type in: [youtube]url to clip[/youtube]

Shouldn´t it be easy to apply it to soundcloud? The code for embedding it in html looks like this (if its any help):

<div style="font-size: 11px;"><object height="81" width="100%">  <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fmax-million%2Fmix-32"></param>  <param name="allowscriptaccess" value="always"></param>  <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fmax-million%2Fmix-32" type="application/x-shockwave-flash" width="100%"> </embed> </object> <div style="padding-top: 5px;"><a href="http://soundcloud.com/max-million/mix-32">Mix</a>  by  <a href="http://soundcloud.com/max-million">Max Million</a></div></div>

Thanks for reading!

Arantor

There seems to be some stuff in there other than just the player (the Mix by Max Million bit) which would likely have to come out otherwise.

Adding BBcode is not so difficult, it's a mod to Subs.php - and it would be as a mod, not a core feature (even [youtube] won't be a core feature)

Alternatively, you could ask the Aeva people about adding it into their mod since they already support many types of music plugin.

Liam.

If you can get rid of that Mix by Max Million part of the code I'd be happy to make this a mod for SMF. But besides that, what version of SMF?

Arantor

Since it's just a BBcode edit the same code would work fine in both SMF 1.1.10 and SMF 2.0 just by modding Subs.php to add [soundcloud].

Sentinel [AF]

#4
Code (my bbtag array (goes in subs.php)) Select

array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'parameters' => array(
'artist' => array('optional' => true),
'track' => array('optional' => true),
),
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object>   <span><a href="$1" target="_blank">{track}</a>  by  <a href="http://soundcloud.com/{artist}" target="_blank">{artist}</a></span>',
'block_level' => true,
),


artist = the artists soundcloud user-name
track = track name

example one:

[soundcloud artist=ArtistName track=TrackName]http://soundcloud.com/artist/track[/soundcloud]

example two:

[soundcloud artist=AFmeplease track=Shade Nine Six (wip)]http://soundcloud.com/afmeplease/sentinel-shade-nine-six[/soundcloud]

* Can see them working HERE (array codes are on there too) - also you can embed player into signatures.
** 2 other things: whether the player will load or not depends on traffic I think & also </> share must be enabled on the track in soundcloud settings to be able to embed it.

Safe :)

Sentinel [AF]

#5
I did another version that displays an url underneath instead of track title & username links.

Code (shortened version (displays url underneath)) Select

array(
'tag' => 'sc',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="$1" target="_blank">$1</a></span>',
'block_level' => true,
),


example: [sc]http://soundcloud.com/artist/track[/sc]

or if you like add both of them ...

Code (los dos versions (simple / advanced)) Select

array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'parameters' => array(
'artist' => array('optional' => true),
'track' => array('optional' => true),
),
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object>   <span><a href="$1" target="_blank">{track}</a>  by  <a href="http://soundcloud.com/{artist}" target="_blank">{artist}</a></span>',
'block_level' => true,
),
array(
'tag' => 'sc',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="$1" target="_blank">$1</a></span>',
'block_level' => true,
),

Phil Serna

Quote from: Sentinel [AF] on January 23, 2010, 04:00:31 AM
I did another version that displays an url underneath instead of track title & username links.

Code (shortened version (displays url underneath)) Select

array(
'tag' => 'sc',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="$1" target="_blank">$1</a></span>',
'block_level' => true,
),


example: [sc]http://soundcloud.com/artist/track[/sc]

or if you like add both of them ...

Code (los dos versions (simple / advanced)) Select

array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'parameters' => array(
'artist' => array('optional' => true),
'track' => array('optional' => true),
),
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object>   <span><a href="$1" target="_blank">{track}</a>  by  <a href="http://soundcloud.com/{artist}" target="_blank">{artist}</a></span>',
'block_level' => true,
),
array(
'tag' => 'sc',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="$1" target="_blank">$1</a></span>',
'block_level' => true,
),


does this go somewhere specific in the subs.php?
www.misc-content.com
Helping you get through your work day.

Phil Serna

Anyone? I would like to get SC on my SMF community....... :-/
www.misc-content.com
Helping you get through your work day.

Sentinel [AF]

this code probably isn't same as other I posted :)

which you've already found.

and to your answer no it goes nowhere specific just search for any of the other arrays like 'html' for instance.
or 'img' ...

doesn't really matter where it goes and I don't think I said a add after or before in other cause everyone's sub is different depending on what mods they added :)

diontoradan

well i've successfully apply this mod, thanks for the tip, i wish it could be done via aeva, but i cannot find clue to add more sites.

in my case, subs.php find this code below > add the code before

array(
'tag' => 'abbr',


subs-editor.php > add before :
array(
'image' => 'flash',

diontoradan

i add image definition to your code, full code I've applied:

subs-editor.php >


'soundcloud' => array(
'image' => 'soundcloud',
'code' => 'soundcloud',
'before' => '[soundcloud artist= track=]',
'after' => '[/soundcloud]',
'description' => $txt['soundcloud']),
         
'sc' => array(
'image' => 'sc',
'code' => 'sc',
'before' => '[sc]',
'after' => '[/sc]',
'description' => $txt['sc']),
         
'cloudset' => array(
'image' => 'cs',
'code' => 'cloudset',
'before' => '[cloudset]',
'after' => '[/cloudset]',
'description' => $txt['cloudset']),



put the attached image under Themes/default/images/bbc...

Sentinel [AF]

thanks man but I mentioned that the correct thread is not this topic !!!

this is correct one: http://www.simplemachines.org/community/index.php?topic=362957.0

I've also included soundcloud set bbc arrays :)

Sentinel [AF]

as for where you added it ...
it don't really matter :)

I had aeva before but it wasn't working correctly for me, probably due to another mod or all the custom code & or modifications I've made to  certain mods.

Advertisement: