Parašė luxis112· 2010 Bir. 13 23:06:51
#2
o gal sitas gali padeti tik pasakykit kaip sita plugina irasyt skaiciau tipo jis kaip youtube bbcode wiskas taip pat bet nezinau kaip ji irasyti
kur ikelti ir pns
<?php
// Initialize plugin
plugin_add_hook("BBCODE2HTML", "plugin_megavideo_tag_to_html");
plugin_add_hook("HTML2BBCODE", "plugin_megavideo_html_to_tag");
// Convert [megavideo] to html code (post message)
function plugin_megavideo_tag_to_html($array) {
list($bbcode) = $array;
$bbcode = preg_replace('#\[MEGAVIDEO\]([0-9a-zA-Z_\-]+)\[/MEGAVIDEO\]#si', '<object width="640" height="480"><param name="movie" value="http://wwwstatic.megavideo.com/mv_player.swf?v=\\1"></param><embed src="http://wwwstatic.megavideo.com/mv_player.swf?v=\\1" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="480"></embed></object>', $bbcode);
return array($bbcode);
}
// Convert html to [MEGAVIDEO] tag (edit message)
function plugin_megavideo_html_to_tag($array) {
list($bbcode) = $array;
$bbcode = preg_replace('#<object width="640" height="480"><param name="movie" value="http://wwwstatic.megavideo.com/mv_player.swf\?v=([0-9a-zA-Z_\-]+)"></param><embed src="http://wwwstatic.megavideo.com/mv_player.swf\?v=([0-9a-zA-Z_\-]+)" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="480"></embed></object>#si', '[MEGAVIDEO]\\1[/MEGAVIDEO]', $bbcode);
return array($bbcode);
}