function save_video_images($url) { $saved_image_url = ""; //find the video id $video_id = find_tube_video_id($url); //get uploads dir of WP $uploads = wp_upload_dir(); //wich service if (strpos($url, 'youtube')) { $type = 'youtube'; } if (strpos($url, 'vimeo')) { $type = 'vimeo'; } if (function_exists('file_get_contents')) { if (isset($type) && isset($video_id)) { //Youtube image if ($type == 'youtube') { $image = 'http://img.youtube.com/vi/' . $video_id . '/0.jpg'; } //Vimeo image if ($type == 'vimeo') { $hash = @unserialize($this->get_content("http://vimeo.com/api/v2/video/{$video_id}.php")); if ($hash) { $image = $hash[0]['thumbnail_large']; } } if ($image) { $save_as = $uploads['path'] . '/' . $video_id . '-' . $type . '.jpg'; $get_image = @$this->get_content($image); if ($get_image) { @file_put_contents($save_as, $get_image); $saved_image_url = $uploads['url'] . '/' . $video_id . '-' . $type . '.jpg'; } } } } return $saved_image_url; }
echo $slide_text; ?> </div> </div> <?php } ?> <?php } else { if (strpos($video_url, 'youtube')) { //youtube echo '<iframe width="100%" height="' . $rttheme_slider_height . '" src="http://www.youtube.com/embed/' . find_tube_video_id($video_url) . '" frameborder="0" allowfullscreen></iframe>'; } if (strpos($video_url, 'vimeo')) { //vimeo echo '<iframe src="http://player.vimeo.com/video/' . find_tube_video_id($video_url) . '?color=d6d6d6&title=0&byline=0&portrait=0" width="100%" height="' . $rttheme_slider_height . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; } } ?> </li> <?php } } wp_reset_query(); ?> </ul> </div> </div>
} $gallery_list = '[photo_gallery]' . $gallery_list . '[/photo_gallery]'; echo do_shortcode($gallery_list); } ?> <?php if ($video) { if (strpos($media_link, 'youtube')) { //youtube echo '<div class="video-container"><iframe width="100%" height="' . $video_height . '" src="http://www.youtube.com/embed/' . find_tube_video_id($media_link) . '" frameborder="0" allowfullscreen></iframe></div>'; } if (strpos($media_link, 'vimeo')) { //vimeo echo '<div class="video-container"><iframe src="http://player.vimeo.com/video/' . find_tube_video_id($media_link) . '?color=d6d6d6&title=0&byline=0&portrait=0" width="100%" height="' . $video_height . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>'; } echo '<div class="space margin-t20"></div>'; } ?> <?php } ?> <?php # # AUDIO POST FORMAT # if ($portfolio_format == "audio" && !$password_protected) { $portfolio_audio_mp3 = get_post_meta($post->ID, THEMESLUG . '_portfolio_audio_mp3', true);