コード例 #1
0
ファイル: template.php プロジェクト: saulelis/sca_responsive
function sca_responsive_vimeo_video_id($url)
{
    if (sca_responsive_is_vimeo($url)) {
        $pattern = '/\\/\\/(www\\.)?vimeo.com\\/(\\d+)($|\\/)/';
        preg_match($pattern, $url, $matches);
        if (count($matches)) {
            return $matches[2];
        }
    }
    return '';
}
 * The above will guarantee that you'll always get the correct data,
 * regardless of any changes in the aliasing that might happen if
 * the view is modified.
 */
//YOUTUBE AND VIMEO FUNCTIONS
//dpm($row);
$href = "";
$title = $row->field_title_field[0]['rendered']['#markup'];
$description = $row->field_field_description[0]['rendered']['#markup'];
$url = $row->field_field_video_url[0]['rendered']['#element']['url'];
$attachment = render($row->field_field_attachment[0]['rendered']);
$id = "video-" . $row->nid;
if (sca_responsive_is_youtube($url)) {
    $href = "http://www.youtube.com/embed/" . sca_responsive_youtube_video_id($url);
}
if (sca_responsive_is_vimeo($url)) {
    $href = "http://player.vimeo.com/video/" . sca_responsive_vimeo_video_id($url) . "?width=800&height=600&iframe=true";
}
?>

<a class="colorbox-inline" 
   href="<?php 
echo "?width=800&amp;height=650&amp;inline=true#" . $id;
?>
" 
   rel="group1" 
   
   alt="<?php 
echo $title;
?>
">