diff --git a/fp-plugins/bbcode/plugin.bbcode.php b/fp-plugins/bbcode/plugin.bbcode.php index 8669a39..7099b3d 100644 --- a/fp-plugins/bbcode/plugin.bbcode.php +++ b/fp-plugins/bbcode/plugin.bbcode.php @@ -1,11 +1,11 @@ BBCode markup; provides automatic integration with lightbox. Part of the standard distribution. + * Description: Allows using BBCode markup. Part of the standard distribution. */ require (plugin_getdir('bbcode') . '/inc/stringparser_bbcode.class.php'); require (plugin_getdir('bbcode') . '/panels/admin.plugin.panel.bbcode.php'); @@ -337,43 +337,59 @@ function do_bbcode_video($action, $attr, $content, $params, $node_object) { if (isset($attr ['type'])) { $type = $attr ['type']; } else { - // is it http://www.MYSITE.com or http://MYSITE.com ? - $web = explode('.', $vurl ['host']); - array_pop($web); - $type = isset($web [1]) ? $web [1] : $web [0]; + // no host: must be local file + if (!array_key_exists('host', $vurl)) { + $type = 'html5'; + } else { + // is it http://www.MYSITE.com or http://MYSITE.com ? + $web = explode('.', $vurl ['host']); + array_pop($web); + $type = isset($web [1]) ? $web [1] : $web [0]; + } } // Check the [video] element's attributes width, height and float $width = isset($attr ['width']) ? $attr ['width'] : '560'; $height = isset($attr ['height']) ? $attr ['height'] : '315'; - $float = isset($attr ['float']) ? 'id="' . $attr ['float'] . '" ' : 'style="margin: 0 auto; display:block;" '; + $floatClass = isset($attr ['float']) ? $attr ['float'] : 'nofloat'; - $query = utils_kexplode($vurl ['query'], '=&'); + $query = array(); + if (array_key_exists('query', $vurl)) { + $query = utils_kexplode($vurl ['query'], '=&'); + } $output = null; // We recognize different video providers by the given video URL. switch ($type) { // YouTube case 'youtube': - $output = ''; + $output = ''; break; // Vimeo case 'vimeo': $vid = isset($query ['sec']) ? $query ['sec'] : str_replace('/', '', $vurl ['path']); - $output = ''; + $output = ''; break; // Facebook case 'facebook': $vid = isset($query ['sec']) ? $query ['sec'] : str_replace('/video/', '', $vurl ['path']); - $output = '
+ $output = '
-
'; +
'; break; // Any video file that can be played with HTML5