aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views/default/ecml/keywords/dailymotion.php
blob: 1c97792eb021d1a3a4d8dc1d102e1dfc91c008cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>
";
}