Hi guys,
I`m getting a blank page when I add 2 or more Youtube calls on the same page. I`ve tried tweaking the snippet as suggested by tkfm and I`m still getiing that problem. Can anyone help?
Thanks
if(!defined('getIdFromUrl')) {
function getIdFromUrl($url) {
$url_parts = parse_url($url);
parse_str($url_parts['query']);
if (isset($v)) {
return $v;
} else {
return false;
}
}
}
$swfobject_express_url = isset($swfobject_url)?$swfobject_url:'/assets/js/swfobject/expressInstall.swf';
$swfobject_express_url = isset($swfobject_express_url)?$swfobject_express_url:'/assets/js/swfobject/expressInstall.swf';
<object id="LPmbGzQaOCs" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="243">
<param name="movie" value=" http://www.youtube.com/v/LPmbGzQaOCs&rel=1&autoplay=0&loop=0&disablekb=0&egm=0&border=0&hl=en" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data=" http://www.youtube.com/v/LPmbGzQaOCs&rel=1&autoplay=0&loop=0&disablekb=0&egm=0&border=0&hl=en" width="400" height="243">
<!--<![endif]-->
<p>This video requires the free Flash plugin.</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>

$width = isset($width)?$width:425; $height = $width * 0.825; $height = (int)$height;
<?php $output = urlencode($output); return ($output); ?>
[*video:urlencode*] [!YouTube? &url=`[*video:urlencode*]`!]
[!YouTube? &url=`[+phx:input=`[[GetField? &docid=`[+id+]` &field=`yturl`]]`:uri+]` &width=`300` &height=`175`!]
http://wiki.modxcms.com/index.php/PHx/CustomModifiers
...How do I resolve the problem so that all the user has to do is include a direct link to the URL?
// phx:get_youtube <?php $url = $output; $parsed_url = parse_url($url); parse_str($parsed_url[query], $parsed_query); //print_r($parsed_query); return ($parsed_query['v']); ?>
// Only output the Youtube clip, if the tv_youtube variable is filled. // [+phx:if=`[+tv_youtube:get_youtube+]`:isnot=``:then=`[[Youtube? &id=`[+tv_youtube:get_youtube+]`]]`+]
// HTML template, based on cross-browser recommendation from SWFobject project
$html = '
<object id="'.$ytid.'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$width.'" height="'.$height.'">
<param name="movie" value="'.$yturl.'" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="'.$yturl.'" width="'.$width.'" height="'.$height.'">
<!--<![endif]-->
'.$missing.'
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
';// HTML template, based on cross-browser recommendation from SWFobject project
$html = '
<object id="'.$ytid.'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'.$width.'" height="'.$height.'">
<param name="movie" value="'.$yturl.'" />
<param name="wmode" value="transparent" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="'.$yturl.'" width="'.$width.'" height="'.$height.'">
<param name="wmode" value="transparent" />
<!--<![endif]-->
'.$missing.'
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
';[[YouTube? &url=`[+phx:input=`[[GetField? &docid=`[+id+]` &field=`video`]]`:rawurlencode+]` &width=`100%` &height=`350` &js=`0` &egm=`1`]]
$yturl ='http://www.youtube.com/v/'.$ytid.$related_val.$autoplay_val.$loop_val.$disablekb_val.$egm_val.$border_val.$color1_val.$color2_val.'&hl=en&fs=1';