20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
24 function encode($textarea_id)
26 $config = parent::loadConfig(dirname(__FILE__));
29 function xoopsCodeFlash(
id, enterFlashPhrase, enterFlashHeightPhrase, enterFlashWidthPhrase, enableDimensionDetect)
31 var selection = xoopsGetSelect(
id);
32 if (selection.length > 0) {
35 var text = prompt(enterFlashPhrase,
"");
37 var domobj = xoopsGetElementById(
id);
38 if ( text.length > 0 ) {
39 var text2 = enableDimensionDetect ?
"" : prompt(enterFlashWidthPhrase,
"");
40 var text3 = enableDimensionDetect ?
"" : prompt(enterFlashHeightPhrase,
"");
41 var result =
"[flash="+text2+
","+text3+
"]" + text +
"[/flash]";
42 xoopsInsertText(domobj, result);
55 $ts->patterns[] =
"/\[(swf|flash)=(['\"]?)([^\"']*),([^\"']*)\\2]([^\"]*)\[\/\\1\]/esU";
56 $ts->replacements[] = __CLASS__ .
"::decode( '\\5', '\\3', '\\4' )";
61 function decode(
$url, $width, $height)
63 $config = parent::loadConfig(dirname(__FILE__));
64 if ((empty($width) || empty($height)) && !empty(
$config[
'detect_dimension'])) {
65 if (!$dimension = @getimagesize(
$url)) {
66 return "<a href='{$url}' rel='external' title=''>{$url}</a>";
69 $height = $dimension[1] * $width / $dimension[0];
70 }
else if (! empty($height)) {
71 $width = $dimension[0] * $height / $dimension[1];
73 list ($width, $height) = array(
79 $rp =
"<object width='{$width}' height='{$height}' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'>";
80 $rp .=
"<param name='movie' value='{$url}'>";
81 $rp .=
"<param name='QUALITY' value='high'>";
82 $rp .=
"<PARAM NAME='bgcolor' VALUE='#FFFFFF'>";
83 $rp .=
"<param name='wmode' value='transparent'>";
84 $rp .=
"<embed src='{$url}' width='{$width}' height='{$height}' quality='high' bgcolor='#FFFFFF' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>";