/**
* youtube_video_id
* 
* Pega a url do youtube e retorna o ID do video
* 
*
* @param	$string
* @return	$string
*/
function youtube_video_id($url)
{
    if (is_youtube($url)) {
        $pattern = '/^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/';
        preg_match($pattern, $url, $matches);
        if (count($matches) && strlen($matches[7]) == 11) {
            return $matches[7];
        }
    }
    return '';
}
Example #2
0
 } elseif (nv_is_url($rowcontent['homeimgfile'])) {
     $rowcontent['homeimgthumb'] = 3;
 } else {
     $rowcontent['homeimgfile'] = '';
 }
 // Xu ly Video link
 $rowcontent['vid_type'] = 0;
 if (!nv_is_url($rowcontent['vid_path']) and is_file(NV_DOCUMENT_ROOT . $rowcontent['vid_path'])) {
     $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/vid/');
     $rowcontent['vid_path'] = substr($rowcontent['vid_path'], $lu);
     if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/vid/' . $rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 1;
         //is uploaded file
     }
 } elseif (nv_is_url($rowcontent['vid_path'])) {
     if (is_youtube($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 2;
         //is Youtube
     } elseif (is_picasa($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 3;
         //is Picasa
     } elseif (is_facebook($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 4;
         //is Facebook
     } else {
         $rowcontent['vid_type'] = 5;
         //hotlink from other site
     }
 } else {
     $rowcontent['vid_path'] = '';
 }
Example #3
0
$showcomments = $smof_data['blog_show_comments'];
?>
        
        <?php 
if (!is_search()) {
    ?>
			<?php 
    $prefix = 'indonez_';
    $video = get_post_meta($post->ID, $prefix . 'video_embed', true);
    ?>
            <?php 
    if ($video) {
        ?>
                <div class="blog-media">
                    <?php 
        if (is_youtube($video)) {
            echo '<div class="video-container-post"><a href="' . $video . '"  rel="youtube"></a></div>';
        } elseif (is_vimeo($video)) {
            echo '<div class="video-container-post"><a href="' . $video . '"  rel="vimeo"></a></div>';
        } elseif (is_quicktime($video)) {
            echo '<div class="video-container-post"><a href="' . $video . '"  rel="quicktime"></a></div>';
        } elseif (is_flash($video)) {
            echo '<div class="video-container-post"><a href="' . $video . '"  rel="flash"></a></div>';
        }
        ?>
                </div>
            <?php 
    }
    ?>
        <?php 
}
 function youtube_dir_url($url, $read = false, $err_msg = false)
 {
     $dl = $this->got_youtubedl();
     if ($dl) {
         if (is_youtube($url)) {
             $cmd = 'youtube-dl -g ' . $url;
             $data = shell_exec($cmd);
             if ($read) {
                 $this->pr($data);
             }
             return $data;
         }
     }
 }
                    ?>
&amp;h=345&amp;w=590&amp;zc=1"  alt="" />
              <?php 
                }
                ?>
            <?php 
            }
            ?>
          </div>
        <?php 
        } else {
            if ($pf_link) {
                ?>
        <div class="pf-video-wrapper">
        <?php 
                if (is_youtube($pf_link)) {
                    ?>
            <div class="portfolio_movie_container"><a href="<?php 
                    echo $pf_link;
                    ?>
"  rel="youtube"></a></div>
          <?php 
                } else {
                    if (is_vimeo($pf_link)) {
                        ?>
            <div class="portfolio_movie_container"><a href="<?php 
                        echo $pf_link;
                        ?>
"  rel="vimeo"></a></div>    
          <?php 
                    } else {
Example #6
0
function func_blog_post_col_indonez($showpost = "", $cat_id = "")
{
    global $post;
    $out = '';
    $out .= '<div class="masorny_col">';
    query_posts('cat=' . $cat_id . '&posts_per_page=' . $showpost . '&orderby=date&order=DESC');
    while (have_posts()) {
        the_post();
        $out .= '<div class="four column mobile-two">';
        $out .= '<div class="teaser">';
        $out .= '<div class="teaser-preview-box">';
        if (has_post_format('gallery')) {
            $args = array('order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'orderby' => 'menu_order', 'numberposts' => -1);
            $attachments = get_posts($args);
            $out .= '<div class="banner_blog_container">';
            $out .= '<div class="banner-blog">';
            $out .= '<ul>';
            foreach ($attachments as $attachment) {
                $image_attributes = wp_get_attachment_image_src($attachment->ID, 'custom-medium-image');
                $out .= '<li data-transition="slidehorizontal"><img src="' . $image_attributes[0] . '"></li>';
            }
            $out .= '</ul>';
            $out .= '<div class="tp-bannertimer tp-top"></div>';
            $out .= '</div>';
            $out .= '</div>';
        } elseif (has_post_format('audio')) {
            $prefix = 'indonez_';
            $audio = get_post_meta($post->ID, $prefix . 'audio_embed', true);
            if ($audio) {
                $out .= '<audio preload="auto" controls>';
                $out .= '<source src="' . $audio . '">';
                $out .= '</audio>';
            }
        } elseif (has_post_format('video')) {
            $prefix = 'indonez_';
            $video = get_post_meta($post->ID, $prefix . 'video_embed', true);
            if ($video) {
                if (is_youtube($video)) {
                    $out .= '<div class="video-container-post"><a href="' . $video . '"  rel="youtube"></a></div>';
                } elseif (is_vimeo($video)) {
                    $out .= '<div class="video-container-post"><a href="' . $video . '"  rel="vimeo"></a></div>';
                } elseif (is_quicktime($video)) {
                    $out .= '<div class="video-container-post"><a href="' . $video . '"  rel="quicktime"></a></div>';
                } elseif (is_flash($video)) {
                    $out .= '<div class="video-container-post"><a href="' . $video . '"  rel="flash"></a></div>';
                } else {
                }
            }
        } elseif (has_post_format('quote')) {
            $prefix = 'indonez_';
            $quote_text = get_post_meta($post->ID, $prefix . 'quote_text', true);
            $quote_info_text = get_post_meta($post->ID, $prefix . 'quote_info_text', true);
            $out .= '<div class="note">';
            $out .= '<blockquote><p>' . stripslashes($quote_text) . '</p><cite>' . $quote_info_text . '</cite></blockquote>';
            $out .= '<div class="clear"></div>';
            $out .= '</div>';
        } elseif (has_post_format('link')) {
            $prefix = 'indonez_';
            $link = get_post_meta($post->ID, $prefix . 'link_embed', true);
            if ($link) {
                $out .= '<div class="note">';
                $out .= '<p class="lead">';
                $out .= '<a href="' . $link . '" title="' . $link . '" target="_blank">' . $link . '</a>';
                $out .= '</p>';
                $out .= '</div>';
            }
        } else {
            if (has_post_thumbnail()) {
                $out .= get_the_post_thumbnail('custom-medium-image', array('class' => 'max-image'));
            }
        }
        $out .= '</div>';
        //end teaser-preview-box
        $out .= '<h6><a href="' . get_permalink() . '">' . get_the_title() . '</a></h6>';
        $out .= '<h6 class="subheader">' . get_the_time('M d, Y', $post->ID) . '</h6>';
        if (!has_post_format('quote')) {
            $excerpt = get_the_excerpt();
            $out .= '<p>' . indonez_excerpt_limit_char($excerpt, 50, '...') . '</p>';
        }
        $out .= '<a href="' . get_permalink() . '" class="more-link"><span class="button small rdm">' . __('Read More', 'indonez') . '</span></a>';
        $out .= '</div>';
        $out .= '</div>';
    }
    wp_reset_query();
    $out .= '</div>';
    return $out;
}
Example #7
0
<?php

/**
 * @Project VIDEOS 4.x
 * @Author KENNYNGUYEN (nguyentiendat713@gmail.com)
 * @Website tradacongnghe.com
 * @License GNU/GPL version 2 or any later version
 * @Createdate Oct 08, 2015 10:47:41 AM
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$path = $nv_Request->get_string('vid_path', 'post', '');
$mod = $nv_Request->get_string('mod', 'post', '');
$path = urldecode($path);
if (!empty($path) and is_youtube($path)) {
    $_vid_duration = youtubeVideoDuration($path);
    $duration = sec2hms($_vid_duration);
} else {
    $duration = '';
}
include NV_ROOTDIR . '/includes/header.php';
echo $duration;
include NV_ROOTDIR . '/includes/footer.php';