예제 #1
0
 function getPostShare($arg, $post_data)
 {
     $side_bar = get_custom_option('show_sidebar_main');
     if (sc_param_is_on(get_custom_option('show_post_info', null, $post_data['post_id'])) && !is_single()) {
         $array_info = explode(',', $arg);
         $array_list = array();
         if ($side_bar != "wide") {
             $array_list['views'] = '<div class="postSpan postViews"><span class="icon icon-eye"></span><a href="' . $post_data['post_link'] . '" class="revInfo">' . $post_data['post_views'] . '</a></div>';
             $array_list['likes'] = '<div class="postSpan postLikes likeButton like" data-postid="' . $post_data['post_id'] . '" data-likes="' . $post_data['post_likes'] . '"><span class="icon icon-heart"></span><a href="" class="revInfo">' . $post_data['post_likes'] . '</a></div>';
             $array_list['more'] = $post_data['post_link'] ? '<div class="postSpan postMore"><span class="icon icon-link"></span><a href="' . $post_data['post_link'] . '"  class="revInfo">' . __('More ', 'themerex') . '</a></div>' : '';
             //review
             if ($post_data['post_reviews_author'] && sc_param_is_on(get_custom_option('show_reviews', null, $post_data['post_id']))) {
                 $avg_author = $post_data['post_reviews_' . (get_theme_option('reviews_first') == 'author' ? 'author' : 'users')];
                 $rating_max = get_custom_option('reviews_max_level');
                 $array_list['reviews'] = '<div class="postSpan postReview" title="' . sprintf(__('Rating - %s/%s', 'themerex'), $avg_author, $rating_max) . '"><span class="icon icon-star"></span><a href="' . $post_data['post_link'] . '" class="revInfo">' . getReviewsSummaryStarsSharing($avg_author, false, false) . '</a></div>';
             }
         }
         $array_list['comments'] = '<div class="postSpan postComment"><span class="icon icon-post"></span><a href="' . $post_data['post_comments_link'] . '" class="revInfo">' . $post_data['post_comments'] . ($side_bar == 'wide' ? ' comments' : '') . '</a></div>';
         $post_share = showShareButtons(array("post_id" => $post_data["post_id"], "post_link" => $post_data["post_link"], "post_title" => $post_data["post_title"], "post_descr" => strip_tags($post_data["post_excerpt"]), "post_thumb" => $post_data["post_attachment"], "style" => "drop", "echo" => false));
         if ($side_bar != "wide") {
             $array_list['share'] = '<div class="postSpan postShare share"><span class="icon icon-share"></span><a class="revInfo shareDrop" href="#">' . __('Share ', 'themerex') . '</a>' . $post_share . '</div>';
         } else {
             $array_list['share'] = '<div class="postSpan postShare share">' . $post_share . '</div>';
         }
         $post_info_html = '';
         foreach ($array_info as $array_infos) {
             foreach ($array_list as $k => $val) {
                 if ($k == $array_infos) {
                     $post_info_html .= $val;
                 }
             }
         }
         if ($post_info_html != '') {
             return '<div class="postSharing hoverUnderline">' . $post_info_html . '</div>';
         } else {
             return '';
         }
     }
 }
/* Reviews */
$review_type = get_custom_option('reviews_first');
$review_avg = $post_data['post_reviews_' . $review_type];
$review_first = get_custom_option('reviews_first');
$review_max = get_custom_option('reviews_max_level');
$review_style = get_custom_option('reviews_style');
$review_color = get_custom_option('review_color');
$review = !empty($review_avg) ? get_review_rating('5stars', $review_avg, $review_max, '#f2c574') : '';
/* /Reviews */
$format_icon = getPostFormatIcon($post_data['post_format']);
$title = '<' . $post_title_tag . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_title' : '') . '">' . '<a href="' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '#' : $post_data['post_link']) . '">' . (themerex_substr($opt['style'], 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_data['post_icon'] != '' ? ' ' . $post_data['post_icon'] : '') . '"' . ($post_data['bubble_color'] != '' ? ' style="background-color:' . $post_data['bubble_color'] . '"' : '') . '></span>' : '') . $post_data['post_title'] . '</a>' . '</' . $post_title_tag . '>';
$info = '<header class="post_info infoPost">';
$info .= $title;
$info .= '<div class="subheader">';
$info .= $review;
$info .= '<span class="icon-clock-1"></span>' . $post_data['post_date'];
$info .= '<span class="separator">|</span>
		 			<a class="icon-comment-1" title="' . sprintf(__('Comments - %s', 'themerex'), $post_data['post_comments']) . '" href="' . $post_data['post_comments_link'] . '">' . $post_data['post_comments'] . '</a>';
