Доброго времени суток!
Подскажите пожалуйста
Возможно ли каким то образом в модуле новости вставлять видео с youtube?
Подскажите пожалуйста
Возможно ли каким то образом в модуле новости вставлять видео с youtube?
function bb_parse_video ($a) { $url=parse_url(preg_replace("#&#", "&", $a1)); if ($url'host'=='www.youtube.com' || $url'host'=='youtube.com') { parse_str($url'query', $param); if ($param'v') return '<object width="100%" height="480"><param name="movie" value="http://www.youtube.com/v/'.$param'v'.'&hl=ru_RU&fs=1&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$param'v'.'&hl=ru_RU&fs=1&border=1" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="100%" height="480"></embed></object>'; else return false; } elseif ($url'host'=='www.rutube.ru' || $url'host'=='rutube.ru') { parse_str($url'query', $param); if ($param'v') return '<OBJECT width="500" height="400"><PARAM name="movie" value="http://video.rutube.ru/'.$param'v'.'"></PARAM><PARAM name="wmode" value="window"></PARAM><PARAM name="allowFullScreen" value="true"></PARAM><EMBED src="http://video.rutube.ru/'.$param'v'.'" type="application/x-shockwave-flash" wmode="window" width="500" height="400" allowFullScreen="true" ></EMBED></OBJECT>'; else return false; } elseif ($url'host'=='www.smotri.com' || $url'host'=='smotri.com') { parse_str($url'query', $param); if ($param'id') return '<object id="smotriComVideoPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="400"><param name="movie" value="http://pics.smotri.com/player.swf?file='.$param'id'.'&bufferTime=3&autoStart=false&str_lang=rus&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="bgcolor" value="#ffffff" /><embed src="http://pics.smotri.com/player.swf?file='.$param'id'.'&bufferTime=3&autoStart=false&str_lang=rus&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml" quality="high" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="500" height="400" type="application/x-shockwave-flash"></embed></object>'; } elseif ($url'host'=='www.vision.rambler.ru' || $url'host'=='vision.rambler.ru') { $param'id'=preg_replace('#^users/#si','', trim($url'path','/ ')); if ($param'id'!='') return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="400"><param name="wmode" value="transparent"/><param name="allowFullScreen" value="true"/><param name="movie" value="http://vision.rambler.ru/i/e.swf?id='.trim($param'id','/ ').'&logo=1" /><embed src="http://vision.rambler.ru/i/e.swf?id='.trim($param'id','/ ').'&logo=1" width="500" height="400" type="application/x-shockwave-flash" wmode="transparent" allowFullScreen="true" /></object>'; } else return false; }
$sourse = preg_replace($bb, $html, $sourse);
$sourse=preg_replace_callback("#\video\(\w\#$%&~/.\-;:=_,?+*?)\/video\#si", "bb_parse_video", $sourse);
$code .= "<div class=\"editorbutton\" OnMouseOver=\"this.className='editorbuttonover';\" OnMouseOut=\"this.className='editorbutton';\" OnClick=\"InsertCode('quote', '', '', '', '".$id."')\"><img src=\"".img_find("editor/quote")."\" title=\""._EQUOTE."\"></div>";
$code .= "<div class=\"editorbutton\" OnMouseOver=\"this.className='editorbuttonover';\" OnMouseOut=\"this.className='editorbutton';\" OnClick=\"InsertCode('video', '', '', '', '".$id."')\"><img src=\"".img_find("editor/video")."\" title=\""._VIDEO."\"></div>";
Форум
Контакты