I use Kunena Forum 3.0.6 with Joomla 3 for a :usical website.
I need to add BBcode in Kunena editor, so users can share their Soundcloud tracks directly on the forum with something like [soundcloud]my-track[soundcloud].
SO I have this code for now in bbcode.php
'soundcloud' => array(
'mode' => BBCODE_MODE_LIBRARY,
'method' => 'DoSoundcloud',
'allow_in' => array('listitem', 'block', 'columns'),
'class' => 'block',
'allow_in' => array('listitem', 'block', 'columns'),
'content' => BBCODE_PROHIBIT,
'plain_start' => "[soundcloud]",
'plain_end' => "\n",
),
and
function DoSoundcloud($bbcode, $action, $name, $default, $params, $content) {
if ($action == BBCODE_CHECK)
return true;
return '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http://soundcloud.com/'.$content.'&auto_play=false&visual=true"></iframe>';
}
This way it works but not with the complete url. For example, if a user wants to share "http://soundcloud/track/1234" , he must post [soundcloud]track/1234[/soundcloud].
I would prefer with the complete url between the [soundcloud] because that would be far more easier for users.
Waiting for your suggestions ! Regards
url
parameter is not a valid SoundCloud URL.