$info .= '</div>';
$info .= '</header>';
?>
<article class="sc_blogger_item<?php 
echo (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_item' : '') . ($opt['number'] == $opt['found'] ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '') . ($border == "true" ? ' border' : '') . ($opt['number'] == $opt['found'] ? ' last' : '');
?>
">

	<?php 
echo '<i class="icon ' . $format_icon . '"></i>';
echo $info;
?>
</article>
예제 #3
0
if ($opt['style'] == 'list') {
    echo balanceTags($title);
} else {
    if ($opt['dir'] == 'horizontal') {
        ?>
		<div class="sc_columns_item column_item_<?php 
        echo esc_attr($opt['number']);
        echo ($opt['number'] % 2 == 1 ? ' odd' : ' even') . ($opt['number'] == 1 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' last' : '') . (sc_param_is_on($opt['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
        ?>
">

		<?php 
    }
    ?>
<article class="sc_blogger_item <?php 
    echo (in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3')) ? ' sc_toggl_item' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '');
    ?>
">

	<?php 
    if ($opt['style'] == 'date') {
        ?>
		<div class="sc_blogger_date">
			<span class="day_month"><?php 
        echo date('d.m', strtotime($post_data['post_date_sql']));
        ?>
</span>
			<span class="year"><?php 
        echo date('Y', strtotime($post_data['post_date_sql']));
        ?>
</span>
예제 #4
0
    }
    if (in_array($opt['style'], array('accordion_1', 'accordion_2'))) {
        echo $info;
    }
    if ($opt['style'] != 'date') {
        ?>
		</div>
		<?php 
    }
    if (!in_array($opt['style'], array('date', 'accordion_1', 'accordion_2'))) {
        echo $info;
    }
    ?>
</article>
	<?php 
    if ($opt['style'] == 'date' && $opt['number'] == $opt['posts_on_page'] && sc_param_is_on($opt['loadmore'])) {
        ?>
		<article class="load_more<?php 
        //echo sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '';
        ?>
"
			<?php 
        echo $opt['dir'] == 'horizontal' && $opt['style'] == 'date' ? ' style="width:' . 100 / $opt['posts_on_page'] . '%"' : '';
        ?>
></article>
	<?php 
    }
    if ($opt['dir'] == 'horizontal' && $opt['style'] != 'date') {
        echo '</div>';
    }
}
예제 #5
0
function sc_video($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "class" => "", "url" => '', "src" => '', "image" => '', "title" => 'off', "ratio" => '16:9', "autoplay" => 'off', "width" => '100%', "height" => '295', "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    if ($src == '' && $url == '' && isset($atts[0])) {
        $src = $atts[0];
    }
    $ed = themerex_substr($width, -1);
    $s = getStyleString($top, $right, $bottom, $left, $width, $height != '' ? $height + (sc_param_is_on($title) ? 21 : 0) : '');
    $url = $src != '' ? $src : $url;
    if ($image != '' && sc_param_is_off($image)) {
        $image = '';
    } else {
        if (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];
                }
            }
            $image = getResizedImageURL(empty($image) ? get_the_ID() : $image, $ed != '%' ? $width : null, $height);
            if (empty($image)) {
                $image = getVideoCoverImage($url);
            }
        }
    }
    $url = getVideoPlayerURL($src != '' ? $src : $url);
    $ratio = empty($ratio) ? "16:9" : str_replace(array('/', '\\', '-'), ':', $ratio);
    $video = '<video' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_video' . (!empty($class) ? ' ' . $class : '') . '"' . ' src="' . $url . '"' . ' width="' . $width . '" height="' . $height . '"' . ' data-width="' . $width . '" data-height="' . $height . '"' . ' data-ratio="' . esc_attr($ratio) . '"' . ($image ? ' data-image="' . esc_attr($image) . '"' : '') . ' data-title="' . $title . '"' . ($s != '' ? ' style="' . $s . '"' : '') . ($image && get_theme_option('substitute_video') == 'yes' || sc_param_is_on($autoplay) && is_single() ? ' autoplay="autoplay"' : '') . ' controls="controls"' . '>' . '</video>';
    if (get_custom_option('substitute_video') == 'no') {
        $video = getVideoFrame($video, $image, sc_param_is_on($title), $s);
    }
    if (get_theme_option('use_mediaelement') == 'yes') {
        themerex_enqueue_script('wp-mediaelement');
    }
    return $video;
}
    }
    if (in_array($opt['style'], array('accordion_1', 'accordion_2'))) {
        echo $info;
    }
    if ($opt['style'] != 'date') {
        ?>
		</div>
		<?php 
    }
    if (!in_array($opt['style'], array('date', 'accordion_1', 'accordion_2'))) {
        echo $info;
    }
    ?>
