示例#1
0
 function estetico_get_video_url($box_id, $prop_id)
 {
     $url = '';
     if (!empty($_POST[USE_PREFIX . 'video'])) {
         $url = $_POST[USE_PREFIX . 'video'];
     }
     $thumb_default = video_image($url);
     update_post_meta($prop_id, USE_PREFIX . 'video_thumb_url', $thumb_default);
 }
示例#2
0
    function shortcode_video_preview($atts, $content = null, $shortcodename = '')
    {
        extract(shortcode_atts(array('title' => '', 'post_url' => '', 'date' => '', 'author' => '', 'lightbox' => 'no', 'custom_class' => ''), $atts));
        $output_title = '';
        $output_author = '';
        $output_date = '';
        $post_ID = url_to_postid($post_url);
        $get_post = get_post($post_ID);
        $get_user = get_userdata($get_post->post_author);
        $user_url = get_bloginfo('url') . '/author/' . $get_user->user_nicename;
        $video_embed_meta = get_post_meta($post_ID, 'tz_video_embed', true);
        if (empty($video_embed_meta)) {
            return '';
        }
        $video_url = parser_video_url($video_embed_meta);
        $video_url_popup = str_replace('src=', '', $video_url);
        $rand = rand();
        if (strpos($video_url, 'youtube') !== false) {
            $video_url_popup = str_replace('embed/', 'watch?v=', $video_url_popup);
        }
        $get_image_url = video_image($video_url);
        $img = '';
        if ($title == "yes") {
            $output_title = '<h4><a href="' . $post_url . '" title="' . $get_post->post_title . '">' . $get_post->post_title . '</a></h4>';
        }
        if ($author == "yes") {
            $output_author = '<span class="post_author">Posts by <a href="' . $user_url . '" title="Posts by ' . $get_user->user_nicename . '"  rel="author">' . $get_user->user_nicename . '</a></span>';
        }
        if ($date == "yes") {
            $output_date = '<span class="post_date"><time datetime="' . $get_post->post_date . '"> ' . get_the_date() . '</time></span>';
        }
        if ($get_image_url != false && $get_image_url != '') {
            if ($lightbox == 'yes') {
                $img = ' <script type="text/javascript">
					jQuery(document).ready(function() {
						jQuery(\'.popup-video-' . $rand . '\').magnificPopup({
							type: \'iframe\',
							mainClass: \'mfp-fade\',
							removalDelay: 160,
							preloader: false,
							fixedContentPos: false
						});
					});
				</script>';
                $img .= '<a class="popup-video-' . $rand . '" href="' . $video_url_popup . '" title="' . $get_image_url . '"><img src="' . $get_image_url . '" alt=""><span class="icon-play-circle hover"></span></a>';
            } else {
                $img = '<a class="preview_image"  href="' . $post_url . '" title="' . $get_image_url . '"><img src="' . $get_image_url . '" alt=""><span class="icon-play-circle hover"></span></a>';
            }
        }
        $output = '<figure class="featured-thumbnail thumbnail video_preview clearfix' . $custom_class . '"><div>' . $img . '<figcaption>' . $output_title . $output_author . $output_date . '</figcaption></div></figure>';
        $output = apply_filters('cherry_plugin_shortcode_output', $output, $atts, $shortcodename);
        return $output;
    }
