예제 #1
0
function haku_get_video_id($url, $id = '')
{
    if (haku_get_url_type($url) == 'youtube') {
        $url = parse_str(parse_url($url, PHP_URL_QUERY));
        $id = $v;
    } else {
        if (haku_get_url_type($url) == 'vimeo') {
            preg_match('/vimeo\\.com\\/([0-9]{1,10})/', $url, $id);
            $id = $id[1];
        }
    }
    return $id;
}
?>
</span>
			
		</div>
		<!-- end: Input column -->
		
		<!-- Local usage -->
		<?php 
$url = $mb->get_the_value();
?>

	</div>
	<!-- end: Input text metabox -->
	
	<?php 
if ($url && haku_get_url_type($url) == 'page') {
    ?>
	
	<!-- Checkbox metabox -->
	<div class="haku_metabox_group">
		
		<!-- Info column -->
		<div class="aside">

			<label><?php 
    _e('Open In New Tab', 'haku');
    ?>
</label>

		</div>
		<!-- end: Info column -->
echo retro_filter(get_the_time('M'));
?>
</label>
			
			<?php 
the_content();
?>
				
		</li>
		
	</ul>

	<div class="clr"></div>
	
	<?php 
if (haku_get_url_type($media) == 'audio') {
    ?>
	
	<?php 
    // Javascript
    global $retro_enqueue_audio_js;
    $retro_enqueue_audio_js = true;
    ?>
	
	<!-- Audio player -->
	<div class="ajs-retro">
		<audio src="<?php 
    echo esc_url($media);
    ?>
" preload="none" controls />
	</div>
예제 #4
0
<?php

/*******************************/
/*   Post format: Standard     */
$href = meta_obtain('url', '_retro_format_standard', $post->ID);
$href = $href ? $href : get_thumb_src($post->ID, 'full');
$new_tab = meta_obtain('new_tab', '_retro_format_standard', $post->ID);
$span_class = 'icon_camera';
if (haku_get_url_type($href) == 'youtube' || haku_get_url_type($href) == 'vimeo') {
    $span_class = 'icon_video';
} elseif (haku_get_url_type($href) != 'image') {
    $span_class = 'icon_link';
}
?>

<div class="blog_section_pic">
	
	<a href="<?php 
echo esc_url($href);
?>
" title="<?php 
echo esc_attr(get_the_title());
?>
" <?php 
if ($new_tab) {
    echo 'target="_blank"';
}
?>
>
	
		<?php 
예제 #5
0
    function widget($args, $instance)
    {
        extract($args);
        $title = $instance['title'];
        $url = $instance['url'];
        $size = esc_attr($instance['size']);
        $size = explode('x', $size);
        /*
        	Before widget
        */
        echo $before_widget;
        if ($title) {
            echo $before_title . retro_filter($title) . $after_title;
        }
        if ($url) {
            ?>
		
		<!-- Video -->
		<div class="video">
			
			<!-- Video container -->
			<figure>
			
				<?php 
            if (haku_get_url_type($url) == 'youtube') {
                $id = haku_get_video_id($url);
                ?>
				
				<!-- Youtube Video -->
				<iframe type="text/html" width="<?php 
                echo $size[0];
                ?>
" height="<?php 
                echo $size[1];
                ?>
" src="http://www.youtube.com/embed/<?php 
                echo $id;
                ?>
?wmode=transparent" frameborder="0" allowfullscreen></iframe>
			
				<?php 
            } elseif (haku_get_url_type($url) == 'vimeo') {
                $id = haku_get_video_id($url);
                ?>
				
				<!-- Vimeo Video -->
				<iframe src="http://player.vimeo.com/video/<?php 
                echo $id;
                ?>
?title=0&amp;byline=0&amp;portrait=0" width="<?php 
                echo $size[0];
                ?>
" height="<?php 
                echo $size[1];
                ?>
" frameborder="0"></iframe>
				<?php 
            }
            ?>
			
			</figure>
			<!-- end: Video container -->
			
		</div>
		<!-- end: Video -->
		
		<?php 
        }
        /*
        	After widget
        */
        echo $after_widget;
    }
<?php

/******************/
/*   Item count   */
global $count;
/**************************/
/*   Getting item metas   */
$meta = get_post_meta($post->ID, '_retro_format_standard', true);
/***********************/
/*   Item attributes   */
$item = array('filter' => haku_nice_classes(get_the_terms('portfolio', 'portfolio_filter')), 'meta' => esc_url(meta_get('url', $meta)), 'href' => esc_url(meta_get('url', $meta, get_thumb_src($post->ID, 'full'))), 'new_tab' => meta_get('new_tab', $meta), 'span_class' => 'icon_camera', 'class' => array('item_li'), 'is_quote' => get_post_format() == 'quote' ? true : false, 'is_audio' => get_post_format() == 'audio' ? true : false);
/***********************/
/*   Item span class   */
if (haku_get_url_type($item['href']) == 'youtube' || haku_get_url_type($item['href']) == 'vimeo') {
    $item['span_class'] = 'icon_video';
} elseif (haku_get_url_type($item['href']) != 'image') {
    $item['span_class'] = 'icon_link';
}
if ($item['is_quote']) {
    $item['href'] = '#' . sanitize_title(get_the_title());
    $item['span_class'] = 'icon_text';
}
if ($item['is_audio']) {
    $item['href'] = '#' . sanitize_title(get_the_title());
    $item['span_class'] = 'icon_audio';
    // Javascript
    global $retro_enqueue_audio_js;
    $retro_enqueue_audio_js = true;
}
/******************/
/*   Item class   */