</article>
	<?php 
    if ($opt['style'] == 'date' && $opt['number'] == $opt['posts_on_page'] && sc_param_is_on($opt['loadmore'])) {
        ?>
		<article class="load_more<?php 
        echo sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '';
        ?>
"
			<?php 
        echo $opt['dir'] == 'horizontal' && $opt['style'] == 'date' ? ' style="width:' . 100 / $opt['posts_on_page'] . '%"' : '';
        ?>
></article>
	<?php 
    }
    if ($opt['dir'] == 'horizontal' && $opt['style'] != 'date') {
        echo '</div>';
    }
}
예제 #7
0
function sc_video($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "url" => '', "src" => '', "image" => '', "title" => 'off', "autoplay" => 'off', "width" => '100%', "height" => '295', "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    if ($src == '' && $url == '' && isset($atts[0])) {
        $src = $atts[0];
    }
    if ($image > 0) {
        $attach = wp_get_attachment_image_src($image, 'full');
        if (isset($attach[0]) && $attach[0] != '') {
            $image = $attach[0];
        }
    }
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($width !== '' ? 'width:' . $width . 'px;' : '') . ($height !== '' ? 'height:' . $height . 'px;' : '');
    $url = getVideoPlayerURL($src != '' ? $src : $url);
    $output = '';
    $video = '<video' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_video" src="' . $url . '" width="' . $width . '" height="' . $height . '"' . ($image || sc_param_is_on($autoplay) && is_single() ? ' autoplay="autoplay"' : '') . ($s != '' ? ' style="' . $s . '"' : '') . ' controls="controls"><source type="video/mp4" src="' . $url . '"></source></video>';
    if ($image) {
        $video = substituteVideo($video, $width, $height);
        $output = getVideoFrame($video, $image, sc_param_is_on($title), $s);
    } else {
        $output = $video;
    }
    return $output;
    /*
    	return '<iframe' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_video" src="' . $url . '" width="' . $width . '" height="' . $height . '"'.($s!='' ? ' style="'.$s.'"' : '').' frameborder="0" webkitAllowFullScreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowFullScreen="allowFullScreen"></iframe>';
    */
}
예제 #8
0
        global $THEMEREX_CURRENT_SIDEBAR;
        $THEMEREX_CURRENT_SIDEBAR = 'footer';
        do_action('before_sidebar');
        if (!dynamic_sidebar(get_custom_option('sidebar_footer'))) {
            // Put here html if user no set widgets in sidebar
        }
    }
    ?>
		</div><!-- /footer.main -->
	</footer>
	<?php 
}
?>

	<?php 
