34 function xoopsCodeYoutube(
id, enterFlashPhrase, enterFlashHeightPhrase, enterFlashWidthPhrase)
36 var selection = xoopsGetSelect(
id);
37 if (selection.length > 0) {
40 var text = prompt(enterFlashPhrase,
"");
42 var domobj = xoopsGetElementById(
id);
43 if ( text.length > 0 ) {
44 var text2 = prompt(enterFlashWidthPhrase,
"425");
45 var text3 = prompt(enterFlashHeightPhrase,
"350");
46 var result =
"[youtube="+text2+
","+text3+
"]" + text +
"[/youtube]";
47 xoopsInsertText(domobj, result);
57 return self::decode( $match[4], $match[2], $match[3] );
70 $ts->callbackPatterns[] =
"/\[youtube=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/youtube\]/sU";
71 $ts->callbacks[] = __CLASS__ .
"::myCallback";
84 if (!preg_match(
"/^http[s]?:\/\/(www\.)?youtube\.com\/watch\?v=(.*)/i",
$url, $matches)) {
85 trigger_error(
"Not matched: {$url} {$width} {$height}", E_USER_WARNING);
88 $src =
"http://www.youtube.com/v/" . $matches[2];
90 if (!$dimension = @getimagesize($src)) {
103 $code =
"<object width='{$width}' height='{$height}'><param name='movie' value='{$src}'></param>" .
"<param name='wmode' value='transparent'></param>" .
"<embed src='{$src}' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed>" .
"</object>";
static myCallback($match)
static decode($url, $width, $height)
load(MyTextSanitizer &$ts)