diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:21:32 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:21:32 +0000 |
commit | f29b327342068543b8a2a3f0f487953468f3c9a5 (patch) | |
tree | 75622302235ff897e3c7fa4971121580d0eb0d50 /mod | |
parent | 08441e1e99bbae49418c4b06c302f1a2057c2179 (diff) | |
download | elgg-f29b327342068543b8a2a3f0f487953468f3c9a5.tar.gz elgg-f29b327342068543b8a2a3f0f487953468f3c9a5.tar.bz2 |
Added more video sources.
Allowing the . character in keywords.
git-svn-id: http://code.elgg.org/elgg/trunk@5759 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/ecml/start.php | 16 | ||||
-rw-r--r-- | mod/ecml/views/default/ecml/keywords/blip.tv.php | 23 | ||||
-rw-r--r-- | mod/ecml/views/default/ecml/keywords/dailymotion.php | 31 | ||||
-rw-r--r-- | mod/ecml/views/default/ecml/keywords/livevideo.php | 28 | ||||
-rw-r--r-- | mod/ecml/views/default/ecml/keywords/redlasso.php | 27 |
5 files changed, 123 insertions, 2 deletions
diff --git a/mod/ecml/start.php b/mod/ecml/start.php index 983894511..287bdc730 100644 --- a/mod/ecml/start.php +++ b/mod/ecml/start.php @@ -120,7 +120,7 @@ function ecml_parse_view($hook, $entity_type, $return_value, $params) { // give me everything that is not a ], possibly followed by a :, and surrounded by [[ ]]s //$keyword_regex = '/\[\[([a-z0-9_]+):?([^\]]+)?\]\]/'; - $keyword_regex = '/\[\[([a-z0-9]+)([^\]]+)?\]\]/'; + $keyword_regex = '/\[\[([a-z0-9\.]+)([^\]]+)?\]\]/'; $CONFIG->ecml_current_view = $params['view']; $return_value = preg_replace_callback($keyword_regex, 'ecml_parse_view_match', $return_value); @@ -140,7 +140,19 @@ function ecml_parse_view($hook, $entity_type, $return_value, $params) { function ecml_keyword_hook($hook, $type, $value, $params) { // I keep going back and forth about entity and view. They're powerful, but // a great way to let a site get hacked if the admin doesn't lock them down. - $keywords = array('entity', 'view', 'youtube', 'slideshare', 'vimeo', 'googlemaps'); + $keywords = array( + 'entity', + 'view', + 'youtube', + 'slideshare', + 'vimeo', + 'googlemaps', + 'scribd', + 'blip.tv', + 'dailymotion', + 'livevideo', + 'redlasso' + ); foreach ($keywords as $keyword) { $value[$keyword] = array( diff --git a/mod/ecml/views/default/ecml/keywords/blip.tv.php b/mod/ecml/views/default/ecml/keywords/blip.tv.php new file mode 100644 index 000000000..44e14059c --- /dev/null +++ b/mod/ecml/views/default/ecml/keywords/blip.tv.php @@ -0,0 +1,23 @@ +<?php +/** + * ECML Blip.tv support + * + * @package ECML + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +$params = str_replace('?', '', $vars['ecml_params_string']); +$width = (isset($vars['width'])) ? $vars['width'] : 425; +$height = (isset($vars['height'])) ? $vars['height'] : 350; + +if ($params) { + $embed_src = elgg_http_add_url_query_elements($src, array('output' => 'embed')); + $link_href = elgg_http_add_url_query_elements($src, array('source' => 'embed')); + + echo " +<p><script type='text/javascript' src='http://blip.tv/syndication/write_player?skin=js&cross_post_destination=-1&view=full_js&$params'></script></p> +"; +}
\ No newline at end of file diff --git a/mod/ecml/views/default/ecml/keywords/dailymotion.php b/mod/ecml/views/default/ecml/keywords/dailymotion.php new file mode 100644 index 000000000..1c97792eb --- /dev/null +++ b/mod/ecml/views/default/ecml/keywords/dailymotion.php @@ -0,0 +1,31 @@ +<?php +/** + * ECML Daily Motion support + * + * @package ECML + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +$base_url = 'http://www.dailymotion.com/video/'; +$src = (isset($vars['src'])) ? str_replace($base_url, '', $vars['src']) : FALSE; +$width = (isset($vars['width'])) ? $vars['width'] : 480; +$height = (isset($vars['height'])) ? $vars['height'] : 270; + +if ($src) { + list($vid, $name) = explode('_', $src); + $url = "http://www.dailymotion.com/swf/video/$vid"; + + echo " + <p> + <object width=\"$width\" height=\"$height\"> + <param name=\"movie\" value=\"$url\"></param> + <param name=\"allowFullScreen\" value=\"true\"></param> + <param name=\"allowScriptAccess\" value=\"always\"></param> + <embed type=\"application/x-shockwave-flash\" src=\"$url\" width=\"$width\" height=\"$height\" allowfullscreen=\"true\" allowscriptaccess=\"always\"></embed> + </object> + </p> +"; +}
\ No newline at end of file diff --git a/mod/ecml/views/default/ecml/keywords/livevideo.php b/mod/ecml/views/default/ecml/keywords/livevideo.php new file mode 100644 index 000000000..b067b1ab6 --- /dev/null +++ b/mod/ecml/views/default/ecml/keywords/livevideo.php @@ -0,0 +1,28 @@ +<?php +/** + * ECML Live Video support + * + * @package ECML + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +$base_url = 'http://www.livevideo.com/video/'; +$src = (isset($vars['src'])) ? str_replace($base_url, '', $vars['src']) : FALSE; +$width = (isset($vars['width'])) ? $vars['width'] : 445; +$height = (isset($vars['height'])) ? $vars['height'] : 369; + +if ($src) { + $parts = explode('/', $src); + $vid = $parts[1]; + // it automatically autostarts, but not passing it causes control issues + $url = "http://www.livevideo.com/flvplayer/embed/$vid&autoStart=1"; + + echo " + <p> + <embed src=\"$url\" type=\"application/x-shockwave-flash\" quality=\"high\" WIDTH=\"$width\" HEIGHT=\"$height\" wmode=\"transparent\"></embed> + </p> +"; +}
\ No newline at end of file diff --git a/mod/ecml/views/default/ecml/keywords/redlasso.php b/mod/ecml/views/default/ecml/keywords/redlasso.php new file mode 100644 index 000000000..e36a4a92a --- /dev/null +++ b/mod/ecml/views/default/ecml/keywords/redlasso.php @@ -0,0 +1,27 @@ +<?php +/** + * ECML Red Lasso support + * + * @package ECML + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + +$vid = (isset($vars['id'])) ? $vars['id'] : FALSE; +$width = (isset($vars['width'])) ? $vars['width'] : 390; +$height = (isset($vars['height'])) ? $vars['height'] : 320; + +if ($vid) { + echo " +<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"$width\" height=\"$height\" id=\"Redlasso\"> + <param name=\"movie\" value=\"http://player.redlasso.com/redlasso_player_b1b_deploy.swf\" /> + <param name=\"flashvars\" value=\"embedId=$vid&pid=\" /> + <param name=\"allowScriptAccess\" value=\"always\" /> + <param name=\"allowFullScreen\" value=\"true\" /> + <embed src=\"http://player.redlasso.com/redlasso_player_b1b_deploy.swf\" flashvars=\"embedId=$vid&pid=\" width=\"$width\" height=\"$height\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" allowFullScreen=\"true\" name=\"Redlasso\"> + </embed> +</object> +"; +}
\ No newline at end of file |