/**
 * Get the image with a link to the post.  Use smooth_sslider_get_the_image() instead.
 *
 * @since 0.1
 * @deprecated 0.3
 */
function smooth_sslider_get_the_image_link( $deprecated = '', $deprecated_2 = '', $deprecated_3 = '' ) {
	smooth_sslider_get_the_image();
}
Exemple #2
0
function smooth_post_processor_default($posts, $smooth_slider, $out_echo)
{
    $skin = 'default';
    global $smooth_slider;
    $smooth_slider_css = smooth_get_inline_css();
    $html = '';
    $smooth_sldr_j = 0;
    foreach ($posts as $post) {
        $post_id = $post->ID;
        $post_title = stripslashes($post->post_title);
        $post_title = str_replace('"', '', $post_title);
        //filter hook
        $post_title = apply_filters('smooth_post_title', $post_title, $post_id, $smooth_slider, $smooth_slider_css);
        $slider_content = $post->post_content;
        //2.1 changes start
        $slide_redirect_url = get_post_meta($post_id, 'slide_redirect_url', true);
        $sslider_nolink = get_post_meta($post_id, 'sslider_nolink', true);
        trim($slide_redirect_url);
        if (!empty($slide_redirect_url) and isset($slide_redirect_url)) {
            $permalink = $slide_redirect_url;
        } else {
            $permalink = get_permalink($post_id);
        }
        if ($sslider_nolink == '1') {
            $permalink = '';
        }
        //filter hook
        $permalink = apply_filters('smooth_permalink', $permalink, $post_id, $smooth_slider, $smooth_slider_css);
        //2.1 changes end
        $smooth_sldr_j++;
        $html .= '<div class="smooth_slideri" ' . $smooth_slider_css['smooth_slideri'] . '>
			<!-- smooth_slideri -->';
        $thumbnail = get_post_meta($post_id, $smooth_slider['img_pick'][1], true);
        //$image_control = get_post_meta($post_id, 'slider_image_control', true);
        if ($smooth_slider['content_from'] == "slider_content") {
            $slider_content = get_post_meta($post_id, 'slider_content', true);
        }
        if ($smooth_slider['content_from'] == "excerpt") {
            $slider_content = $post->post_excerpt;
        }
        $slider_content = strip_shortcodes($slider_content);
        $slider_content = stripslashes($slider_content);
        $slider_content = str_replace(']]>', ']]&gt;', $slider_content);
        $slider_content = str_replace("\n", "<br />", $slider_content);
        $slider_content = strip_tags($slider_content, $smooth_slider['allowable_tags']);
        //filter hook
        $slider_content = apply_filters('smooth_slide_excerpt', $slider_content, $post_id, $smooth_slider, $smooth_slider_css);
        if (!isset($smooth_slider['img_pick'][0])) {
            $smooth_slider['img_pick'][0] = '';
        }
        if (!isset($smooth_slider['img_pick'][2])) {
            $smooth_slider['img_pick'][2] = '';
        }
        if (!isset($smooth_slider['img_pick'][3])) {
            $smooth_slider['img_pick'][3] = '';
        }
        if (!isset($smooth_slider['img_pick'][5])) {
            $smooth_slider['img_pick'][5] = '';
        }
        if ($smooth_slider['img_pick'][0] == '1') {
            $custom_key = array($smooth_slider['img_pick'][1]);
        } else {
            $custom_key = '';
        }
        if ($smooth_slider['img_pick'][2] == '1') {
            $the_post_thumbnail = true;
        } else {
            $the_post_thumbnail = false;
        }
        if ($smooth_slider['img_pick'][3] == '1') {
            $attachment = true;
            $order_of_image = $smooth_slider['img_pick'][4];
        } else {
            $attachment = false;
            $order_of_image = '1';
        }
        if ($smooth_slider['img_pick'][5] == '1') {
            $image_scan = true;
        } else {
            $image_scan = false;
        }
        if ($smooth_slider['img_size'] == '1') {
            $gti_width = $smooth_slider['img_width'];
        } else {
            $gti_width = false;
        }
        if ($smooth_slider['crop'] == '0') {
            $extract_size = 'full';
        } elseif ($smooth_slider['crop'] == '1') {
            $extract_size = 'large';
        } elseif ($smooth_slider['crop'] == '2') {
            $extract_size = 'medium';
        } else {
            $extract_size = 'thumbnail';
        }
        $img_args = array('custom_key' => $custom_key, 'post_id' => $post_id, 'attachment' => $attachment, 'size' => $extract_size, 'the_post_thumbnail' => $the_post_thumbnail, 'default_image' => false, 'order_of_image' => $order_of_image, 'link_to_post' => false, 'image_class' => 'smooth_slider_thumbnail', 'image_scan' => $image_scan, 'width' => $gti_width, 'height' => false, 'echo' => false, 'permalink' => $permalink, 'style' => $smooth_slider_css['smooth_slider_thumbnail']);
        $smooth_slide_image = smooth_sslider_get_the_image($img_args);
        //filter hook
        $smooth_slide_image = apply_filters('smooth_slide_image', $smooth_slide_image, $post_id, $smooth_slider, $smooth_slider_css);
        $thumbnail_image = get_post_meta($post_id, '_disable_image', true);
        if ($thumbnail_image != '1') {
            $html .= $smooth_slide_image;
        }
        /* Added for embeding any shortcode on slide - start */
        $smooth_eshortcode = get_post_meta($post_id, '_smooth_embed_shortcode', true);
        if (!empty($smooth_eshortcode)) {
            $shortcode_html = do_shortcode($smooth_eshortcode);
            $html .= '<div class="smooth_slider_thumbnail"><div class="smooth_slider_eshortcode" ' . $smooth_slider_css['smooth_slider_eshortcode'] . '>' . $shortcode_html . '</div></div>';
        }
        /* Added for embeding any shortcode on slide - end */
        $content_limit = $smooth_slider['content_limit'];
        $content_chars = $smooth_slider['content_chars'];
        if (empty($content_limit) && !empty($content_chars)) {
            $slider_excerpt = substr($slider_content, 0, $content_chars);
        } else {
            $slider_excerpt = smooth_slider_word_limiter($slider_content, $limit = $content_limit);
        }
        if (!isset($slider_excerpt)) {
            $slider_excerpt = '';
        }
        if ($smooth_slider['image_only'] == '1') {
            $html .= '<!-- /smooth_slideri -->
			</div>';
        } else {
            if ($permalink != '') {
                $html .= '<h2 ' . $smooth_slider_css['smooth_slider_h2'] . '><a ' . $smooth_slider_css['smooth_slider_h2_a'] . ' href="' . $permalink . '">' . $post_title . '</a></h2><span ' . $smooth_slider_css['smooth_slider_span'] . '> ' . $slider_excerpt . '</span>
				<p class="smooth_more"><a href="' . $permalink . '" ' . $smooth_slider_css['smooth_slider_p_more'] . '>' . $smooth_slider['more'] . '</a></p>
			
				<!-- /smooth_slideri -->
			</div>';
            } else {
                $html .= '<h2 ' . $smooth_slider_css['smooth_slider_h2'] . '>' . $post_title . '</h2><span ' . $smooth_slider_css['smooth_slider_span'] . '> ' . $slider_excerpt . '</span>
				<!-- /smooth_slideri -->
			</div>';
            }
        }
    }
    if ($out_echo == '1') {
        echo $html;
    }
    $r_array = array($smooth_sldr_j, $html);
    $r_array = apply_filters('smooth_r_array', $r_array, $posts, $smooth_slider);
    return $r_array;
}