$copyright = sc_param_is_on(get_custom_option('show_copyright'));
$footer_logo = get_custom_option('logo_image_footer');
if (get_custom_option('footer_show') == 'yes') {
    ?>
	<footer <?php 
    echo 'class="footer"';
    ?>
>
		<div class="main">
            <div class="logo">
                <img <?php 
    echo 'src="' . esc_url($footer_logo) . '"';
    ?>
 alt="" />
            </div>
            <?php 
예제 #9
0
function sc_banner($atts, $content = null)
{
    if (in_shortcode_blogger()) {
        return '';
    }
    extract(shortcode_atts(array("id" => "", "src" => "", "url" => "", "title" => "", "link" => "", "target" => "", "rel" => "", "popup" => "no", "align" => "", "top" => "", "bottom" => "", "left" => "", "right" => "", "width" => "", "height" => ""), $atts));
    /*scripts & styles*/
    themerex_enqueue_style('magnific-style', get_template_directory_uri() . '/js/magnific-popup/magnific-popup.css', array(), null);
    themerex_enqueue_script('magnific', get_template_directory_uri() . '/js/magnific-popup/jquery.magnific-popup.min.js', array('jquery'), null, true);
    $ed = themerex_substr($width, -1) == '%' ? '%' : 'px';
    $width = (int) str_replace('%', '', $width);
    $image = $src != '' ? $src : $url;
    $url = getAttachmentID($url);
    $image = getAttachmentID($image);
    $src = getAttachmentID($src);
    //image crop
    $no_crop = getThumbSizes(array('thumb_size' => 'image_large', 'thumb_crop' => true, 'sidebar' => false));
    $crop = array("w" => $width != '' && $ed != '%' ? $width : $no_crop['w'], "h" => $height != '' && $ed != '%' ? $height : null);
    $image = getResizedImageURL($image, $crop['w'], $crop['h']);
    $s = ($top > 0 ? 'margin-top:' . $top . 'px;' : '') . ($bottom > 0 ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left > 0 ? 'margin-left:' . $left . 'px;' : '') . ($right > 0 ? 'margin-right:' . $right . 'px;' : '') . ($width > 0 ? 'width:' . $width . $ed . ';' : '') . ($height > 0 ? 'height:' . $height . 'px;' : '');
    $c = (sc_param_is_on($popup) ? ' user-popup-link' : '') . ($align && $align != 'none' ? ' sc_float_' . $align : '');
    $content = do_shortcode($content);
    return '<a' . ($id ? ' id="sc_banner_' . $id . '"' : '') . ' href="' . ($popup == 'yes' ? '#sc_popup_' . $link : $link) . '" class="sc_banner ' . $c . '"' . (!empty($target) ? ' target="' . $target . '"' : '') . (!empty($rel) ? ' rel="' . $rel . '"' : '') . ($s != '' ? ' style="' . $s . '"' : '') . '>' . '<img src="' . $image . '" class="sc_banner_image" border="0" alt="" />' . (trim($title) ? '<span class="sc_banner_title">' . $title . '</span>' : '') . (trim($content) ? '<span class="sc_banner_content">' . $content . '</span>' : '') . '</a>';
}
        }
        ?>

			<?php 
        echo get_custom_option('show_post_icon') == 'yes' ? '<div class="postFormatIcon ' . getPostFormatIcon($post_data['post_format']) . '"></div>' : '';
        //date
        if (is_single() && ($side_bar == 'fullWidth' || $side_bar == 'wide') && $post_data['post_date'] != '') {
            ?>
				<div class="postDate"><?php 
            echo balanceTags($post_data['post_date']);
            ?>
</div>
			<?php 
        }
        //title
        echo sc_param_is_on($show_title) ? '<h1 class="postTitle">' . balanceTags($post_data['post_title']) . '</h1>' : '';
        //post info
        echo $post_info ? getPostInfo(get_theme_option('set_post_info'), $post_data) : '';
        //thumb
        $f_thumb = get_custom_option('show_featured_image') == 'yes';
        if ($post_data['post_thumb'] && $post_data['post_format'] == 'image' && $f_thumb) {
            ?>
				<div class="postThumb thumbZooom"><?php 
            echo balanceTags('<a href="' . $post_data['post_attachment'] . '" data-image="' . $post_data['post_attachment'] . '"><span class="icon-search thumb-ico"></span>' . $post_data['post_thumb'] . '</a>');
            ?>
				</div>
				<?php 
        } else {
            if ($post_data['post_thumb'] && $f_thumb) {
                ?>
				<div class="postThumb">
예제 #11
0
 function substituteVideo($post_text, $w, $h, $in_frame = true)
 {
     $tag = '<video>';
     $tag_end = '</video>';
     $pos_start = -1;
     while (($pos_start = themerex_strpos($post_text, themerex_substr($tag, 0, -1) . ' ', $pos_start + 1)) !== false) {
         $pos_end = themerex_strpos($post_text, themerex_substr($tag, -1), $pos_start);
         $pos_end2 = themerex_strpos($post_text, $tag_end, $pos_end);
         $tag_text = themerex_substr($post_text, $pos_start, ($pos_end2 !== false ? $pos_end2 + themerex_strlen($tag_end) - 1 : $pos_end) - $pos_start + 1);
         if (getTagAttrib($tag_text, $tag, 'data-frame') == 'no') {
             continue;
         }
         if (($src = getTagAttrib($tag_text, $tag, 'src')) == '') {
             $src = getTagAttrib($tag_text, $tag, 'url');
         }
         if ($src != '') {
             $auto = getTagAttrib($tag_text, $tag, 'autoplay');
             $src = getVideoPlayerURL($src, $auto != '');
             // && is_single());
             $id = getTagAttrib($tag_text, $tag, 'id');
             $tag_w = getTagAttrib($tag_text, $tag, 'width');
             $tag_h = getTagAttrib($tag_text, $tag, 'height');
             $tag_a = getTagAttrib($tag_text, $tag, 'align');
             $tag_s = getTagAttrib($tag_text, $tag, 'style');
             $video = '<iframe' . ($id ? ' id="' . $id . '"' : '') . ' class="video_frame' . ($tag_a ? ' align' . $tag_a : '') . '"' . ' src="' . $src . '"' . ' width="' . ($tag_w ? $tag_w : $w) . '"' . ' height="' . ($tag_h ? $tag_h : $h) . '"' . ' frameborder="0" webkitAllowFullScreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowFullScreen="allowFullScreen"></iframe>';
             if ($in_frame) {
                 $tag_image = getTagAttrib($tag_text, $tag, 'data-image');
                 $tag_title = getTagAttrib($tag_text, $tag, 'data-title');
                 $video = getVideoFrame($video, $tag_image, sc_param_is_on($tag_title), $tag_s);
             }
             $pos_end = $pos_end2 !== false ? $pos_end2 + 8 : $pos_end + 1;
             $post_text = themerex_substr($post_text, 0, themerex_substr($post_text, $pos_start - 3, 3) == '<p>' ? $pos_start - 3 : $pos_start) . $video . themerex_substr($post_text, themerex_substr($post_text, $pos_end, 4) == '</p>' ? $pos_end + 4 : $pos_end);
         }
     }
     return $post_text;
 }
예제 #12
0
	</header>
	<?php 
}
?>
	<?php 
if (get_custom_option('slider_show') == 'yes') {
    //slider
    get_template_part('templates/page-part-slider');
} else {
    if (get_custom_option('header_image') != '') {
        //header image
        echo balanceTags('<div class="sc_header_image" style="background-image: url(' . get_custom_option('header_image') . ');"></div>');
    }
}
//category title & description
if (sc_param_is_on(get_custom_option('description_lable_show'))) {
    $catTitle = getBlogTitle();
    $catDescription = '';
    if (get_custom_option('description_lable') != '') {
        $catDescription = get_queried_object()->category_description ? get_queried_object()->category_description : '';
    }
    if ($catDescription == '' && get_custom_option('description_lable') != '') {
        $catDescription = get_custom_option('description_lable');
    }
    if ($catTitle || $catDescription) {
        ?>
			<div class="subCategory">
				<h1><?php 
        echo esc_attr($catTitle);
        ?>
</h1> <?php 
예제 #13
0
                    $args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-gallery')));
                }
            }
        }
    }
    $args = addSortOrderInQuery($args);
    query_posts($args);
    $wp_query_need_restore = true;
}
$per_page = count($wp_query->posts);
$post_number = 0;
$parent_cat_id = (int) get_custom_option('category_id');
$accent_color = '';
$flt_ids = array();
if (themerex_strpos($blog_style, 'masonry') !== false || themerex_strpos($blog_style, 'portfolio') !== false) {
    $filtr = sc_param_is_on(get_custom_option('show_filters'));
    $folio_size = array('portfolio_mini' => '300', 'portfolio_medium' => '400', 'portfolio_big' => '500');
    ?>
	<div class="masonryWrap">
		<?php 
    if ($filtr) {
        ?>
<div class="isotopeFiltr"></div><?php 
    }
    ?>
		<section class="masonryStyle isotopeWrap <?php 
    echo esc_attr($blog_style . $ajax_load);
    ?>
" data-foliosize="<?php 
    echo esc_attr($folio_size[$blog_style]);
    ?>