I run a forum for electronic music and culture called NVraves. A feature was requested recently to be able to embed soundcloud music directly into users posts. It was an easy BBCode modification. Here you go!
I run a forum for electronic music and culture called NVraves. A feature was requested recently to be able to embed soundcloud music directly into users posts. It was an easy BBCode modification. Here you go!
// FILE: Sources/Subs.php
// find:
'before' => '<span style="color: white;">',
'after' => '</span>',
),
// after:
/*
MOD BBC
Soundcloud bbctag
*/
array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'content' => '<div style="width:600px;"><object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&g=bb"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&g=bb" type="application/x-shockwave-flash" width="100%"></embed></object><a href="$1" target="_blank">$1</a></div>',
),
// file: Themes/default/Post.template.php
// find:
'face' => array('code' => 'font', 'before' => '[font=Verdana]', 'after' => '[/font]', 'description' => $txt[533]),
);
$context['bbc_tags'][] = array(
// after:
/*
MOD BBC
Soundcloud bbctag
*/
'soundcloud' => array('code' => 'soundcloud', 'before' => '[soundcloud]', 'after' => '[/soundcloud]', 'description' => 'Soundcloud'),
Be sure to add this
icon to Themes/default/images/bbc/.
That’s it! Easy enough. And now I have a forum of happy DJs.