Exemple #1
0
    public static function et_slider_display($slider_id, $container, $speed, $hide_text, $height)
    {
        self::add_script();
        $cslide = !empty($container) ? $container : 'myCarousel';
        $pex = get_post($slider_id);
        if (!$pex) {
            $slider_id = -1;
        }
        $args = array('post_type' => 'et_slider', 'numberposts' => -1, 'orderby' => 'menu_order date', 'order' => 'DESC', 'post_status' => 'publish', 'post_parent' => $slider_id);
        $et_content = '';
        $posts = new WP_Query($args);
        if ($posts->have_posts()) {
            $et_content .= '<div class="slide-homepage" style="display : none;">
				<div id="' . $cslide . '" class="' . $cslide . ' carousel slide">
				    <ol class="carousel-indicators">';
            for ($i = 0; $i < $posts->post_count; $i++) {
                $class = $i == 0 ? 'active' : '';
                $et_content .= '<li data-target="#' . $cslide . '" data-slide-to="' . $i . '" class="' . $class . '"></li>';
            }
            $et_content .= '</ol>
					<div class="caption-block"></div>
				 	<div class="carousel-inner">';
            $j = 0;
            while ($posts->have_posts()) {
                global $post;
                $posts->the_post();
                $et_link = get_post_meta(get_the_ID(), 'et_link', true);
                $att_id = get_post_meta(get_the_ID(), '_thumbnail_id', true);
                $read_more = get_post_meta(get_the_ID(), 'read_more', true);
                if (empty($read_more)) {
                    $read_more = __('Read more', ET_DOMAIN);
                }
                $att_url = wp_get_attachment_image_src($att_id, 'full');
                $url_thumb = is_array($att_url) ? $att_url[0] : '';
                $class = $j == 0 ? 'active' : '';
                $et_content .= '<div class="' . $class . ' item">';
                $et_title = break_text($post->post_title, 27);
                $et_des = get_the_content();
                if ($hide_text == false) {
                    $et_content .= '<div class="carousel-caption">
								<h4 class="title-slider"><a href ="' . esc_url($et_link) . '">' . $et_title . ' </a> </h4>';
                    $et_content .= '<div class= "et-slider-des">' . $et_des . '</div>
								<div class="btn-read-more"><a href="' . esc_url($et_link) . '">' . $read_more . '<span class="icon" data-icon="]"></span></a></div>
							</div>';
                }
                $et_content .= ' <div class="carousel-thumb">';
                if (!empty($url_thumb)) {
                    $et_content .= '<img alt= "' . $post->post_title . '" title="' . $post->post_title . '" align ="middle" src="' . $url_thumb . '" >';
                }
                $et_content .= '</div>
					    </div>';
                $j++;
            }
            wp_reset_query();
            //$thumb_h = $height-
            $line_height = $height - 4;
            $text_height = $height - 152;
            $et_content .= '</div>
				</div>
			</div>';
            $et_content .= "\n\t\t\t<script type='text/javascript'>\n\t\t\t\t(function(\$){\n\t\t\t\t\t\$(document).ready(function(\$){\n\t\t\t\t\t\t\$('.slide-homepage').show();\n\t\t\t\t\t\t\$('#" . $cslide . "').carousel({\n\t\t\t\t\t\t  interval: " . $speed . "\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t})(jQuery);\n\n\t\t\t</script>\n\t\t\t<style type='text/css'>\n\t\t\t." . $cslide . "{\n\t\t\t\tmin-height:" . $height . "px;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\t.second-column #" . $cslide . "{\n\t\t\t\tmin-height:0px;\n\n\t\t\t}\n\t\t\t." . $cslide . " .carousel-inner .item{\n\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\t\t\t." . $cslide . " .carousel-thumb{\n\t\t\t\theight:" . $height . "px;\n\t\t\t\toverflow: hidden;\n\t\t\t\tline-height:" . $line_height . "px;\n\t\t\t}\n\t\t\t." . $cslide . " .carousel-inner {\n\n\t\t\t}\n\n\t\t\t." . $cslide . " .et-slider-des{\n\t\t\t\tmax-height: 143px;\n\t\t\t\toverflow:hidden;\n\t\t\t\tfont-weight:bold;\n\n\t\t\t}\n\t\t\tbody.single #" . $cslide . " .et-slider-des{\n\t\t\t\tmax-height:1000px;\n\t\t\t\toverflow:hidden;\n\t\t\t}\n\t\t\tbody.single #" . $cslide . " .carousel-inner .btn-read-more{ display:none;}\n\t\t\t." . $cslide . " .carousel-caption{\n\t\t\t\tmin-height:" . $height . "px;\n\t\t\t}\n\t\t\t.second-column #" . $cslide . " {\n\t\t\t\tpadding-top:0;\n\t\t\t}\n\n\t\t\t</style>";
        } else {
            $et_content .= 'There are no images in your slide.';
        }
        return $et_content;
    }
}
// Parse message and/or sig for BBCode if reqd
if ($board_config['allow_bbcode']) {
    $message = str_replace("\n", "<br>", $message);
    $bbcode_uid = make_bbcode_uid();
    $message = bbencode_first_pass($message, $bbcode_uid);
    $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
    //              $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, 0) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
$message = make_clickable($message);
// Parse smilies
if ($board_config['allow_smilies']) {
    $message = smilies_pass($message);
}
// END prepare message
$message = break_text($message);
// Create time-2-end-chart
if ($auction_offer_row['auction_offer_time_stop'] > time() and $auction_config_data['auction_show_timeline'] and $auction_offer_row['auction_offer_state'] != 2) {
    $time_to_end = daydiff(time(), $auction_offer_row['auction_offer_time_stop']);
    $time_total = daydiff($auction_offer_row['auction_offer_time_start'], $auction_offer_row['auction_offer_time_stop']);
    $template->assign_block_vars('timetoend_chart', array('TIME_TOTAL' => $time_total, 'TIME_TO_END' => $time_to_end));
    for ($i = 0; $i < $time_total - $time_to_end; $i++) {
        $template->assign_block_vars('timetoend_chart.timetoend_chart_over', array('TIME_TOTAL' => $time_total, 'TIME_TO_END' => $time_to_end));
    }
    for ($i = 0; $i < $time_to_end; $i++) {
        $template->assign_block_vars('timetoend_chart.timetoend_chart_running', array('TIME_TOTAL' => $time_total, 'TIME_TO_END' => $time_to_end));
    }
}
// Output page
$page_title = $lang['auction_user_rating_view_offer'] . ' (' . $lang['auction_offer_time_stop'] . ' ' . $auction_offer_time_stop . ') - ' . $auction_offer_row['auction_offer_title'];
include $phpbb_root_path . 'includes/page_header.' . $phpEx;