27 $config = parent::loadConfig(__DIR__);
30 $code =
"<img src='{$this->image_path}/soundcloud.png' "
31 .
" alt='{$alttxt}' title='{$alttxt}' "
32 .
" onclick='xoopsCodeSoundCloud(\"{$textarea_id}\",\"{$prompt}\");' "
33 .
" onmouseover='style.cursor=\"hand\"'/> ";
35 function xoopsCodeSoundCloud(
id, enterSoundCloud)
37 var selection = xoopsGetSelect(
id);
38 if (selection.length > 0) {
41 var text = prompt(enterSoundCloud,
"");
44 var domobj = xoopsGetElementById(
id);
45 if (text.length > 0) {
46 xoopsInsertText(domobj,
"[soundcloud]"+text+
"[/soundcloud]");
57 $ts->callbackPatterns[] =
"/\[soundcloud\](http[s]?:\/\/[^\"'<>]*)(.*)\[\/soundcloud\]/sU";
58 $ts->callbacks[] = __CLASS__ .
"::myCallback";
63 $url = $match[1] . $match[2];
64 $config = parent::loadConfig(__DIR__);
65 if (!preg_match(
"/^http[s]?:\/\/(www\.)?soundcloud\.com\/(.*)/i",
$url, $matches)) {
66 trigger_error(
"Not matched: {$url}", E_USER_WARNING);
71 $code =
'<object height="81" width="100%"><param name="movie" '
72 .
'value="http://player.soundcloud.com/player.swf?url='.$url.
'&g=bb">'
73 .
'</param><param name="allowscriptaccess" value="always"></param>'
74 .
'<embed allowscriptaccess="always" height="81" '
75 .
'src="http://player.soundcloud.com/player.swf?url=' .
$url
76 .
'&g=bb" type="application/x-shockwave-flash" width="100%"></embed></object>'
77 .
'<a href="'.$url.
'">'.
$url.
'</a>';
static myCallback($match)