aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views/default/ecml/keywords/slideshare.php
blob: 1881a1a897a4831f57f737f06fa76cefc3c583b0 (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
32
33
34
<?php
/**
 * ECML Slideshare 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/
 */

// this wants the "wordpress.com" embed code.
// to make life easier on users, don't require them to add the "s
// and just chop out the id= bit here from the full attr list

$id = str_replace('id=', '', $vars['ecml_params_string']);
$width = (isset($vars['width'])) ? $vars['width'] : 450;
$height = (isset($vars['height'])) ? $vars['height'] : 369;

if ($id) {
	// @todo need to check if the & should be encoded.

	$slide_url = "http://static.slideshare.net/swf/ssplayer2.swf?id=$id";

	echo "
<object type=\"application/x-shockwave-flash\" wmode=\"opaque\" data=\"$slide_url\" width=\"$width\" height=\"$height\">
	<param name=\"movie\" value=\"$slide_url\" />
	<param name=\"allowFullScreen\" value=\"true\" />
	<param name=\"allowScriptAccess\" value=\"always\" />

	<embed src=\"$slide_url\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"$width\" height=\"$height\"></embed>
</object>
";
}