Exemplo n.º 1
0
function axiom_sc_video($atts, $content = null)
{
    if (axiom_sc_in_shortcode_blogger()) {
        return '';
    }
    extract(axiom_sc_html_decode(shortcode_atts(array("url" => '', "src" => '', "image" => '', "ratio" => '16:9', "autoplay" => 'off', "align" => '', "bg_image" => '', "bg_top" => '', "bg_bottom" => '', "bg_left" => '', "bg_right" => '', "frame" => "on", "id" => "", "class" => "", "animation" => "", "css" => "", "width" => '', "height" => '', "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts)));
    $ratio = empty($ratio) ? "16:9" : str_replace(array('/', '\\', '-'), ':', $ratio);
    $ratio_parts = explode(':', $ratio);
    if (empty($height) && empty($width)) {
        $width = '100%';
    }
    $ed = axiom_substr($width, -1);
    if (empty($height) && !empty($width) && $ed != '%') {
        $height = round($width / $ratio_parts[0] * $ratio_parts[1]);
    }
    if (!empty($height) && empty($width)) {
        $width = round($height * $ratio_parts[0] / $ratio_parts[1]);
    }
    $css .= axiom_get_css_position_from_values($top, $right, $bottom, $left);
    $css_dim = axiom_get_css_position_from_values('', '', '', '', $width, $height);
    $css_bg = axiom_get_css_paddings_from_values($bg_top, $bg_right, $bg_bottom, $bg_left);
    if ($src == '' && $url == '' && isset($atts[0])) {
        $src = $atts[0];
    }
    $url = $src != '' ? $src : $url;
    if ($image != '' && axiom_sc_param_is_off($image)) {
        $image = '';
    } else {
        if (axiom_sc_param_is_on($autoplay) && is_single()) {
            $image = '';
        } else {
            if ($image > 0) {
                $attach = wp_get_attachment_image_src($image, 'full');
                if (isset($attach[0]) && $attach[0] != '') {
                    $image = $attach[0];
                }
            }
            if ($bg_image) {
                $thumb_sizes = axiom_get_thumb_sizes(array('layout' => 'grid_3'));
                $image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $thumb_sizes['w'], $thumb_sizes['h'], null, false, false, false);
            } else {
                $image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $ed != '%' ? $width : null, $height);
            }
            if (empty($image)) {
                $image = axiom_get_video_cover_image($url);
            }
        }
    }
    if ($bg_image > 0) {
        $attach = wp_get_attachment_image_src($bg_image, 'full');
        if (isset($attach[0]) && $attach[0] != '') {
            $bg_image = $attach[0];
        }
    }
    if ($bg_image) {
        $css_bg .= $css . 'background-image: url(' . esc_url($bg_image) . ');';
        $css = $css_dim;
    } else {
        $css .= $css_dim;
    }
    $url = axiom_get_video_player_url($src != '' ? $src : $url);
    $video = '<video' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_video' . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . ' src="' . esc_url($url) . '"' . ' width="' . esc_attr($width) . '" height="' . esc_attr($height) . '"' . ' data-width="' . esc_attr($width) . '" data-height="' . esc_attr($height) . '"' . ' data-ratio="' . esc_attr($ratio) . '"' . ($image ? ' poster="' . esc_attr($image) . '" data-image="' . esc_attr($image) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($align && $align != 'none' ? ' data-align="' . esc_attr($align) . '"' : '') . ($bg_image ? ' data-bg-image="' . esc_attr($bg_image) . '"' : '') . ($css_bg != '' ? ' data-style="' . esc_attr($css_bg) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . ($image && axiom_get_theme_option('substitute_video') == 'yes' || axiom_sc_param_is_on($autoplay) && is_single() ? ' autoplay="autoplay"' : '') . ' controls="controls" loop="loop"' . '>' . '</video>';
    if (axiom_get_custom_option('substitute_video') == 'no') {
        if (axiom_sc_param_is_on($frame)) {
            $video = axiom_get_video_frame($video, $image, $css, $css_bg);
        }
    } else {
        if (isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true' && (isset($_POST['action']) && $_POST['action'] == 'vc_load_shortcode')) {
            $video = axiom_substitute_video($video, $width, $height, false);
        }
    }
    if (axiom_get_theme_option('use_mediaelement') == 'yes') {
        axiom_enqueue_script('wp-mediaelement');
    }
    return apply_filters('axiom_shortcode_output', $video, 'trx_video', $atts, $content);
}
Exemplo n.º 2
0
Arquivo: news.php Projeto: pcuervo/odc
    function axiom_template_news_output($post_options, $post_data)
    {
        if (axiom_sc_param_is_on($post_options['scroll'])) {
            axiom_enqueue_slider();
        }
        require axiom_get_file_dir('templates/parts/reviews-summary.php');
        $title_tag = $post_options['columns_count'] > 0 ? 'h6' : 'h4';
        $title = '<' . esc_attr($title_tag) . ' class="post_title sc_title sc_blogger_title">' . (!isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . $post_data['post_title'] . (!isset($post_options['links']) || $post_options['links'] ? '</a>' : '') . '</' . esc_attr($title_tag) . '>' . $reviews_summary;
        if (axiom_sc_param_is_on($post_options['scroll']) || $post_options['dir'] == 'horizontal' && $post_options['columns_count'] > 0) {
            ?>
			<div class="<?php 
            echo 'column-1_' . esc_attr($post_options['columns_count']) . ' column_item_' . esc_attr($post_options['number']);
            echo ($post_options['number'] % 2 == 1 ? ' odd' : ' even') . ($post_options['number'] == 1 ? ' first' : '') . ($post_options['number'] == $post_options['posts_on_page'] ? ' last' : '');
            //. (axiom_sc_param_is_on($post_options['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
            ?>
">
			<?php 
        }
        ?>
		
		<div class="post_item post_item_news sc_blogger_item<?php 
        echo $post_options['number'] == $post_options['posts_on_page'] && !axiom_sc_param_is_on($post_options['loadmore']) ? ' sc_blogger_item_last' : '';
        //. (axiom_sc_param_is_on($post_options['scroll']) && $post_options['dir'] == 'vertical' ? ' sc_scroll_slide swiper-slide' : '');
        ?>
">
			<?php 
        if ($post_data['post_video'] || $post_data['post_audio'] || $post_data['post_thumb'] || $post_data['post_gallery']) {
            ?>
				<div class="post_featured">
					<?php 
            require axiom_get_file_dir('templates/parts/post-featured.php');
            ?>
				</div>
				<?php 
        }
        echo $title;
        ?>
			
			<div class="post_content sc_blogger_content">
				<?php 
        if (axiom_sc_param_is_on($post_options['info'])) {
            $info_parts = array('author' => false);
            require axiom_get_file_dir('templates/parts/post-info.php');
        }
        if ($post_options['descr'] > 0) {
            ?>
					<div class="post_descr">
					<?php 
            if ($post_data['post_protected']) {
                echo $post_data['post_excerpt'];
            } else {
                if ($post_data['post_excerpt']) {
                    echo in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status')) ? $post_data['post_excerpt'] : '<p>' . trim(axiom_strshort($post_data['post_excerpt'], isset($post_options['descr']) ? $post_options['descr'] : axiom_get_custom_option('post_excerpt_maxlength_masonry'))) . '</p>';
                }
                if (empty($post_options['readmore'])) {
                    $post_options['readmore'] = __('READ MORE', 'axiom');
                }
                if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
                    echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
                }
            }
            ?>
					</div>
					<?php 
        }
        if (empty($post_options['readmore'])) {
            $post_options['readmore'] = __('READ MORE', 'axiom');
        }
        if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
            echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
        }
        ?>

			</div>	<!-- /.post_content -->

		</div>		<!-- /.post_item -->
		<?php 
        if (axiom_sc_param_is_on($post_options['scroll']) || $post_options['dir'] == 'horizontal' && $post_options['columns_count'] > 0) {
            ?>
			</div>	<!-- /.column-1_x -->
			<?php 
        }
    }
Exemplo n.º 3
0
    function axiom_template_accordion_output($post_options, $post_data)
    {
        ?>
		<div class="post_item sc_blogger_item sc_accordion_item<?php 
        echo $post_options['number'] == $post_options['posts_on_page'] && !axiom_sc_param_is_on($post_options['loadmore']) ? ' sc_blogger_item_last' : '';
        ?>
">
			
			<h5 class="post_title sc_title sc_blogger_title sc_accordion_title"><span class="sc_accordion_icon sc_accordion_icon_closed icon-plus-1"></span><span class="sc_accordion_icon sc_accordion_icon_opened icon-minus-1"></span><?php 
        echo $post_data['post_title'];
        ?>
</h5>
			
			<div class="post_content sc_accordion_content">
				<?php 
        if (axiom_sc_param_is_on($post_options['info'])) {
            ?>
					<div class="post_info">
						<span class="post_info_item post_info_posted_by"><?php 
            _e('Posted by', 'axiom');
            ?>
 <a href="<?php 
            echo esc_url($post_data['post_author_url']);
            ?>
" class="post_info_author"><?php 
            echo esc_html($post_data['post_author']);
            ?>
</a></span>
						<span class="post_info_item post_info_counters">
							<?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? __('Comments', 'axiom') : __('Views', 'axiom');
            ?>
							<span class="post_info_counters_number"><?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? $post_data['post_comments'] : $post_data['post_views'];
            ?>
</span>
						</span>
					</div>
					<?php 
        }
        if ($post_options['descr'] >= 0) {
            ?>
					<div class="post_descr">
					<?php 
            if (!in_array($post_data['post_format'], array('quote', 'link', 'chat')) && $post_options['descr'] > 0 && axiom_strlen($post_data['post_excerpt']) > $post_options['descr']) {
                $post_data['post_excerpt'] = axiom_strshort($post_data['post_excerpt'], $post_options['descr'], $post_options['readmore'] ? '' : '...');
            }
            echo $post_data['post_excerpt'];
            ?>
					</div>
					<?php 
        }
        if (empty($post_options['readmore'])) {
            $post_options['readmore'] = __('READ MORE', 'axiom');
        }
        if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
            echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
        }
        ?>
			
			</div>	<!-- /.post_content -->

		</div>		<!-- /.post_item -->

		<?php 
    }