示例#3
0
	function get_thumb(){
		global $post;
		// glowne zdjecie
		$thumb = get_field('zdjecie');
		if (!empty($thumb))
			return $thumb;
		
		//"okladka" galerii zdjec
		$thumb = '';
		while(the_repeater_field('zdjecia')){
			if (!empty($thumb)){continue;};
			$thumb = get_sub_field('zdjecie_galerii');
		}
		if (!empty($thumb))
			return $thumb;
			
			
		//"okladka" galerii VIDEO
		$video = '';
		while(the_repeater_field('linki_do_filmow')){
			if (!empty($video)){ continue; };
			$video = get_sub_field('link');
		}
		$thumb = video_image($video);		
		if (!empty($thumb))
			return $thumb;
		//powinno sie dodac jeszcze wyciaganie pierwszego zdjecia z contentu :)
		//brak zdjecia - domysle teatr baza
		return get_bloginfo('template_directory')."/images/null.gif";	
	}
 function shortcode_video_preview($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => '', 'post_url' => '', 'date' => '', 'author' => '', 'custom_class' => ''), $atts));
     $output_title = '';
     $output_author = '';
     $output_date = '';
     $post_ID = url_to_postid($post_url);
     $get_post = get_post($post_ID);
     $get_user = get_userdata($get_post->post_author);
     $user_url = get_bloginfo('url') . '/author/' . $get_user->user_nicename;
     $video_url = parser_video_url(get_post_meta($post_ID, 'tz_video_embed', true));
     $get_image_url = video_image($video_url);
     $img = '';
     if ($title == "yes") {
         $output_title = '<h4><a href="' . $post_url . '" title="' . $get_post->post_title . '">' . $get_post->post_title . '</a></h4>';
     }
     if ($author == "yes") {
         $output_author = '<span class="post_author">Posts by <a href="' . $user_url . '" title="Posts by ' . $get_user->user_nicename . '"  rel="author">' . $get_user->user_nicename . '</a></span>';
     }
     if ($date == "yes") {
         $output_date = '<span class="post_date"><time datetime="' . $get_post->post_date . '"> ' . get_the_date() . '</time></span>';
     }
     if ($get_image_url != false && $get_image_url != '') {
         $img = '<a class="preview_image"  href="' . $post_url . '" title="' . $get_image_url . '"><img src="' . $get_image_url . '" alt=""><span class="icon-play-circle hover"></span></a>';
     }
     $output = '<figure class="featured-thumbnail thumbnail video_preview clearfix' . $custom_class . '"><div>' . $img . '<figcaption>' . $output_title . $output_author . $output_date . '</figcaption></div></figure>';
     return $output;
 }
示例#5
0
        $counter_print_pair++;
    }
    /* add w2 only even blocks */
    if ($counter_print_pair % 2 == 1) {
        $size_block = 'item-w2 item-sm-w2';
        $image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'horizontal');
    } else {
        $size_block = 'item-w1 item-sm-w2 item-sm-h2';
        $image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'quad');
    }
    /* Video Image */
    $video = get_post_meta($post->ID, 'fb_video', true);
    if (has_post_thumbnail()) {
        $image_url_item = $image_url[0];
    } elseif ($video != '') {
        $image_url_item = video_image($video, 'hd');
    }
    ?>


			<div class="mos-item block-<?php 
    echo $post->ID;
    ?>
 <?php 
    echo $size_block;
    ?>
">
				
				

				<div class="bg-img animate" style="background-image: url(<?php 
示例#6
0
                                        <?php
                                        break;
                                    //videos
                                    case '2':
                                        //if internet is on
                                        if (check_internet_connection()) {

                                            ?>


                                            <a href="<?= video_image($row['fileurl']) ?>"
                                               class="fancybox"
                                               title="<?= $row['description'] ?>">
                                                <img width="32px" height="32px"
                                                     class="img-circle "
                                                     src="<?= video_image($row['fileurl']) ?>">
                                            </a>
                                        <?php

                                        } else {
                                            ?>
                                            <a target="_blank"
                                               href="<?= $row['fileurl'] ?>">See
                                                video</a>
                                        <?php
                                        }

                                        break;
                                    //others
                                    case '3':
                                        ?>
function post_thumbnail_html($html, $post_id, $post_image_id)
{
    $video = get_post_meta($post_id, 'fb_video', true);
    if ($html) {
        /* If have thumbnail image set */
        if ($video != '') {
            if (is_single()) {
                /* Show playe on single page */
                if (function_exists('video_player')) {
                    ?>
	
						<div class='video-container'><?php 
                    echo video_player($video, 0);
                    ?>
</div>
						
					<?php 
                }
            } else {
                echo '<i class="fa fa-play-circle fa-4x"></i>' . $html;
            }
        } else {
            echo $html;
        }
    } else {
        /* If haven't thumbnail image set */
        if ($video != '') {
            if (is_single()) {
                /* Show playe on single page */
                if (function_exists('video_player')) {
                    ?>
	
						<div class='video-container'><?php 
                    echo video_player($video, 0);
                    ?>
</div>
						
					<?php 
                }
            } else {
                echo '<i class="fa fa-play-circle fa-4x"></i><img class="img-res" src="' . video_image($video, 'hd') . '" alt="' . esc_attr(get_post_field('post_title', $post_id)) . '" />';
            }
        }
    }
}