示例#1
0
function substituteGallery($post_text, $post_id, $w, $h, $a = 'none', $zoom = false)
{
    $tag = '[gallery]';
    $post_photos = false;
    while (($pos_start = themerex_strpos($post_text, themerex_substr($tag, 0, -1))) !== false) {
        $pos_end = themerex_strpos($post_text, themerex_substr($tag, -1), $pos_start);
        $tag_text = themerex_substr($post_text, $pos_start, $pos_end - $pos_start + 1);
        if (($ids = getTagAttrib($tag_text, $tag, 'ids')) != '') {
            $ids_list = explode(',', $ids);
            $photos = array();
            if (count($ids_list) > 0) {
                foreach ($ids_list as $v) {
                    $src = wp_get_attachment_image_src($v, 'full');
                    if (isset($src[0]) && $src[0] != '') {
                        $photos[] = $src[0];
                    }
                }
            }
        } else {
            if ($post_photos === false) {
                $post_photos = getPostGallery('', $post_id, true);
            }
            $photos = $post_photos;
        }
        $post_text = themerex_substr($post_text, 0, $pos_start) . buildGalleryTag($photos, $w, $h, $zoom) . themerex_substr($post_text, $pos_end + 1);
    }
    return $post_text;
}
示例#2
0
 $recent['post_format'] = get_post_format($recent['ID']);
 $recent['post_icon'] = getPostFormatIcon($recent['post_format']);
 $recent['post_link'] = get_permalink($recent['ID']);
 $recent['comments_link'] = $counters == 'comments' ? get_comments_link($recent['ID']) : $recent['post_link'];
 $recent['post_thumb'] = getResizedImageTag($recent['ID'], 310, 310);
 $recent['attachment'] = wp_get_attachment_url(get_post_thumbnail_id($recent['ID']));
 if ($counters != 'none') {
     $recent['views'] = getPostViews($recent['ID']);
     $recent['comments'] = get_comments_number($recent['ID']);
 }
 $recent['post_protected'] = post_password_required($recent['ID']);
 $recent['post_content_prepared'] = do_shortcode($recent['post_content']);
 $recent['post_descr'] = $recent['post_format'] == 'quote' ? $recent['post_content_prepared'] : (!empty($recent['post_excerpt']) ? $recent['post_excerpt'] : getShortString(strip_tags(strip_shortcodes($recent['post_content'])), 300));
 $recent['post_gallery'] = $recent['post_video'] = $recent['post_audio'] = '';
 if ($recent['post_format'] == 'gallery') {
     $recent['post_gallery'] = buildGalleryTag(getPostGallery($recent['post_content'], $recent['ID']), 310, 310);
 } else {
     if ($recent['post_format'] == 'video') {
         $recent['post_video'] = getPostVideo($recent['post_content_prepared'], false);
         if ($recent['post_video'] == '') {
             $src = getVideoPlayerURL(getPostVideo($recent['post_content_prepared'], true), $recent['post_thumb'] != '');
             if ($src) {
                 $recent['post_video'] = substituteVideo('<video src="' . $src . '">', 310, 310);
             }
         }
         if ($recent['post_video'] != '' && get_custom_option('substitute_video') == 'yes') {
             $src = getVideoPlayerURL(getPostVideo($recent['post_video']), $recent['post_thumb'] != '');
             if ($src) {
                 $recent['post_video'] = substituteVideo('<video src="' . $src . '">', 310, 310);
             }
         }
示例#3
0
                <section id="content">                 		
                    
                    <section id="consejo">

                        
                        <?php 
if (isset($_GET["id_post"])) {
    ?>

                        <h3><?php 
    echo $post->getTitle();
    ?>
</h3>

                        <?php 
    if ($gallery = getPostGallery($post->getIdPost())) {
        ?>
                        <img src="requests/_post_image.php?id_post_image=<?php 
        echo $gallery[0]->getIdPostImage();
        ?>
" style="width: 100%">
                        <?php 
    }
    ?>
                    

                        <p><?php 
    echo $post->getBody();
    ?>
</p>
if (get_custom_option('substitute_video') == 'yes') {
    $post_excerpt = substituteVideo($post_excerpt, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
    $post_descr = substituteVideo($post_descr, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
    $post_content = substituteVideo($post_content, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
}
// Substitute <audio> tags with src from soundcloud to <iframe>
if (get_custom_option('substitute_audio') == 'yes') {
    $post_excerpt = substituteAudio($post_excerpt);
    $post_descr = substituteAudio($post_descr);
    $post_content = substituteAudio($post_content);
}
// Extract gallery, video and audio from full post content
$post_gallery = $post_video = $post_audio = $post_url = $post_url_target = '';
if ($blog_style != 'fullpost') {
    if ($post_format == 'gallery') {
        $post_gallery = buildGalleryTag(getPostGallery($post_content_full, $post_id), $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
    } else {
        if ($post_format == 'video') {
            $post_video = getPostVideo($post_content_prepared, false);
            if ($post_video == '') {
                $src = getVideoPlayerURL(getPostVideo($post_content_prepared, true), $post_thumb != '');
                if ($src) {
                    $post_video = substituteVideo('<video src="' . $src . '">', $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
                }
            }
            if ($post_video != '' && get_custom_option('substitute_video') == 'yes') {
                $src = getVideoPlayerURL(getPostVideo($post_video), $post_thumb != '');
                if ($src) {
                    $post_video = substituteVideo('<video src="' . $src . '">', $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
                }
            }
示例#5
0
function sc_blogger($atts, $content = null)
{
    extract(shortcode_atts(array("id" => "", "style" => "regular", "bubble_color" => "", "ids" => "", "cat" => "", "count" => "3", "offset" => "", "orderby" => "date", "order" => "desc", "descr" => "0", "readmore" => "0", "dir" => "horizontal", "border" => "0", "rating" => "1", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
    $s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '');
    global $THEMEREX_sc_blogger_counter, $post;
    $THEMEREX_sc_blogger_counter = 0;
    if (!in_array($style, array('regular', 'date', 'image_large', 'image_medium', 'image_small', 'bubble_left', 'bubble_top', 'accordion', 'puzzles', 'underline'))) {
        $style = 'regular';
    }
    if (!empty($ids)) {
        $posts = explode(',', str_replace(' ', '', $ids));
        $count = count($posts);
    }
    if ($style == 'accordion') {
        $dir = 'vertical';
    }
    $output = $style == 'puzzles' ? '' : '<div' . ($id ? ' id="' . $id . '"' : '') . ' class="sc_blogger' . ' sc_blogger_' . ($dir == 'vertical' ? 'vertical' : 'horizontal') . ' style_' . $style . ($style == 'accordion' ? ' sc_accordion' : '') . ($dir != 'vertical' && $style != 'puzzles' ? ' sc_columns sc_columns_count_' . $count : '') . '"' . ($s != '' ? ' style="' . $s . '"' : '') . '>';
    $counters = get_theme_option("blog_counters");
    $args = array('post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'order' => $order == 'asc' ? 'asc' : 'desc', 'orderby' => 'date');
    if ($offset > 0 && empty($ids)) {
        $args['offset'] = $offset;
    }
    $args = addSortOrderInQuery($args, $orderby, $order);
    $args = addPostsAndCatsInQuery($args, $ids, $cat);
    $query = new WP_Query($args);
    while ($query->have_posts()) {
        $query->the_post();
        $post_id = get_the_ID();
        $post_protected = post_password_required();
        $post_format = get_post_format();
        $post_link = get_permalink();
        $post_comments_link = $counters == 'comments' ? get_comments_link($post_id) : $post_link;
        $post_comments = get_comments_number();
        $post_views = getPostViews($post_id);
        $post_date = prepareDateForTranslation(get_the_date());
        $post_date_sql = get_the_date('Y-m-d H:i:s');
        $post_date_diff = getDateOrDifference($post_date_sql);
        $post_icon = getPostFormatIcon($post_format);
        $post_author = get_the_author();
        $post_author_id = get_the_author_meta('ID');
        $post_author_url = get_author_posts_url($post_author_id, '');
        $post_title_tag = $dir == 'vertical' ? 'h3' : 'h4';
        $post_thumb_w = $post_thumb_h = 0;
        if (themerex_strpos($style, 'bubble') !== false) {
            $post_custom_options = get_post_meta($post_id, 'post_custom_options', true);
            $post_icon = isset($post_custom_options['page_icon']) ? $post_custom_options['page_icon'] : $post_icon;
            $post_title_tag = 'h2';
        } else {
            if ($style == 'image_small') {
                $post_thumb = getResizedImageTag($post_id, 120, 80);
            } else {
                if ($style == 'image_medium') {
                    $post_thumb = getResizedImageTag($post_id, $post_thumb_w = 279, $post_thumb_h = 186);
                } else {
                    if ($style == 'image_large') {
                        $post_thumb = getResizedImageTag($post_id, $post_thumb_w = 466, $post_thumb_h = 310);
                    } else {
                        if ($style == 'puzzles') {
                            $post_thumb = getResizedImageTag($post_id, $post_thumb_w = 310, $post_thumb_h = 310);
                        }
                    }
                }
            }
        }
        //$post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));
        if (get_theme_option('preserve_decoration') == 'no') {
            // -------------- Old way to get title, excerpt and content -----------------------
            $post_title = get_the_title();
            $post_content_full = $post->post_content;
            //get_the_content() not used, because it trim content up to <!-- more --> in each case!
            $post_content_prepared = strip_shortcodes($post_content_full);
            //do_shortcode($post_content_full); //do_shortcode() make a recursion if insert shortcode [blogger] in the posts!!!!
            $post_excerpt = in_array($post_format, array('quote', 'link')) && $style == 'puzzles' ? $post_content_prepared : ($descr > 0 ? strip_tags(strip_shortcodes(getPostDescription($descr, $readmore ? '' : '...'))) : '');
        } else {
            // ----------------- New way to get title, excerpt and content -----------------------
            $post_title = $post_title_plain = get_the_title();
            global $more;
            $old_more = $more;
            $more = -1;
            $post_content_full = get_the_content();
            $post_content_prepared = do_shortcode($post_content_full);
            $more = $old_more;
            $post_content = get_the_content(null);
            $post_excerpt = has_excerpt() || $post_protected ? get_the_excerpt() : '';
            if (empty($post_excerpt)) {
                if (($more_pos = themerex_strpos($post_content_full, '<span id="more-')) !== false) {
                    $post_excerpt = themerex_substr($post_content_full, 0, $more_pos);
                } else {
                    $post_excerpt = in_array($post_format, array('quote', 'link')) ? $post_content : get_the_excerpt();
                }
            }
            $post_excerpt = str_replace('[&hellip;]', '', $post_excerpt);
            if (!in_array($post_format, array('quote', 'link')) && $descr > 0 && themerex_strlen($post_excerpt) > $descr) {
                $post_excerpt = getShortString(strip_tags(do_shortcode($post_excerpt)), $descr, $readmore ? '' : '...');
            }
            $post_excerpt .= !in_array($post_format, array('quote', 'link')) && $readmore ? '&nbsp;<a href="' . $post_link . '" class="readmore">' . ($readmore == 1 ? '&raquo;' : $readmore) . '</a>' : '';
            //$post_content = apply_filters('the_content', $post_content);
            // ------------------  /New way to get title, excerpt and content -----------------------
        }
        $post_excerpt = apply_filters(in_array($post_format, array('quote', 'link')) ? 'the_content' : 'the_excerpt', force_balance_tags($post_excerpt));
        // Extract gallery, video and audio from full post content
        $post_gallery = $post_video = $post_audio = $post_url = $post_url_target = '';
        if (in_array($style, array('image_medium', 'image_large', 'puzzles'))) {
            if ($post_format == 'gallery') {
                $post_gallery = buildGalleryTag(getPostGallery($post_content_full, $post_id), $post_thumb_w, $post_thumb_h);
            } else {
                if ($post_format == 'video') {
                    $post_video = getPostVideo($post_content_full, false);
                    if ($post_video == '') {
                        $src = getVideoPlayerURL(getPostVideo($post_content_full, true), $post_thumb != '');
                        if ($src) {
                            $post_video = substituteVideo('<video src="' . $src . '">', $post_thumb_w, $post_thumb_h);
                        }
                    }
                    if ($post_video != '' && get_custom_option('substitute_video') == 'yes') {
                        $src = getVideoPlayerURL(getPostVideo($post_video), $post_thumb != '');
                        if ($src) {
                            $post_video = substituteVideo('<video src="' . $src . '">', $post_thumb_w, $post_thumb_h);
                        }
                    }
                } else {
                    if ($post_format == 'audio') {
                        $post_audio = getPostAudio($post_content_full, false);
                        if ($post_audio == '') {
                            $src = getPostAudio($post_content_full, true);
                            if ($src) {
                                $post_audio = substituteAudio('<audio src="' . $src . '">');
                            }
                        }
                        if ($post_audio != '' && get_custom_option('substitute_audio') == 'yes') {
                            $src = getPostAudio($post_audio);
                            if ($src) {
                                $post_audio = substituteAudio('<audio src="' . $src . '">');
                            }
                        }
                    } else {
                        if ($post_format == 'image' && !$post_thumb) {
                            if (($src = getPostImage($post_content_full)) != '') {
                                $post_thumb = getResizedImageTag($src, $post_thumb_w, $post_thumb_h);
                            }
                        } else {
                            if ($post_format == 'link') {
                                $post_url_data = getPostLink($post_content_full, false);
                                $post_url = $post_url_data['url'];
                                $post_url_target = $post_url_data['target'];
                            }
                        }
                    }
                }
            }
        }
        // Get all post's categories
        $post_categories = getCategoriesByPostId($post_id);
        $post_categories_str = '';
        $post_accent_color = '';
        $post_accent_category = '';
        $ex_cats = explode(',', get_theme_option('exclude_cats'));
        for ($i = 0; $i < count($post_categories); $i++) {
            if (in_array($post_categories[$i]['term_id'], $ex_cats)) {
                continue;
            }
            if ($post_accent_category == '') {
                if (get_theme_option('close_category') == 'parental') {
                    $parent_cat_id = 0;
                    //(int) get_custom_option('category_id');
                    $parent_cat = getParentCategory($post_categories[$i]['term_id'], $parent_cat_id);
                    if ($parent_cat) {
                        $post_accent_category = $parent_cat['name'];
                        if ($post_accent_color == '') {
                            $post_accent_color = getCategoryInheritedProperty($parent_cat['term_id'], 'theme_accent_color');
                        }
                    }
                } else {
                    $post_accent_category = $post_categories[$i]['name'];
                    if ($post_accent_color == '') {
                        $post_accent_color = getCategoryInheritedProperty($post_categories[$i]['term_id'], 'theme_accent_color');
                    }
                }
            }
            $post_categories_str .= '<a class="cat_link" href="' . $post_categories[$i]['link'] . '">' . $post_categories[$i]['name'] . ($i < count($post_categories) - 1 ? ',' : '') . '</a> ';
        }
        if ($post_accent_category == '' && count($post_categories) > 0) {
            $post_accent_category = $post_categories[0]['name'];
            if ($post_accent_color == '') {
                $post_accent_color = getCategoryInheritedProperty($post_categories[0]['term_id'], 'theme_accent_color');
            }
        }
        if ($style == 'puzzles') {
            $post_hover_bg = get_custom_option('puzzles_post_bg', null, $post_id);
            $post_hover_pos = get_custom_option('puzzles_post_position', null, $post_id);
        }
        // Prepare reviews block
        $reviewsBlock = '';
        $avg_author = 0;
        if ($rating > 0 && get_custom_option('show_reviews', null, $post_id) == 'yes') {
            $avg_author = marksToDisplay(get_post_meta($post_id, 'reviews_avg' . (get_theme_option('reviews_first') == 'author' ? '' : '2'), true));
            if ($avg_author > 0) {
                $reviewsBlock .= '<div class="reviews_summary blog_reviews' . ($style == 'puzzles' ? ' theme_puzzles' : '') . '"' . ($style == 'puzzles' && $post_hover_bg != '' && $post_hover_bg != 'default' ? ' style="background-color:' . $post_hover_bg . ';"' : '') . '>' . '<div class="criteria_summary criteria_row">' . getReviewsSummaryStars($avg_author) . '</div>' . '</div>';
            }
        }
        // Start output
        $THEMEREX_sc_blogger_counter++;
        $output .= '<div class="sc_blogger_item' . ($style == 'puzzles' ? ' sc_blogger_item_puzzles' : '') . ($style == 'date' ? ' sc_blogger_item_date' : '') . ($style == 'accordion' ? ' sc_accordion_item' : '') . ($dir != 'vertical' && $style != 'puzzles' ? ' sc_column_item sc_column_item_' . $THEMEREX_sc_blogger_counter : '') . ($border == 1 ? ' sc_blogger_item_bordered' : '') . ($THEMEREX_sc_blogger_counter % 2 == 1 ? ' odd' : ' even') . ($THEMEREX_sc_blogger_counter == 1 ? ' first' : '') . '">
			';
        if ($style == 'puzzles') {
            $show_content_block = !in_array($post_format, array('link', 'image')) || !$post_thumb;
            $puzzles_style = get_custom_option('puzzles_style');
            $no_thumb = in_array($post_format, array('quote', 'link', 'image')) || !$post_thumb && (!$post_gallery || $post_protected);
            $output .= '<div class="post_thumb image_wrapper post_format_' . $post_format . ' ' . ($no_thumb ? 'no_thumb' : $post_hover_pos) . '"' . ($post_video && !$post_protected ? ' data-video="' . htmlspecialchars($post_video) . '"' : '') . '>';
            if ($post_thumb && ($post_format != 'gallery' || !$post_gallery || get_custom_option('gallery_instead_image') == 'no')) {
                // If post have thumbnail - show it
                if ($post_format == 'link' && $post_url != '') {
                    $output .= '<a href="' . $post_url . '"' . ($post_url_target ? ' target="' . $post_url_target . '"' : '') . '>' . $post_thumb . '</a>';
                } else {
                    if ($post_link != '') {
                        $output .= '<a href="' . $post_link . '">' . $post_thumb . '</a>';
                    } else {
                        $output .= $post_thumb;
                    }
                }
                if ($post_format == 'video' && $post_video && !$post_protected) {
                    $output .= '<a href="#" class="post_video_play icon-play"></a>';
                }
            } else {
                if ($post_gallery && !$post_protected) {
                    // If post have gallery - show it
                    if ($post_link != '') {
                        $output .= '<a href="' . $post_link . '">' . $post_gallery . '</a>';
                    } else {
                        $output .= $post_gallery;
                    }
                } else {
                    if ($post_video && !$post_protected) {
                        // If post have video - show it
                        $output .= $post_video;
                        $show_content_block = false;
                    }
                }
            }
            $output .= '<span class="post_format theme_accent_bg ' . $post_icon . '"' . (themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '') . '></span>';
            if ($puzzles_style == 'heavy') {
                if ($post_accent_category != '') {
                    $output .= '<span class="post_category theme_accent_bg"' . (themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '') . '>' . $post_accent_category . '</span>';
                }
            } else {
                if ($show_content_block) {
                    $output .= '<div class="post_content_light">' . ($post_accent_category != '' ? '<span class="post_category theme_accent_bg"' . (themerex_substr($post_accent_color, 0, 1) == '#' ? ' style="background-color: ' . $post_accent_color . '"' : '') . '>' . $post_accent_category . '</span><br>' : '') . '<h2 class="post_subtitle theme_puzzles"' . ($post_hover_bg != '' && $post_hover_bg != 'default' ? ' style="background-color:' . $post_hover_bg . ';"' : '') . '><a href="' . $post_link . '">' . $post_title . '</a></h2><br>' . $reviewsBlock . '</div>';
                }
            }
            if ($show_content_block) {
                $output .= '<div class="post_content_wrapper theme_puzzles"' . ($post_hover_bg != '' && $post_hover_bg != 'default' ? ' style="background-color:' . $post_hover_bg . ';"' : '') . '>';
                if (!in_array($post_format, array('quote', 'aside'))) {
                    $output .= '<h2 class="post_subtitle"><a href="' . $post_link . '">' . $post_title . '</a></h2>';
                    $output .= $reviewsBlock;
                }
                $output .= '<div class="post_descr">' . $post_excerpt . '</div>' . '<div class="post_content_padding theme_puzzles"';
                if ($post_hover_bg != '' && $post_hover_bg != 'default') {
                    $rgb = Hex2RGB($post_hover_bg);
                    $post_hover_ie = str_replace('#', '', $post_hover_bg);
                    $output .= " style=\"\n\t\t\t\t\t\tbackground: -moz-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%, rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0)), color-stop(1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01)), color-stop(50%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1)));\n\t\t\t\t\t\tbackground: -webkit-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -o-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: -ms-linear-gradient(top,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tbackground: linear-gradient(to bottom,  rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0) 0%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},0.01) 1%,rgba({$rgb['r']},{$rgb['g']},{$rgb['b']},1) 50%);\n\t\t\t\t\t\tfilter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00{$post_hover_ie}', endColorstr='#{$post_hover_ie}',GradientType=0 );\n\t\t\t\t\t\t\"";
                }
                $output .= '></div></div>';
            }
            if (!$post_protected) {
                if ($post_audio) {
                    // If post have audio - show it
                    $output .= $post_audio;
                }
            }
            $output .= '</div>';
        } else {
            $title = '<' . $post_title_tag . ' class="sc_blogger_title sc_title entry-title' . ($style == 'accordion' ? ' sc_accordion_title' : '') . ($style == 'underline' ? ' sc_title_underline' : '') . (themerex_strpos($style, 'bubble') !== false ? ' sc_title_bubble sc_title_' . $style : '') . '">' . '<a href="' . ($style == 'accordion' ? '#' : $post_link) . '">' . (themerex_substr($style, 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_icon != '' ? ' ' . $post_icon : '') . '"' . ($bubble_color != '' ? ' style="background-color:' . $bubble_color . '"' : '') . '></span>' : '') . ($style == 'accordion' ? '<span class="sc_accordion_icon"></span>' : '') . $post_title . ($style == 'accordion' ? '' : $reviewsBlock) . '</a>' . '</' . $post_title_tag . '>';
            if ($style == 'date') {
                $output .= '<div class="date_area">' . '<div class="date_month">' . prepareDateForTranslation(date('M', strtotime($post_date_sql))) . '</div>' . '<div class="date_day">' . date('d', strtotime($post_date)) . '</div>' . '</div>';
            } else {
                if (themerex_strpos($style, 'image') !== false) {
                    $output .= ($style == 'image_small' ? '<div class="title_area">' . $title . '</div>' : ($post_thumb ? '<div class="sc_blogger_image image_wrapper">' . ($post_link != '' ? '<a href="' . $post_link . '">' : '') . $post_thumb . ($post_link != '' ? '</a>' : '') . '</div>' : '')) . '<div class="post_wrapper">' . '<div class="post_info theme_info">' . __('Posted', 'themerex') . ' <span class="post_date theme_text">' . $post_date_diff . '</span> ' . '<span class="post_author">' . __('by', 'themerex') . ' <a href="' . $post_author_url . '" class="post_author">' . $post_author . '</a></span>' . '<br />' . ($post_categories_str != '' ? '<span class="post_cats">' . __('in', 'themerex') . ' ' . $post_categories_str . '</span>' : '') . ($counters == 'none' ? '' : '<span class="post_comments"><a href="' . $post_comments_link . '"><span class="comments_icon theme_info icon-' . ($orderby == 'comments' || $counters == 'comments' ? 'chat-1' : 'eye') . '"></span><span class="comments_number">' . ($orderby == 'comments' || $counters == 'comments' ? $post_comments : $post_views) . '</span></a></span>') . '</div>' . ($style == 'image_small' ? '' : '<div class="title_area">');
                }
            }
            $output .= $style == 'image_small' ? '' : $title;
            if (themerex_strpos($style, 'image') !== false) {
                $output .= $style == 'image_small' ? $post_thumb ? '<div class="sc_blogger_image image_wrapper">' . ($post_link != '' ? '<a href="' . $post_link . '">' : '') . $post_thumb . ($post_link != '' ? '</a>' : '') . '</div>' : '' : '</div>';
            }
            if ($descr > 0) {
                $output .= '<div class="sc_blogger_content' . ($style == 'accordion' ? ' sc_accordion_content' : '') . '">' . $post_excerpt . '</div>';
            }
            if (themerex_strpos($style, 'image') !== false) {
                $output .= '</div>';
            }
        }
        $output .= '</div>';
    }
    wp_reset_postdata();
    if ($style !== 'puzzles') {
        $output .= '</div>';
    }
    if ($style == 'accordion') {
        wp_enqueue_script('jquery-ui-accordion', false, array('jquery', 'jquery-ui-core'), null, true);
        $output .= '<script type="text/javascript">
				jQuery(document).ready(function() {
					jQuery(\'div' . ($id ? '#' . $id : '') . '.sc_blogger.sc_accordion\').accordion({
						header: "h3",
						collapsible: true,
						heightStyle: "content"
					});
				});
			</script>';
    }
    if ($border == 1) {
        $output .= '<script type="text/javascript">
				jQuery(document).ready(function() {
					var maxHeight = 0;
					for (var i=0; i<2; i++) {
						jQuery(\'.sc_blogger_item_bordered\').each(function(){
							if (i > 0) {
								if (maxHeight>0) jQuery(this).height(maxHeight);
							} else if (jQuery(this).height() > maxHeight)
								maxHeight = jQuery(this).height();
						});
					}
				});
			</script>';
    }
    return $output;
}
示例#6
0
文件: index.php 项目: KINOTO/apymeco
                <div class="item active">  
                <?php 
    } else {
        ?>
                <div class="item">  
                <?php 
    }
    ?>

                    <!-- Main carousel - Left post -->

                    <article class="post left-post pull-left">
                        <div class="content-post mr">
                            <div class="img-post pull-left">
                                <?php 
    $gallery = getPostGallery($posts[$i]->getIdPost());
    if ($gallery) {
        ?>
                                <img src="requests/_post_image.php?id_post_image=<?php 
        echo $gallery[0]->getIdPostImage();
        ?>
">
                                <?php 
    }
    ?>
                            </div>
                            <div class="text-post pull-right">
                                <p class="date-post">
                                    &#60; <?php 
    echo $posts[$i]->getDate();
    ?>