Exemplo n.º 4
0
Arquivo: date.php Projeto: pcuervo/odc
    function axiom_template_date_output($post_options, $post_data)
    {
        if (axiom_sc_param_is_on($post_options['scroll'])) {
            axiom_enqueue_slider();
        }
        require axiom_get_file_dir('templates/parts/reviews-summary.php');
        ?>
		
		<div class="post_item sc_blogger_item
			<?php 
        echo $post_options['number'] == $post_options['posts_on_page'] && !axiom_sc_param_is_on($post_options['loadmore']) ? ' sc_blogger_item_last' : '';
        //. (axiom_sc_param_is_on($post_options['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
        ?>
"
			<?php 
        echo $post_options['dir'] == 'horizontal' ? ' style="width:' . 100 / $post_options['posts_on_page'] . '%"' : '';
        ?>
>
			<div class="sc_blogger_date">
				<span class="day_month"><?php 
        echo $post_data['post_date_part1'];
        ?>
</span>
				<span class="year"><?php 
        echo $post_data['post_date_part2'];
        ?>
</span>
			</div>

			<div class="post_content">
				<h5 class="post_title sc_title sc_blogger_title">
					<?php 
        echo !isset($post_options['links']) || $post_options['links'] ? '<a href="' . esc_url($post_data['post_link']) . '">' : '';
        ?>
					<?php 
        echo $post_data['post_title'];
        ?>
					<?php 
        echo !isset($post_options['links']) || $post_options['links'] ? '</a>' : '';
        ?>
				</h5>
				
				<?php 
        echo $reviews_summary;
        ?>
	
				<?php 
        if (axiom_sc_param_is_on($post_options['info'])) {
            ?>
				<div class="post_info">
					<span class="post_info_item post_info_posted_by"><?php 
            _e('by', 'axiom');
            ?>
 <a href="<?php 
            echo esc_url($post_data['post_author_url']);
            ?>
" class="post_info_author"><?php 
            echo esc_html($post_data['post_author']);
            ?>
</a></span>
					<span class="post_info_item post_info_counters">
						<?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? __('Comments', 'axiom') : __('Views', 'axiom');
            ?>
						<span class="post_info_counters_number"><?php 
            echo $post_options['orderby'] == 'comments' || $post_options['counters'] == 'comments' ? $post_data['post_comments'] : $post_data['post_views'];
            ?>
</span>
					</span>
				</div>
				<?php 
        }
        ?>

			</div>	<!-- /.post_content -->
		
		</div>		<!-- /.post_item -->

		<?php 
        if ($post_options['number'] == $post_options['posts_on_page'] && axiom_sc_param_is_on($post_options['loadmore'])) {
            ?>
			<div class="load_more<?php 
            //echo esc_attr(axiom_sc_param_is_on($post_options['scroll']) && $post_options['dir'] == 'vertical' ? ' sc_scroll_slide swiper-slide' : '');
            ?>
"<?php 
            echo $post_options['dir'] == 'horizontal' ? ' style="width:' . 100 / $post_options['posts_on_page'] . '%"' : '';
            ?>
></div>
		<?php 
        }
    }
Exemplo n.º 5
0
 function axiom_woocommerce_output_related_products_args($args)
 {
     $ppp = $ccc = 0;
     if (axiom_sc_param_is_on(axiom_get_custom_option('show_post_related'))) {
         $ccc_add = in_array(axiom_get_custom_option('body_style'), array('fullwide', 'fullscreen')) ? 1 : 0;
         $ccc = axiom_get_custom_option('post_related_columns');
         $ccc = $ccc > 0 ? $ccc : (axiom_sc_param_is_off(axiom_get_custom_option('show_sidebar_main')) ? 3 + $ccc_add : 2 + $ccc_add);
         $ppp = axiom_get_custom_option('post_related_count');
         $ppp = $ppp > 0 ? $ppp : $ccc;
     }
     $args['posts_per_page'] = $ppp;
     $args['columns'] = $ccc;
     return $args;
 }