????
| Current Path : /home2/morganrand/www/wp-content/plugins/pinwheel-slider/css/skins/multi/ |
| Current File : /home2/morganrand/www/wp-content/plugins/pinwheel-slider/css/skins/multi/functions.php |
<?php
function pinwheel_post_processor_multi($posts, $pinwheel_slider_curr,$out_echo,$set,$data=array()){
$skin='multi';
$default_pinwheel_slider_settings=get_pinwheel_slider_default_settings();
$pinwheel_slider_css = pinwheel_get_inline_css($set);
$html = $focuscrop_class = $focusx = $focusy = '';
$pinwheel_sldr_j = $i = 0;
$type = isset($data['type'])?$data['type']:'';
$types = array("woo", "ecom", "eman", "ecal");
$pinwheel_slider_curr= populate_pinwheel_current($pinwheel_slider_curr);
//Timthummb
$timthumb='0';
if($pinwheel_slider_curr['timthumb']=='1') {
$timthumb='0';
}
elseif($pinwheel_slider_curr['timthumb']=='0') {
$timthumb='1';
require_once(PINWHEEL_SLIDER_INC_DIR.'BFI_Thumb.php');
}
$slider_handle='';
if ( is_array($data) and isset($data['slider_handle']) ) {
$slider_handle=$data['slider_handle'];
}
$pinwheel_slider_defset = get_option('pinwheel_slider_options');
foreach($posts as $post) {
$id = $post_id = $post->ID;
$post_title = get_post_meta($id, 'SlideTitle', true);
if(empty($post_title)) {
$post_title = stripslashes($post->post_title);
$post_title = str_replace('"', '', $post_title);
}
//filter hook
if (isset($post_id)) $post_title=apply_filters('pinwheel_post_title',$post_title,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css);
$slider_content = $post->post_content;
$pinwheel_slide_redirect_url = get_post_meta($post_id, 'pinwheel_slide_redirect_url', true);
$pinwheel_sslider_nolink = get_post_meta($post_id,'pinwheel_sslider_nolink',true);
trim($pinwheel_slide_redirect_url);
if(!empty($pinwheel_slide_redirect_url) and isset($pinwheel_slide_redirect_url)) {
$permalink = $pinwheel_slide_redirect_url;
}
else{
$permalink = get_permalink($post_id);
}
if($pinwheel_sslider_nolink=='1'){
$permalink='';
}
/* do not link from settings panel - 3.0 */
$dolink = get_post_meta($post_id,'pinwheel_dolink',true);
$img_permalink = $permalink;
if( empty( $dolink ) && $pinwheel_slider_curr['donotlink'] == '1' ) {
$permalink='';
if($pinwheel_slider_curr['pphoto'] != "1"){
$img_permalink ="";
}
}
$pinwheel_sldr_j++;
if($pinwheel_slider_curr['timthumb']=='2') {
$focuscrop_class = "focuscrop";
$focusx = $pinwheel_slider_curr['focusx'];
$focusy = $pinwheel_slider_curr['focusy'];
}
$html .= '<div class="pinwheel_slideri carousel-feature '.$focuscrop_class.'" data-focus-x="'.$focusx.'" data-focus-y="'.$focusy.'" '.$pinwheel_slider_css['pinwheel_slideri'].'>
<!-- pinwheel_slideri -->';
$html = apply_filters('pinwheel_slideri_start_multi',$html,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$set,$data);
if($pinwheel_slider_curr['show_content']=='1'){
/* Content Transition */
$content_tran_class = $ctranstyle = '';
$excerpt_style = $pinwheel_slider_css['pinwheel_slider_span'];
$pinwheel_content_transition=get_post_meta($post_id, '_pinwheel_content_transition', true);
if($pinwheel_content_transition != '') {
/* Per Slide : Content Transition */
$content_tran_class = $pinwheel_content_transition;
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$content_duration=get_post_meta($post_id, '_pinwheel_content_duration', true);
$content_delay=get_post_meta($post_id, '_pinwheel_content_delay', true);
if($content_duration != "") $ctranstyle .= '-webkit-animation-duration: '.$content_duration.'s;-moz-animation-duration: '.$content_duration.'s;animation-duration: '.$content_duration.'s;';
if($content_delay != "") $ctranstyle .= '-webkit-animation-delay: '.$content_delay.'s;-moz-animation-delay: '.$content_delay.'s;animation-delay: '.$content_delay.'s;';
if($content_duration != "" || $content_delay != "")
$excerpt_style = substr_replace($pinwheel_slider_css['pinwheel_slider_span'], $ctranstyle.'"', -1);
}
} elseif( isset($pinwheel_slider_curr['content_transition']) && $pinwheel_slider_curr['content_transition'] != '' ) {
/* Slider : Content Transition */
$content_tran_class = $pinwheel_slider_curr['content_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$content_duration = $pinwheel_slider_curr['content_duration'];
$content_delay = $pinwheel_slider_curr['content_delay'];
if($content_duration != "") $ctranstyle .= '-webkit-animation-duration: '.$content_duration.'s;-moz-animation-duration: '.$content_duration.'s;animation-duration: '.$content_duration.'s;';
if($content_delay != "") $ctranstyle .= '-webkit-animation-delay: '.$content_delay.'s;-moz-animation-delay: '.$content_delay.'s;animation-delay: '.$content_delay.'s;';
if($content_duration != "" || $content_delay != "")
$excerpt_style = substr_replace($pinwheel_slider_css['pinwheel_slider_span'], $ctranstyle.'"', -1);
}
}
/* END - Content Transition */
if ($pinwheel_slider_curr['content_from'] == "slider_content") {
$slider_content = get_post_meta($post_id, 'slider_content', true);
}
if ($pinwheel_slider_curr['content_from'] == "excerpt") {
$slider_content = $post->post_excerpt;
}
$slider_content = strip_shortcodes( $slider_content );
$slider_content = stripslashes($slider_content);
$slider_content = str_replace(']]>', ']]>', $slider_content);
$slider_content = str_replace("\n","<br />",$slider_content);
$slider_content = strip_tags($slider_content, $pinwheel_slider_curr['allowable_tags']);
if(!$pinwheel_slider_curr['content_limit'] or $pinwheel_slider_curr['content_limit'] == '' or $pinwheel_slider_curr['content_limit'] == ' ')
$slider_excerpt = substr($slider_content,0,$pinwheel_slider_curr['content_chars']);
else
$slider_excerpt = pinwheel_slider_word_limiter( $slider_content, $limit = $pinwheel_slider_curr['content_limit'] );
//filter hook
$slider_excerpt=apply_filters('pinwheel_slide_excerpt',$slider_excerpt,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css);
$slider_excerpt='<span data-anim="'.$content_tran_class.'" class="" '.$excerpt_style.'> '.$slider_excerpt.'</span>';
}
else{
$slider_excerpt='';
}
//filter hook
$slider_excerpt=apply_filters('pinwheel_slide_excerpt_html_multi',$slider_excerpt,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$data);
$pinwheel_fields=$pinwheel_slider_curr['fields'];
$fields_html='';
if($pinwheel_fields and !empty($pinwheel_fields) ){
$fields=explode( ',', $pinwheel_fields );
if($fields){
foreach($fields as $field) {
$field_val = get_post_meta($post_id, $field, true);
if( $field_val and !empty($field_val) )
$fields_html .='<div class="pinwheel_'.$field.' pinwheel_fields">'.$field_val.'</div>';
}
}
}
$pinwheel_media = get_post_meta($post_id,'pinwheel_media',true);
if(!isset($pinwheel_slider_curr['img_pick'][0])) $pinwheel_slider_curr['img_pick'][0]='';
if(!isset($pinwheel_slider_curr['img_pick'][2])) $pinwheel_slider_curr['img_pick'][2]='';
if(!isset($pinwheel_slider_curr['img_pick'][3])) $pinwheel_slider_curr['img_pick'][3]='';
if(!isset($pinwheel_slider_curr['img_pick'][5])) $pinwheel_slider_curr['img_pick'][5]='';
$custom_key = '';
if( isset( $pinwheel_slider_curr['img_pick'][0] ) && (isset ($pinwheel_slider_defset['img_pick'][1]) ) ){
if($pinwheel_slider_curr['img_pick'][0] == '1') {
$custom_key = array($pinwheel_slider_defset['img_pick'][1] );
}
}
if( empty($pinwheel_media) or $pinwheel_media=='' or !($pinwheel_media) ) {
if($pinwheel_slider_curr['img_pick'][2] == '1'){
$the_post_thumbnail = true;
}
else {
$the_post_thumbnail = false;
}
if($pinwheel_slider_curr['img_pick'][3] == '1'){
$attachment = true;
$order_of_image = $pinwheel_slider_curr['img_pick'][4];
}
else{
$attachment = false;
$order_of_image = '1';
}
if($pinwheel_slider_curr['img_pick'][5] == '1'){
$image_scan = true;
}
else {
$image_scan = false;
}
$gti_width = $pinwheel_slider_curr['img_width'];
$gti_height = $pinwheel_slider_curr['img_height'];
if(pinwheel_get_image_sizes( '','', $pinwheel_slider_curr['crop'] ) )
$extract_size = $pinwheel_slider_curr['crop'];
else $extract_size = 'full';
//Slide link anchor attributes
$a_attr='';$imglink='';
$a_attr=get_post_meta($post_id,'pinwheel_link_attr',true);
if( empty($a_attr) and isset( $pinwheel_slider_curr['a_attr'] ) ) $a_attr=$pinwheel_slider_curr['a_attr'];
$a_attr_orig=$a_attr;
if( isset($pinwheel_slider_curr['pphoto']) and $pinwheel_slider_curr['pphoto'] == '1' ){
if($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'pphoto_box') {
$a_attr.='rel="prettyPhoto"';
$a_attr_lbox='pphoto-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'swipe_box') {
$a_attr_lbox='swipe-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'smooth_box') {
$a_attr_lbox='smooth-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'nivo_box') {
$a_attr.='data-lightbox-gallery="pinwheel_gallery" data-lightbox-type="iframe"';
$a_attr_lbox ='';
}
else {
$a_attr_lbox ='';
}
if(!empty($pinwheel_slide_redirect_url) and isset($pinwheel_slide_redirect_url))
$imglink=$pinwheel_slide_redirect_url;
else $imglink='1';
}else {
$a_attr_lbox ='';
// Added For Notice
$a_attr_orig = '';
}
/* Image Transition */
$pinwheel_img_transition=get_post_meta($post_id, '_pinwheel_img_transition', true);
$tran_class = $itranstyle ='';
$img_style = $pinwheel_slider_css['pinwheel_slider_thumbnail'];
if($pinwheel_img_transition != '') {
/* Per Slide : Image Transition */
$tran_class = $pinwheel_img_transition;
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$img_delay=get_post_meta($post_id, '_pinwheel_img_delay', true);
$img_duration=get_post_meta($post_id, '_pinwheel_img_duration', true);
if($img_duration != "") $itranstyle .= '-webkit-animation-duration: '.$img_duration.'s;-moz-animation-duration: '.$img_duration.'s;animation-duration: '.$img_duration.'s;';
if($img_delay != "") $itranstyle .= '-webkit-animation-delay: '.$img_delay.'s;-moz-animation-delay: '.$img_delay.'s;animation-delay: '.$img_delay.'s;';
if($img_duration != "" || $img_delay != "")
$img_style = substr_replace($pinwheel_slider_css['pinwheel_slider_thumbnail'], $itranstyle.'"', -1);
}
} elseif( isset($pinwheel_slider_curr['img_transition']) && $pinwheel_slider_curr['img_transition'] != '' ) {
/* Slider : Image Transition */
$tran_class = $pinwheel_slider_curr['img_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$img_duration = $pinwheel_slider_curr['img_duration'];
$img_delay = $pinwheel_slider_curr['img_delay'];
if($img_duration != "") $itranstyle .= '-webkit-animation-duration: '.$img_duration.'s;-moz-animation-duration: '.$img_duration.'s;animation-duration: '.$img_duration.'s;';
if($img_delay != "") $itranstyle .= '-webkit-animation-delay: '.$img_delay.'s;-moz-animation-delay: '.$img_delay.'s;animation-delay: '.$img_delay.'s;';
if($img_duration != "" || $img_delay != "")
$img_style = substr_replace($pinwheel_slider_css['pinwheel_slider_thumbnail'], $itranstyle.'"', -1);
}
}
$default_image=(isset($pinwheel_slider_curr['default_image']))?($pinwheel_slider_curr['default_image']):('false');
$image_title_text=(isset($pinwheel_slider_curr['image_title_text']))?($pinwheel_slider_curr['image_title_text']):('0');
$curr_skin=$pinwheel_slider_curr['stylesheet'];
$pphoto=isset($pinwheel_slider_curr['pphoto'])?$pinwheel_slider_curr['pphoto']:'0';
$img_args = array(
'custom_key' => $custom_key,
'post_id' => $post_id,
'attachment' => $attachment,
'size' => $extract_size,
'the_post_thumbnail' => $the_post_thumbnail,
'default_image' => $default_image,
'order_of_image' => $order_of_image,
'link_to_post' => true,
'image_class' => 'pinwheel_slider_thumbnail carousel-image',
'image_scan' => $image_scan,
'tran_data' => $tran_class,
'width' => $gti_width,
'height' => $gti_height,
'echo' => false,
'permalink' => $img_permalink,
'timthumb'=>$timthumb,
'style'=> $img_style,
'a_attr'=> $a_attr,
'a_attr_lbox'=>$a_attr_lbox,
'imglink'=>$imglink,
'curr_skin'=>$curr_skin,
'image_title_text'=>$image_title_text,
'pphotoenable'=>$pphoto
);
$pinwheel_large_image=pinwheel_sslider_get_the_image($img_args);
}
else{
$pinwheel_large_image=$pinwheel_media;
}
//filter hook
$pinwheel_large_image=apply_filters('pinwheel_large_image',$pinwheel_large_image,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css);
$html.= $pinwheel_large_image;
//Added for video - Start
$pinwheel_ytburl=get_post_meta($post_id, '_pinwheel_youtubeurl', true);
$pinwheel_mpurl=get_post_meta($post_id, '_pinwheel_mp4url', true);
$pinwheel_weburl=get_post_meta($post_id, '_pinwheel_webmurl', true);
$pinwheel_ogurl=get_post_meta($post_id, '_pinwheel_oggurl', true);
$vdohtml=pinwheel_slide_video($slider_handle.$pinwheel_sldr_j, $pinwheel_ytburl, $pinwheel_mpurl, $pinwheel_weburl, $pinwheel_ogurl, $pinwheel_slider_curr['img_width'], $pinwheel_slider_curr['img_height']);
if(!empty($vdohtml))
$html.=$vdohtml;
//Added for video - End
/* Added for embeding any shortcode on slide - start */
$pinwheel_eshortcode=get_post_meta($post_id,'_pinwheel_sslider_embedshortcode',true);
if(!empty($pinwheel_eshortcode)){
$shortcode_html=do_shortcode($pinwheel_eshortcode);
$html.='<div class="pinwheel_eshortcode '.$tran_class.'">'.$shortcode_html.'</div>';
}
/* Added for embeding any shortcode on slide - end */
if ($pinwheel_slider_curr['image_only'] == '1') {
$html .= '<!-- /pinwheel_slideri -->
</div>';
}
else {
/* Per Slide : Title Transition */
$title_tran_class = $ttranstyle ='';
$title_style = $pinwheel_slider_css['pinwheel_slider_h2'];
$pinwheel_title_transition=get_post_meta($post_id, '_pinwheel_title_transition', true);
if($pinwheel_title_transition != '') {
$title_tran_class = $pinwheel_title_transition;
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$title_duration=get_post_meta($post_id, '_pinwheel_title_duration', true);
$title_delay=get_post_meta($post_id, '_pinwheel_title_delay', true);
if($title_duration != "") $ttranstyle .= '-webkit-animation-duration: '.$title_duration.'s;-moz-animation-duration: '.$title_duration.'s;animation-duration: '.$title_duration.'s;';
if($title_delay != "") $ttranstyle .= '-webkit-animation-delay: '.$title_delay.'s;-moz-animation-delay: '.$title_delay.'s;animation-delay: '.$title_delay.'s;';
if($title_duration != "" || $title_delay != "")
$title_style = substr_replace($pinwheel_slider_css['pinwheel_slider_h2'], $ttranstyle.'"', -1);
}
} elseif( isset($pinwheel_slider_curr['ptitle_transition']) && $pinwheel_slider_curr['ptitle_transition'] != '' ) {
/* Slider : Title Transition */
$title_tran_class = $pinwheel_slider_curr['ptitle_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$title_duration = $pinwheel_slider_curr['ptitle_duration'];
$title_delay = $pinwheel_slider_curr['ptitle_delay'];
if($title_duration != "") $ttranstyle .= '-webkit-animation-duration: '.$title_duration.'s;-moz-animation-duration: '.$title_duration.'s;animation-duration: '.$title_duration.'s;';
if($title_delay != "") $ttranstyle .= '-webkit-animation-delay: '.$title_delay.'s;-moz-animation-delay: '.$title_delay.'s;animation-delay: '.$title_delay.'s;';
if($title_duration != "" || $title_delay != "")
$title_style = substr_replace($pinwheel_slider_css['pinwheel_slider_h2'], $ttranstyle.'"', -1);
}
}
/* END - Title Transition */
if($pinwheel_slider_curr['title_element']=='1') {
$starth = '<h1 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h1>';
}
elseif($pinwheel_slider_curr['title_element']=='2') {
$starth = '<h2 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h2>';
}
elseif($pinwheel_slider_curr['title_element']=='3') {
$starth = '<h3 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h3>';
}
elseif($pinwheel_slider_curr['title_element']=='4') {
$starth = '<h4 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h4>';
}
elseif($pinwheel_slider_curr['title_element']=='5') {
$starth = '<h5 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h5>';
}
elseif($pinwheel_slider_curr['title_element']=='6') {
$starth = '<h6 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h6>';
}
if($permalink!='') {
if($pinwheel_slider_curr['show_ptitle']=='1') {
$slide_title = $starth.'<a href="'.$permalink.'" '.$pinwheel_slider_css['pinwheel_slider_h2_a'].' '.$a_attr_orig.'>'.$post_title.'</a>'.$endh;
}else{
$slide_title = "";
}
//filter hook
$slide_title=apply_filters('pinwheel_slide_title_html_multi',$slide_title,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$post_title,$data);
$adc="";
$adc_data=apply_filters('pinwheel_slide_multi_adc_html',$adc,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$post_title,$data);
if($type != "woo" && $type != "ecom" && $type !="eman" && $type !="ecal"){
$html .= '<div class="textshow"></div><div class="pinwheel_text carousel-caption" '.$pinwheel_slider_css['pinwheel_text'].'>'.$slide_title.$slider_excerpt.$fields_html;
if($pinwheel_slider_curr['show_content']=='1'){
//WPML
$morefield=$pinwheel_slider_curr['more'];
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option = '[pinwheel_slider_options'.$set.']more';
$morefield = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['more']);
}
$html .= '<p class="more"><a href="'.$permalink.'" '.$pinwheel_slider_css['pinwheel_slider_p_more'].' '.$a_attr_orig.'>'.$morefield.'</a></p>';
}
$html .= ' <!-- /pinwheel_slideri --><div class="texthide"></div></div></div>';
}else{
$html .= '<div class="textshow"></div><div class="pinwheel_text carousel-caption forwoocal" '.$pinwheel_slider_css['pinwheel_text'].'><div class="pinwheel_inner_content">'.$adc_data.'</div><div class="all-content">'.$slide_title.$slider_excerpt.$fields_html;
if($pinwheel_slider_curr['show_content']=='1'){
//WPML
$morefield=$pinwheel_slider_curr['more'];
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option = '[pinwheel_slider_options'.$set.']more';
$morefield = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['more']);
}
}
$html .= ' <!-- /pinwheel_slideri --><div class="texthide"></div></div></div></div>';
}
}
else{
if($pinwheel_slider_curr['show_ptitle']=='1') {
$slide_title = $starth.$post_title.$endh;
}else{
$slide_title = "";
}
//filter hook
$slide_title=apply_filters('pinwheel_slide_title_html_multi',$slide_title,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$post_title,$data);
$html .= '<div class="textshow"></div><div class="pinwheel_text carousel-caption" '.$pinwheel_slider_css['pinwheel_text'].'>
'.$slide_title.$slider_excerpt.$fields_html.'
<!-- /pinwheel_slideri -->
<div class="texthide"></div></div></div>'; }
}
}
//filter hook
$html=apply_filters('pinwheel_extract_html',$html,$pinwheel_sldr_j,$posts,$pinwheel_slider_curr);
if($out_echo == '1') {
echo $html;
}
$r_array = array( $pinwheel_sldr_j, $html);
$r_array=apply_filters('pinwheel_r_array',$r_array,$posts, $pinwheel_slider_curr,$set);
return $r_array;
}
function pinwheel_slider_get_multi($slider_handle,$r_array,$pinwheel_slider_curr,$set,$echo='1',$data=array()){
$skin='multi';
global $pinwheel_slider,$default_pinwheel_slider_settings;
$pinwheel_sldr_j = $r_array[0];
$pinwheel_slider_css = pinwheel_get_inline_css($set);
$html='';
if(isset($r_array) && $r_array[0] >= 1) : //is slider empty?
$pinwheel_slider_curr= populate_pinwheel_current($pinwheel_slider_curr);
$slider_id='';
if (isset ($data['slider_id'])) {
if( is_array($data)) $slider_id=$data['slider_id'];
}
if ( is_array($data) && isset($data['title'])){
if($data['title']!='' )$sldr_title=$data['title'];
else {
if($pinwheel_slider_curr['title_from']=='1' && !empty($slider_id) ) $sldr_title = get_pinwheel_slider_name($slider_id);
else {
$sldr_title = $pinwheel_slider_curr['title_text'];
//WPML integration
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option = '[pinwheel_slider_options'.$set.']title_text';
$sldr_title = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['title_text']);
}
}
}
}
else{
if( $pinwheel_slider_curr['title_from']=='1' && !empty($slider_id) ) $sldr_title = get_pinwheel_slider_name($slider_id);
else {
$sldr_title = $pinwheel_slider_curr['title_text'];
//WPML integration
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option = '[pinwheel_slider_options'.$set.']title_text';
$sldr_title = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['title_text']);
}
}
}
//filter hook
$sldr_title=apply_filters('pinwheel_slider_title',$sldr_title,$slider_handle,$pinwheel_slider_curr,$set);
//Added for auto update
if($pinwheel_slider_curr['sideslides']=='') $pinwheel_slider_curr['sideslides']='1';
$thumbnail='';
if(!isset($pinwheel_slider_curr['fouc']) or $pinwheel_slider_curr['fouc']=='' or $pinwheel_slider_curr['fouc']=='0' ){
$fouc_dom='jQuery("html").addClass("pinwheel_slider_fouc");jQuery(".pinwheel_slider_fouc .pinwheel_slider_set'.$set.'").hide();';
$fouc_ready='jQuery(document).ready(function() {
jQuery(".pinwheel_slider_fouc .pinwheel_slider_set'.$set.'").show();
});';
}
else{
$fouc_dom=$fouc_ready='';
}
if ($pinwheel_slider_curr['autostep'] != 1){ $automode='autoPlay: 0,';}
else{$automode='autoPlay: '. $pinwheel_slider_curr['time'] * 1000 .',';}
$prevnext='';$buttons='';
if ($pinwheel_slider_curr['prev_next'] != 1){
$prevnext='rightButtonTag: "#'. $slider_handle. '_next", leftButtonTag: "#'. $slider_handle. '_prev",';
$nexturl='css/buttons/'.$pinwheel_slider_curr['buttons'].'/next.png';
$prevurl='css/buttons/'.$pinwheel_slider_curr['buttons'].'/prev.png';
$buttons='<div id="'.$slider_handle.'_prev" class="pinwheel_prev" '.$pinwheel_slider_css['pinwheel_prev'].' ><img src="'. pinwheel_slider_plugin_url( $prevurl ).'" width="'.$pinwheel_slider_curr['navimg_w'].'" height="'. $pinwheel_slider_curr['navimg_ht'].'" /></div>
<div id="'.$slider_handle.'_next" class="pinwheel_next" '. $pinwheel_slider_css['pinwheel_next'].' ><img src="'. pinwheel_slider_plugin_url( $nexturl ).'" width="'. $pinwheel_slider_curr['navimg_w'].'" height="'. $pinwheel_slider_curr['navimg_ht'].'" /></div>';
}
$trackerIndividual='';
if ($pinwheel_slider_curr['navnum'] == "0"){
$trackerIndividual='trackerIndividual: false,';
}
$trackerSummation='';
if ($pinwheel_slider_curr['navsum'] == "0"){
$trackerSummation='trackerSummation: false,';
}
$captionBelow='';
if( $pinwheel_slider_curr['overlay_text']!='1' ) {
$captionBelow='captionBelow:true,';
}
if(!empty($sldr_title)) {
$sldr_title = '<div class="sldr_title" '.$pinwheel_slider_css['sldr_title'].'>'. $sldr_title .'</div>';
}
$html=$html.'<script type="text/javascript"> '.$fouc_ready;
$dimensions='';
$dimensions='largeFeatureWidth:'.$pinwheel_slider_curr['img_width'].',
largeFeatureHeight:'.$pinwheel_slider_curr['img_height'].',
smallFeatureWidth:'.$pinwheel_slider_curr['sfw'].',
smallFeatureHeight:'.$pinwheel_slider_curr['sfh'].',';
$preload='true';
if($pinwheel_slider_curr['minimize_content']=='1')
$minimize='true';
else $minimize='false';
if($pinwheel_slider_curr['pphoto']=='1')
$pretty='true';
else $pretty='false';
// WooCommerce Integration
wp_enqueue_script( 'pinwheel_rateit_js', pinwheel_slider_plugin_url( 'js/jquery.rateit.js' ),array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'pinwheel_rateit_css', pinwheel_slider_plugin_url( 'css/css/rateit.css' ),false, PINWHEEL_SLIDER_VER, 'all');
wp_enqueue_script( 'pinwheel-slider1', pinwheel_slider_plugin_url( 'js/pinwheelAlt.js' ),array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_script( 'easing', pinwheel_slider_plugin_url( 'js/jquery.easing.js' ),array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_script( 'jquery.touchwipe', pinwheel_slider_plugin_url( 'js/jquery.touchwipe.js' ),array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_script( 'jquery.focuspoint', pinwheel_slider_plugin_url( 'js/jquery.focuspoint.js' ),array('jquery'), PINWHEEL_SLIDER_VER, false);
$sname = str_replace("-", "_", $slider_handle.'_c');
$html=$html.'jQuery(document).ready(function() {
args={
flankingItems:'.$pinwheel_slider_curr['sideslides'].',
'.$automode.$trackerIndividual.$trackerSummation.$captionBelow.'
speed:'.$pinwheel_slider_curr['speed']*1000 .',
animationEasing:"'.$pinwheel_slider_curr['easing'].'",
separation:'.$pinwheel_slider_curr['separation'].',
forcedImageWidth: '.$pinwheel_slider_curr['img_width'].',
forcedImageHeight: '.$pinwheel_slider_curr['img_height'].',
horizon:'.($pinwheel_slider_curr['height']/2).',
sizeMultiplier:'.$pinwheel_slider_curr['sizemultiplier'].',
sliderMaxWidth:'.$pinwheel_slider_curr['width'].',
sliderMaxHeight:'.$pinwheel_slider_curr['height'].',
minimize:'.$minimize.',
prettyphoto:'.$pretty.',
slider_handle:"'.$slider_handle.'",
timthumb:'.$pinwheel_slider_curr['timthumb'].'
};
var '.$sname.' = jQuery("#'.$slider_handle.'").pinwheelAlt(args);';
if($pinwheel_slider_curr['disableresize']!='1'){
$html=$html.'jQuery(window).on("debouncedresize",function(){
'.$sname.'.reload(args);
});';
}
$html=$html.'jQuery("#'.$slider_handle.'_prev").bind("click", function () {
'.$sname.'.prev();
return false;
});
jQuery("#'.$slider_handle.'_next").bind("click", function () {
'.$sname.'.next();
return false;
});
jQuery("#'.$slider_handle.'").touchwipe({
wipeLeft: function() {
'.$slider_handle.'_c.next();
},
wipeRight: function() {
'.$slider_handle.'_c.prev();
},
preventDefaultEvents: false
});';
if(isset($pinwheel_slider_css['pinwheel_ecom_add_to_cart']) && !empty($pinwheel_slider_css['pinwheel_ecom_add_to_cart'])) {
$html=$html.'jQuery("#'.$slider_handle.' .wpsc_buy_button").css('.$pinwheel_slider_css['pinwheel_ecom_add_to_cart'].');';
}
if($pinwheel_slider_curr['woo_adc_text'] != $default_pinwheel_slider_settings['woo_adc_text'] )
$html=$html.'jQuery(".wpsc_buy_button").val("'.$pinwheel_slider_curr['woo_adc_text'].'");';
$html=$html.' });';
if($pinwheel_slider_curr['pphoto'] == '1') {
$lightbox_script='';
if($pinwheel_slider_curr['lbox_type'] == 'pphoto_box') {
wp_enqueue_script( 'jquery.prettyPhoto', pinwheel_slider_plugin_url( 'js/jquery.prettyPhoto.js' ), array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'prettyPhoto_css', pinwheel_slider_plugin_url( 'css/css/prettyPhoto.css' ), false, PINWHEEL_SLIDER_VER, 'all');
$lightbox_script='jQuery(document).ready(function(){
jQuery("a[rel^=\'prettyPhoto\']").prettyPhoto({deeplinking: false,social_tools:false});
jQuery("#'.$slider_handle.' .pinwheel_slideri").hover(function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").stop(true).fadeIn(300);
},
function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").fadeOut(300);
});
});';
}
if($pinwheel_slider_curr['lbox_type'] == 'swipe_box') {
wp_enqueue_script( 'jquery.swipebox', pinwheel_slider_plugin_url( 'js/jquery.swipebox.js' ), array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'swipebox_css', pinwheel_slider_plugin_url( 'css/css/swipebox.css' ), false, PINWHEEL_SLIDER_VER, 'all');
$lightbox_script='jQuery(document).ready(function(){
jQuery("a[class^=\'swipebox\']").swipebox();
jQuery("#'.$slider_handle.' .pinwheel_slideri").hover(function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").stop(true).fadeIn(300);
},
function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").fadeOut(300);
});
});';
}
if($pinwheel_slider_curr['lbox_type'] == 'nivo_box') {
wp_enqueue_script( 'jquery.nivobox', pinwheel_slider_plugin_url( 'js/nivo-lightbox.js' ), array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'nivobox_css', pinwheel_slider_plugin_url( 'css/css/nivobox.css' ), false, PINWHEEL_SLIDER_VER, 'all');
$lightbox_script='jQuery(document).ready(function(){
jQuery("a[class^=\'pinwheel_thumb_anchor\']").nivoLightbox();
jQuery("#'.$slider_handle.' .pinwheel_slideri").hover(function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").stop(true).fadeIn(300);
},
function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").fadeOut(300);
});
});';
}
// Photo box
if($pinwheel_slider_curr['lbox_type'] == 'photo_box') {
wp_enqueue_script( 'jquery.photobox', pinwheel_slider_plugin_url( 'js/jquery.photobox.js' ), array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'photobox_css', pinwheel_slider_plugin_url( 'css/css/photobox.css' ), false, PINWHEEL_SLIDER_VER, 'all');
$lightbox_script='jQuery(document).ready(function(){
jQuery(".pinwheel_slider_handle").photobox(\'a.pinwheel_thumb_anchor\');
jQuery("#'.$slider_handle.' .pinwheel_slideri").hover(function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").stop(true).fadeIn(300);
},
function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").fadeOut(300);
});
});';
}
// smooth box
if($pinwheel_slider_curr['lbox_type'] == 'smooth_box') {
wp_enqueue_script( 'jquery.smoothbox', pinwheel_slider_plugin_url( 'js/smoothbox.js' ), array('jquery'), PINWHEEL_SLIDER_VER, false);
wp_enqueue_style( 'smoothbox_css', pinwheel_slider_plugin_url( 'css/css/smoothbox.css' ), false, PINWHEEL_SLIDER_VER, 'all');
$lightbox_script='jQuery(document).ready(function(){
jQuery("#'.$slider_handle.' .pinwheel_slideri").hover(function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").stop(true).fadeIn(300);
},
function(){
jQuery("#'.$slider_handle.' .pinwheel_center_slide .pinwheel_zoom").fadeOut(300);
});
});';
}
//filter hook
$lightbox_script=apply_filters('pinwheel_lightbox_inline',$lightbox_script);
$html.=$lightbox_script;
}
//action hook
do_action('pinwheel_global_script',$slider_handle,$pinwheel_slider_curr);
$handleclass = isset( $data['vtype'] ) ? $data['vtype'] : '';
$html.='</script>
<noscript><p><strong>'. $pinwheel_slider['noscript'] .'</strong></p> Slider Powered by <a href="http://slidervilla.com/pinwheel/" title="Pinwheel WordPress Slider Plugin" target="_blank">Pinwheel WordPress Slider Plugin.</a></noscript>
<div class="pinwheel_slider pinwheel_multi pinwheel_slider_set'. $set .' '.$handleclass.'" '.$pinwheel_slider_css['pinwheel_slider'].'>
'.$sldr_title.$buttons.'
<div id="'.$slider_handle.'" class="pinwheel_slider_handle" '.$pinwheel_slider_css['pinwheel_slider_handle'].'>
'. $r_array[1] .'
</div>
</div>';
$html.='<script type="text/javascript">'.$fouc_dom.'</script>';
$html=apply_filters('pinwheel_slider_html',$html,$r_array,$pinwheel_slider_curr,$set);
if($echo == '1') {echo $html; }
else { return $html; }
endif; //is slider empty?
}
function pinwheel_data_processor_multi($slides, $pinwheel_slider_curr,$out_echo,$set,$data=array()){
$skin='multi';
$default_pinwheel_slider_settings=get_pinwheel_slider_default_settings();
$pinwheel_slider_css = pinwheel_get_inline_css($set);
$html = $focuscrop_class = $focusx = $focusy = '';
$pinwheel_sldr_j = 0;
$i=0;
if(is_array($data)) extract($data,EXTR_PREFIX_ALL,'data');
foreach($default_pinwheel_slider_settings as $key=>$value){
if(!isset($pinwheel_slider_curr[$key])) $pinwheel_slider_curr[$key]='';
}
$slider_handle='';
if ( !empty($data_slider_handle) ) {
$slider_handle=$data_slider_handle;
}
foreach($slides as $slide) {
$id = $post_id = '';
if (isset ($slide->ID)) {$id = $post_id = $slide->ID;}
$post_title = stripslashes($slide->post_title);
$post_title = str_replace('"', '', $post_title);
//filter hook
if (isset ($id)) $post_title=apply_filters('pinwheel_post_title',$post_title,$id,$pinwheel_slider_curr,$pinwheel_slider_css);
$slider_content = $slide->post_content;
$pinwheel_slide_redirect_url = $slide->redirect_url;
$pinwheel_sslider_nolink = $slide->nolink;
trim($pinwheel_slide_redirect_url);
if(!empty($pinwheel_slide_redirect_url) and isset($pinwheel_slide_redirect_url)) {
$permalink = $pinwheel_slide_redirect_url;
}
else{
$permalink = $slide->url;
}
if($pinwheel_sslider_nolink=='1'){
$permalink='';
}
/* do not link from settings panel - 3.0 */
$img_permalink = $permalink;
if( $pinwheel_slider_curr['donotlink'] == '1' ) {
$permalink='';
if($pinwheel_slider_curr['pphoto'] != "1"){
$img_permalink ="";
}
}
$pinwheel_sldr_j++;
if($pinwheel_slider_curr['timthumb']=='2') {
$focuscrop_class = "focuscrop";
$focusx = $pinwheel_slider_curr['focusx'];
$focusy = $pinwheel_slider_curr['focusy'];
}
$html .= '<div class="pinwheel_slideri carousel-feature '.$focuscrop_class.'" data-focus-x="'.$focusx.'" data-focus-y="'.$focusy.'" '.$pinwheel_slider_css['pinwheel_slideri'].'>
<!-- pinwheel_slideri -->';
if($pinwheel_slider_curr['show_content']=='1'){
/* Content Transition */
$content_tran_class = $ctranstyle = '';
$excerpt_style = $pinwheel_slider_css['pinwheel_slider_span'];
$pinwheel_content_transition=get_post_meta($post_id, '_pinwheel_content_transition', true);
if( isset($pinwheel_slider_curr['content_transition']) && $pinwheel_slider_curr['content_transition'] != '' ) {
/* Slider : Content Transition */
$content_tran_class = $pinwheel_slider_curr['content_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$content_duration = $pinwheel_slider_curr['content_duration'];
$content_delay = $pinwheel_slider_curr['content_delay'];
if($content_duration != "") $ctranstyle .= '-webkit-animation-duration: '.$content_duration.'s;-moz-animation-duration: '.$content_duration.'s;animation-duration: '.$content_duration.'s;';
if($content_delay != "") $ctranstyle .= '-webkit-animation-delay: '.$content_delay.'s;-moz-animation-delay: '.$content_delay.'s;animation-delay: '.$content_delay.'s;';
if($content_duration != "" || $content_delay != "")
$excerpt_style = substr_replace($pinwheel_slider_css['pinwheel_slider_span'], $ctranstyle.'"', -1);
}
}
/* END - Content Transition */
if ($pinwheel_slider_curr['content_from'] == "slider_content") {
$slider_content = $slide->post_content;
}
if ($pinwheel_slider_curr['content_from'] == "excerpt") {
$slider_content = $slide->post_excerpt;
}
$slider_content = strip_shortcodes( $slider_content );
$slider_content = stripslashes($slider_content);
$slider_content = str_replace(']]>', ']]>', $slider_content);
$slider_content = str_replace("\n","<br />",$slider_content);
$slider_content = strip_tags($slider_content, $pinwheel_slider_curr['allowable_tags']);
if(!$pinwheel_slider_curr['content_limit'] or $pinwheel_slider_curr['content_limit'] == '' or $pinwheel_slider_curr['content_limit'] == ' ')
$slider_excerpt = substr($slider_content,0,$pinwheel_slider_curr['content_chars']);
else
$slider_excerpt = pinwheel_slider_word_limiter( $slider_content, $limit = $pinwheel_slider_curr['content_limit'] );
//filter hook
$slider_excerpt=apply_filters('pinwheel_slide_excerpt',$slider_excerpt,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css);
$slider_excerpt='<span data-anim="'.$content_tran_class.'" class="" '.$excerpt_style.'> '.$slider_excerpt.'</span>';
}
else{
$slider_excerpt='';
}
//filter hook
$slider_excerpt=apply_filters('pinwheel_slide_excerpt_html_multi',$slider_excerpt,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$data);
$pinwheel_fields=$pinwheel_slider_curr['fields'];
$fields_html='';
if($pinwheel_fields and !empty($pinwheel_fields) ){
$fields=explode( ',', $pinwheel_fields );
if($fields){
foreach($fields as $field) {
if (isset ($field)) $field_val = ( isset($slide->$field) ) ? ( $slide->$field ) : '' ;
if( $field_val and !empty($field_val) )
$fields_html .='<div class="pinwheel_'.$field.' pinwheel_fields">'.$field_val.'</div>';
}
}
}
//Slide link anchor attributes
$a_attr='';$imglink='';
if (isset ($slide->pinwheel_link_attr))
$a_attr=$slide->pinwheel_link_attr;
if( empty($a_attr) and isset( $pinwheel_slider_curr['a_attr'] ) ) $a_attr=$pinwheel_slider_curr['a_attr'];
$a_attr_orig=$a_attr;
if( isset($pinwheel_slider_curr['pphoto']) and $pinwheel_slider_curr['pphoto'] == '1' ){
if($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'pphoto_box') {
$a_attr.='rel="prettyPhoto"';
$a_attr_lbox='pphoto-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'swipe_box') {
$a_attr_lbox='swipe-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'smooth_box') {
$a_attr_lbox='smooth-box';
}
elseif($pinwheel_slider_curr['pphoto'] == '1' and $pinwheel_slider_curr['lbox_type'] == 'nivo_box') {
$a_attr.='data-lightbox-gallery="pinwheel_gallery" data-lightbox-type="iframe"';
$a_attr_lbox ='';
}
else {
$a_attr_lbox ='';
}
if(!empty($pinwheel_slide_redirect_url) and isset($pinwheel_slide_redirect_url))
$imglink=$pinwheel_slide_redirect_url;
else $imglink='1';
}
else {
$a_attr_lbox ='';
// Added For Notice
$a_attr_orig = '';
}
//For media images
if (isset ($slide->media)) $pinwheel_media = $slide->media;
if (isset ($slide->media_image)) $pinwheel_media_image = $slide->media_image;
(isset ($slide->eshortcode)) ? $pinwheel_eshortcode = $slide->eshortcode : $pinwheel_eshortcode = '';
$data_image_class=(!empty($data_image_class)?$data_image_class:'');
$data_default_image=(!empty($data_default_image)?$data_default_image:'');
$img_style = $pinwheel_slider_css['pinwheel_slider_thumbnail'];
if( ((empty($pinwheel_media) or $pinwheel_media=='' or !($pinwheel_media)) and (empty($pinwheel_media_image) or $pinwheel_media_image=='' or !($pinwheel_media_image)) ) or $data_media!='1' ) {
$width = $pinwheel_slider_curr['img_width'];
$height = $pinwheel_slider_curr['img_height'];
if(pinwheel_get_image_sizes( '','', $pinwheel_slider_curr['crop'] ) )
$extract_size = $pinwheel_slider_curr['crop'];
else $extract_size = 'full';
$classes[] = $extract_size;
$classes[] = 'pinwheel_slider_thumbnail';
$classes[] = $data_image_class;
$class = join( ' ', array_unique( $classes ) );
preg_match_all( '|<img.*?src=[\'"](.*?)[\'"].*?>|i', $slide->content_for_image, $matches );
if(isset($data_default_image))
$img_url=$data_default_image;
/* If there is a match for the image, return its URL. */
$order_of_image='';
if(isset($data['order'])) $order_of_image=$data['order'];
if($order_of_image > 0) $order_of_image=$order_of_image;
else $order_of_image = 0;
if ( isset( $matches ) && count($matches[1])<=$order_of_image) $order_of_image=count($matches[1]);
if ( isset( $matches ) && $matches[1][$order_of_image] )
$img_url = $matches[1][$order_of_image];
$width = ( ( $width ) ? ' width="' . esc_attr( $width ) . '"' : '' );
$height = ( ( $height ) ? ' height="' . esc_attr( $height ) . '"' : '' );
$img_html = '<img src="' . $img_url . '" class="' . esc_attr( $class ) . '"' . $width . $height . $pinwheel_slider_css['pinwheel_slider_thumbnail'] .' />';
//Prettyphoto Integration
$ipermalink=$img_permalink;
if($imglink=='1' and $img_permalink!='') $ipermalink=$img_url;
elseif($imglink=='') $ipermalink=$img_permalink;
else {
if($img_permalink!='')$ipermalink=$imglink;
}
if($pinwheel_slider_curr['pphoto'] == "1"){
$ipermalink=$img_url;
}
if($a_attr_lbox=='swipe-box') {
$photobox='swipebox pinwheel_thumb_anchor';
}
elseif($a_attr_lbox=='smooth-box') {
$photobox='sb pinwheel_thumb_anchor';
}
else {
$photobox='pinwheel_thumb_anchor';
}
if($img_permalink!='') {
$img_html = '<a class="'.$photobox.'" href="' . $ipermalink . '" title="'.$post_title.'" '.$a_attr.'>' . $img_html . '</a>';
}
$pinwheel_large_image=$img_html;
}
else{
if(!empty($pinwheel_media)){
$pinwheel_large_image=$pinwheel_media;
}
else{
$width = $pinwheel_slider_curr['img_width'];
$height = $pinwheel_slider_curr['img_height'];
$width = ( ( $width ) ? ' width="' . esc_attr( $width ) . '"' : '' );
$height = ( ( $height ) ? ' height="' . esc_attr( $height ) . '"' : '' );
if(pinwheel_get_image_sizes( '','', $pinwheel_slider_curr['crop'] ) )
$extract_size = $pinwheel_slider_curr['crop'];
else $extract_size = 'full';
$classes[] = $extract_size;
$classes[] = 'pinwheel_slider_thumbnail carousel-image';
$class = join( ' ', array_unique( $classes ) );
/* Added for embeding any shortcode on slide - start */
//Image Transition
$tran_class= $itranstyle = "";
if( isset($pinwheel_slider_curr['img_transition']) && $pinwheel_slider_curr['img_transition'] != '' ) {
/* Slider : Image Transition */
$tran_class = $pinwheel_slider_curr['img_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$img_duration = $pinwheel_slider_curr['img_duration'];
$img_delay = $pinwheel_slider_curr['img_delay'];
if($img_duration != "") $itranstyle .= '-webkit-animation-duration: '.$img_duration.'s;-moz-animation-duration: '.$img_duration.'s;animation-duration: '.$img_duration.'s;';
if($img_delay != "") $itranstyle .= '-webkit-animation-delay: '.$img_delay.'s;-moz-animation-delay: '.$img_delay.'s;animation-delay: '.$img_delay.'s;';
if($img_duration != "" || $img_delay != "")
$img_style = substr_replace($pinwheel_slider_css['pinwheel_slider_thumbnail'], $itranstyle.'"', -1);
}
}
if(!empty($pinwheel_media_image)) {
if(!empty($pinwheel_eshortcode)){
$shortcode_html=do_shortcode($pinwheel_eshortcode);
$pinwheel_large_image='<img src="'.$pinwheel_media_image.'" data-anim="'.$tran_class.'" style="'.$itranstyle.'" class="' . esc_attr( $class ) . '"' . $width . $height . '/>';
$pinwheel_large_image.='<div class="pinwheel_eshortcode">'.$shortcode_html.'</div>';
} else{
$pinwheel_large_image='<img src="'.$pinwheel_media_image.'" data-anim="'.$tran_class.'" style="'.$itranstyle.'" class="' . esc_attr( $class ) . '"' . $width . $height . '/>';
}
$img_url=$pinwheel_media_image;
}
else {
if(!empty($pinwheel_eshortcode)){
$shortcode_html=do_shortcode($pinwheel_eshortcode);
$pinwheel_large_image='<img src="'.$data_default_image.'" data-anim="'.$tran_class.'" style="'.$itranstyle.'" class="' . esc_attr( $class ) . '"' . $width . $height . '/>';
$pinwheel_large_image.='<div class="pinwheel_eshortcode">'.$shortcode_html.'</div>';
}else{
$pinwheel_large_image='<img src="'.$data_default_image.'" data-anim="'.$tran_class.'" style="'.$itranstyle.'" class="' . esc_attr( $class ) . '"' . $width . $height . '/>';
}
$img_url=$data_default_image;
}
//Prettyphoto Integration
$ipermalink=$img_permalink;
if($imglink=='1' and $img_permalink!='') $ipermalink=$img_url;
elseif($imglink=='') $ipermalink=$img_permalink;
else {
if($img_permalink!='')$ipermalink=$imglink;
}
if($pinwheel_slider_curr['pphoto'] == "1"){
$ipermalink=$img_url;
}
if($a_attr_lbox=='swipe-box') {
$photobox='swipebox pinwheel_thumb_anchor';
}
elseif($a_attr_lbox=='smooth-box') {
$photobox='sb pinwheel_thumb_anchor';
}
else {
$photobox='pinwheel_thumb_anchor';
}
if($img_permalink!='') {
$pinwheel_large_image = '<a class="'.$photobox.'" href="' . $ipermalink . '" title="'.$post_title.'" '.$a_attr.'>' . $pinwheel_large_image . '</a>';
}
}
}
//filter hook
$pinwheel_large_image=apply_filters('pinwheel_large_image',$pinwheel_large_image,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css);
$html .= $pinwheel_large_image;
if ($pinwheel_slider_curr['image_only'] == '1') {
$html .= '<!-- /pinwheel_slideri -->
</div>';
}
else {
/* Per Slide : Title Transition */
$title_tran_class = $ttranstyle ='';
$title_style = $pinwheel_slider_css['pinwheel_slider_h2'];
$pinwheel_title_transition=get_post_meta($post_id, '_pinwheel_title_transition', true);
if( isset($pinwheel_slider_curr['ptitle_transition']) && $pinwheel_slider_curr['ptitle_transition'] != '' ) {
/* Slider : Title Transition */
$title_tran_class = $pinwheel_slider_curr['ptitle_transition'];
if($pinwheel_slider_curr['stylesheet'] != 'sample') {
$title_duration = $pinwheel_slider_curr['ptitle_duration'];
$title_delay = $pinwheel_slider_curr['ptitle_delay'];
if($title_duration != "") $ttranstyle .= '-webkit-animation-duration: '.$title_duration.'s;-moz-animation-duration: '.$title_duration.'s;animation-duration: '.$title_duration.'s;';
if($title_delay != "") $ttranstyle .= '-webkit-animation-delay: '.$title_delay.'s;-moz-animation-delay: '.$title_delay.'s;animation-delay: '.$title_delay.'s;';
if($title_duration != "" || $title_delay != "")
$title_style = substr_replace($pinwheel_slider_css['pinwheel_slider_h2'], $ttranstyle.'"', -1);
}
}
/* END - Title Transition */
if($pinwheel_slider_curr['title_element']=='1') {
$starth = '<h1 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h1>';
}
elseif($pinwheel_slider_curr['title_element']=='2') {
$starth = '<h2 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h2>';
}
elseif($pinwheel_slider_curr['title_element']=='3') {
$starth = '<h3 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h3>';
}
elseif($pinwheel_slider_curr['title_element']=='4') {
$starth = '<h4 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h4>';
}
elseif($pinwheel_slider_curr['title_element']=='5') {
$starth = '<h5 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h5>';
}
elseif($pinwheel_slider_curr['title_element']=='6') {
$starth = '<h6 class="slider_htitle " data-anim="'.$title_tran_class.'" '.$title_style.'>';
$endh = '</h6>';
}
if($permalink!='') {
$slide_title = $starth.'<a href="'.$permalink.'" '.$pinwheel_slider_css['pinwheel_slider_h2_a'].' '.$a_attr_orig.'>'.$post_title.'</a>'.$endh;
//filter hook
$slide_title=apply_filters('pinwheel_slide_title_html_multi',$slide_title,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$post_title,$data);
$html .= '<div class="textshow"></div><div class="pinwheel_text carousel-caption" '.$pinwheel_slider_css['pinwheel_text'].'>'.$slide_title.$slider_excerpt.$fields_html;
if($pinwheel_slider_curr['show_content']=='1'){
$pinwheel_more=$pinwheel_slider_curr['more'];
if($pinwheel_more and !empty($pinwheel_more) ){
$html .= '<p class="more"><a href="'.$permalink.'" '.$pinwheel_slider_css['pinwheel_slider_p_more'].' '.$a_attr_orig.'>'.$pinwheel_slider_curr['more'].'</a></p>';
}
}
$html .= ' <!-- /pinwheel_slideri -->
<div class="texthide"></div></div></div>'; }
else{
$slide_title = $starth.$post_title.$endh;
//filter hook
$slide_title=apply_filters('pinwheel_slide_title_html_multi',$slide_title,$post_id,$pinwheel_slider_curr,$pinwheel_slider_css,$post_title,$data);
$html .= '<div class="textshow"></div><div class="pinwheel_text carousel-caption" '.$pinwheel_slider_css['pinwheel_text'].'>
'.$slide_title.$slider_excerpt.$fields_html.'
<!-- /pinwheel_slideri -->
<div class="texthide"></div></div></div>'; }
}
}
//filter hook
$html=apply_filters('pinwheel_extract_html',$html,$pinwheel_sldr_j,$slides,$pinwheel_slider_curr);
if($out_echo == '1') {
echo $html;
}
$r_array = array( $pinwheel_sldr_j, $html);
$r_array=apply_filters('pinwheel_r_array',$r_array,$slides, $pinwheel_slider_curr,$set);
return $r_array;
}
/**
* -----------------------------------------------------------------------------------------------------
* Filter to add Add-ons html fields in slide title html
*
* @return HTML including add-ons fields
* -----------------------------------------------------------------------------------------------------
**/
function pinwheel_slide_multi_title_html_filter($slide_title,$id,$pinwheel_slider_curr,$pinwheel_slider_css,$set,$data) {
$type = isset($data['type'])?$data['type']:'';
/**
* ---------------------------------------------------------------------------------------------
* Filter to add wooCommerce html fields in slide title html
*
* @return HTML including wooCommerce fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'woo' && class_exists('WooCommerce') ) {
$product = get_product( $id );
$onsell_id = wc_get_product_ids_on_sale();
$sym = get_woocommerce_currency_symbol();
$product_cat='';
$categories = get_the_terms($id, 'product_cat');
if( $categories && $pinwheel_slider_curr['enable_woocat'] == '1' ) {
$c=0;
$product_cat='<span class="pinwheel_woocat_wrap"><span class="pinwheel_woocat">';
foreach($categories as $category) {
$pro_cat=$category->name;
$cat_link=get_term_link($category,'product_cat');
$comma=', ';
if($c=='0')$comma='';
$product_cat.=$comma.'<a href='.$cat_link.' '.$pinwheel_slider_css['pinwheel_slide_cat'].'>'.$pro_cat.'</a>';
$c++;
}
$product_cat.='</span></span>';
}
$slide_title = $slide_title.$product_cat;
$review_tempcount=$product->get_rating_count();
if($review_tempcount>1) {
$review_count='('.$review_tempcount." Reviews)";
}
else {
$review_count='('.$review_tempcount." Review)";
}
$rating_count = $product->get_average_rating();
$average_rating = '';
if( $pinwheel_slider_curr['enable_woostar'] == '1' ) {
$average_rating ='<div class="slidewoorate" ><div class="rateit '.$pinwheel_slider_curr['nav_woo_star'].'" data-rateit-value="'.$rating_count.'" data-rateit-max="'.$rating_count.'" data-rateit-ispreset="true" data-rateit-starwidth="16" data-rateit-starheight="16" data-rateit-readonly="true"></div><span class="wooreview">'.$review_count.'</span></div>';
$slide_title .= $average_rating;
}
}
/**
* ---------------------------------------------------------------------------------------------
* Filter to add Ecommerce html fields in slide title html
*
* @return HTML including Ecommerce fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'ecom' && class_exists('WP_eCommerce') ) {
$product_cat='';
$categories = get_the_terms($id, 'wpsc_product_category');
if($categories && $pinwheel_slider_curr['enable_woocat'] == '1') {
$c=0;
$product_cat='<span class="pinwheel_woocat_wrap"><span class="pinwheel_woocat">';
foreach($categories as $category) {
$pro_cat=$category->name;
$cat_link=get_term_link($category,'wpsc_product_category');
$comma=', ';
if($c=='0')$comma='';
$product_cat.=$comma.'<a href='.$cat_link.' '.$pinwheel_slider_css['pinwheel_slide_cat'].'>'.$pro_cat.'</a>';
$c++;
}
$product_cat.='</span></span>';
}
// eCommerce
$product = get_post( $id );
// for average rating and review count
global $wpdb;
$get_average = $wpdb->get_results( $wpdb->prepare( "SELECT AVG(`rated`) AS `average`, COUNT(*) AS `count` FROM `" . WPSC_TABLE_PRODUCT_RATING . "` WHERE `productid`= %d ", $id ), ARRAY_A );
$average = floor( $get_average[0]['average'] );
$count = $get_average[0]['count'];
if($count>1) {
$review_count='('.$count." Reviews)";
}
else {
$review_count='('.$count." Review)";
}
$slide_star_html ='<div class="slidewoorate" >';
if( $pinwheel_slider_curr['enable_woostar'] == '1' ) {
$slide_star_html .= '<div class="rateit '.$pinwheel_slider_curr['nav_woo_star'].'" data-rateit-max="'.$average.'" data-rateit-value="'.$average.'" data-rateit-ispreset="true" data-rateit-starwidth="16" data-rateit-starheight="16" data-rateit-readonly="true"></div>';
}
$slide_star_html .= '<span class="wooreview">'.$review_count.'</span></div>';
$slide_title .= $product_cat.$slide_star_html;
}
return $slide_title;
}
add_filter('pinwheel_slide_title_html_multi', 'pinwheel_slide_multi_title_html_filter',10,6);
//***************************
/****
/****
*****************************/
/*************************
// Commerce and Event Data
**************************/
function pinwheel_slide_multi_adc_html_filter($adc_data,$id,$pinwheel_slider_curr,$pinwheel_slider_css,$set,$data) {
$type = isset($data['type'])?$data['type']:'';
/**
* ---------------------------------------------------------------------------------------------
* Filter to add wooCommerce html fields in slide title html
*
* @return HTML including wooCommerce fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'woo' && class_exists('WooCommerce') ) {
$product = get_product( $id );
$onsell_id = wc_get_product_ids_on_sale();
$sym = get_woocommerce_currency_symbol();
$sale_price=$product->get_sale_price();
$product_price=$sym.$product->regular_price;
$saleprice='';
$reg_amount = '';
if (in_array( $id, $onsell_id )) {
$reg_amount = '';
if( $pinwheel_slider_curr['enable_wooregprice'] == '1' ) {
$reg_amount='<strike>'.$product_price.'</strike>';
}
if($pinwheel_slider_curr['enable_woosprice'] == '1') {
$saleprice=$sym.$sale_price;
}
}
else {
if( $pinwheel_slider_curr['enable_wooregprice'] == '1' ) {
$reg_amount=$product_price;
}
}
$addtocart_link=$product->add_to_cart_url( );
//WPML intigration
$woo_adc_text = $pinwheel_slider_curr['woo_adc_text'];
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option='[pinwheel_slider_options'.$set.']woo_adc_text';
$woo_adc_text = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['woo_adc_text']);
}
$button_adc='';
if( $pinwheel_slider_curr['enable_wooaddtocart'] == '1' ) {
$button_adc='<a href="'.$addtocart_link.'" class="add_to_cart_button product_type_simple" data-product_id="'.$id.'" ><button '.$pinwheel_slider_css['pinwheel_woo_add_to_cart'].'>'.$woo_adc_text.'</button></a>';
}
$wooslideprice='<span class="regular" '.$pinwheel_slider_css['pinwheel_slide_wooprice'].'>'.$reg_amount.'</span><span class="sale-price" '.$pinwheel_slider_css['pinwheel_slide_woosaleprice'].'>'.$saleprice.'</span>'.$button_adc;
$adc_data .= $wooslideprice;
}
/**
* ---------------------------------------------------------------------------------------------
* Filter to add Ecommerce html fields in slide title html
*
* @return HTML including Ecommerce fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'ecom' && class_exists('WP_eCommerce') ) {
// eCom checkout link
$checkout_link='<a class="checkout_link" href='.get_option( 'shopping_cart_url' ).'>'.__( 'Go to Checkout', 'wpsc' ).'</a>';
// eCommerce
$product = get_post( $id );
$regular_price = get_product_meta( $id, 'price', true);
$sale_price = get_product_meta( $id, 'special_price' , true);
$adcbutton = '';
if( $pinwheel_slider_curr['enable_wooaddtocart'] == '1' ) {
$adcbutton = wpsc_add_to_cart_button($id,true);
}
$regular_price_currency = '';
if( $pinwheel_slider_curr['enable_wooregprice'] == '1' ) {
$regular_price_currency =wpsc_currency_display($regular_price);
}
$sale_price_currency = '';
if($pinwheel_slider_curr['enable_woosprice'] == '1') {
$sale_price_currency =wpsc_currency_display($sale_price);
}
if($sale_price==0) {
$slideprice='<span class="slideprice regular" '.$pinwheel_slider_css['pinwheel_slide_wooprice'].'>'.$regular_price_currency.'</span>'.$adcbutton.$checkout_link;
}
else {
$sale_regular = '';
if( $pinwheel_slider_curr['enable_wooregprice'] == '1' ) {
$sale_regular='<strike>'.$regular_price_currency.'</strike>';
}
$slideprice='<span class="regular" '.$pinwheel_slider_css['pinwheel_slide_wooprice'].'>'.$sale_regular.'</span><span class="sale-price" '.$pinwheel_slider_css['pinwheel_slide_woosaleprice'].'>'.$sale_price_currency.' </span>'.$adcbutton.$checkout_link;
}
$adc_data .= $slideprice;
}
/**
* ---------------------------------------------------------------------------------------------
* Filter to add Events Manager html fields in slide title html
*
* @return HTML including Events Manager fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'eman' && class_exists('EM_Object') ) {
$event = em_get_event($id, 'post_id');
$event_time = '<div class="eventtime"><p class="etime"> '.date_i18n( get_option( 'time_format' ), strtotime(substr( $event->event_start_time, 0, 5 )))." - ".date_i18n( get_option( 'time_format' ), strtotime(substr ( $event->event_end_time, 0, 5 ))).'</p></div>';
$event_date =$event->event_start_date;
if(!empty($event_date)){
$event_day = date_i18n( 'd' , strtotime($event_date) );
$event_month = date_i18n( 'M' , strtotime($event_date) );
$event_year = date_i18n( 'Y' , strtotime($event_date) );
$event_date = '<div class="eventdate"><p class="eventday">'.str_repeat(' ', 1).$event_day ."</p> ".$event_month." ".$event_year."</div>";
}
$slidedatetime = '';
if( $pinwheel_slider_curr['enable_eventdt'] == '1' ) {
$slidedatetime = '<div class ="slidedatetime" '.$pinwheel_slider_css['slide_eventm_datetime'].'>'.$event_date.''.$event_time.'</div>';
}
$adc_data .= $slidedatetime;
}
/**
* ---------------------------------------------------------------------------------------------
* Filter to add The Events Calendar html fields(Date, Time) in slide title html
*
* @return HTML including The Events Calendar fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'ecal' && class_exists('Tribe__Events__Main') ) {
$adc_data="";
$startdate =tribe_get_start_date($id, true, 'jS M, Y' ); /* 'D . F j Y g:i A' Mon . August 6 2014 10:00 AM Sun */
if(!empty($startdate)){
$event_day = tribe_get_start_date($id, true, 'd' );
$event_month = tribe_get_start_date($id, true, 'M' );
$event_year = tribe_get_start_date($id, true, 'Y' );;
}
$event_date = '<div class="eventdate"><p class="eventday">'.str_repeat(' ', 1).$event_day ."</p> ".$event_month." ".$event_year."</div>";
$starttime = tribe_get_start_date($id, true, get_option( 'time_format' ) );
$endtime = tribe_get_end_date($id, true, get_option( 'time_format' ) );
$event_time = '<div class="eventtime"><p class="etime">'.str_repeat(' ', 3).$starttime." - ".$endtime.'</p></div>';
$slidedatetime = '';
if( $pinwheel_slider_curr['enable_eventdt'] == '1' ) {
$slidedatetime = '<div class ="slidedatetime" '.$pinwheel_slider_css['slide_eventm_datetime'].'>'.$event_date.''.$event_time.'</div>';
}
$adc_data .= $slidedatetime;
}
return $adc_data;
}
add_filter('pinwheel_slide_multi_adc_html', 'pinwheel_slide_multi_adc_html_filter',10,6);
/**
* ---------------------------------------------------------------------------------------------
* Filter to add Add-ons sale tag field at slideri start
*
* @return HTML including wooCommerce field
* ---------------------------------------------------------------------------------------------
**/
function pinwheel_slideri_multi_start_filter($html,$id,$pinwheel_slider_curr,$pinwheel_slider_css,$set,$data) {
$type = isset($data['type'])?$data['type']:'';
/**
* ---------------------------------------------------------------------------------------------
* Filter to add wooCommerce sale tag field at slideri start
*
* @return HTML including wooCommerce field
* ---------------------------------------------------------------------------------------------
**/
if( ( $type == 'woo' && class_exists('WooCommerce') ) || ( $type == 'ecom' && class_exists('WP_eCommerce') ) ) {
//WPML intigration
$woo_sale_text = $pinwheel_slider_curr['woo_sale_text'];
if( function_exists('icl_plugin_action_links') && function_exists('icl_t') ) {
$pinwheel_option='[pinwheel_slider_options'.$set.']woo_sale_text';
$woo_sale_text = icl_t('pinwheel-slider-settings', $pinwheel_option, $pinwheel_slider_curr['woo_sale_text']);
}
$sale_tag='';
if($type == 'woo') {
$onsell_id = wc_get_product_ids_on_sale();
if (in_array( $id, $onsell_id )) {
if( $pinwheel_slider_curr['enable_woosalestrip'] == '1' ) {
$sale_tag = '<div class="woo_sale" '.$pinwheel_slider_css['pinwheel_woo_sale_strip'].'><span>'.$woo_sale_text.'</span></div>';
}
}
}
if($type == 'ecom') {
$sale_price = get_product_meta( $id, 'special_price' , true);
if($sale_price != 0 ) {
if( $pinwheel_slider_curr['enable_woosalestrip'] == '1' ) {
$sale_tag = '<div class="woo_sale" '.$pinwheel_slider_css['pinwheel_woo_sale_strip'].'><span>'.$woo_sale_text.'</span></div>';
}
}
}
$html .= $sale_tag;
}
return $html;
}
add_filter('pinwheel_slideri_start_multi', 'pinwheel_slideri_multi_start_filter',10,6);
function pinwheel_slide_multi_excerpt_html_filter($slider_excerpt,$id,$pinwheel_slider_curr,$pinwheel_slider_css,$data) {
$type = isset($data['type'])?$data['type']:'';
/**
* ---------------------------------------------------------------------------------------------
* Filter to add Events Manager html fields(Category, Location) in slide excerpt html
*
* @return HTML including Events Manager fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'woo' || $type == 'ecom') {
$slider_excerpt = '';
return $slider_excerpt;
}
if($type == 'eman' && class_exists('EM_Object') ) {
$event = em_get_event($id, 'post_id');
$loc_id = $event->location_id;
$location = em_get_location($loc_id, $search_by = 'location_id');
$location_link = $location->guid;
$EM_Event_Recurring = $event->get_event_recurrence();
$freq_desc='';
if ($EM_Event_Recurring->recurrence_freq == 'daily') {
$freq_desc =__('(Everyday)', 'pinwheel-slider');
}elseif ($EM_Event_Recurring->recurrence_freq == 'weekly') {
$freq_desc = __("(Every Week)", 'pinwheel-slider');
}elseif ($EM_Event_Recurring->recurrence_freq == 'monthly') {
$freq_desc = __("(Every Month)", 'pinwheel-slider');
}elseif ($EM_Event_Recurring->recurrence_freq == 'yearly') {
$freq_desc .= __("(Every Year)", 'pinwheel-slider');
}
$event_addr='';
if($pinwheel_slider_curr['enable_eventadd']=='1') {
$event_addr= '<a class="pinwheel_eventaddr" href="'.$location_link.'"></a><span class="event_addr" '.$pinwheel_slider_css
['eventm_addr'].'>'.$location->location_name.' '.$location->location_address.' '.$location->location_state.' '.$location->location_country.' '.$freq_desc.'</span>';
}
$event_cat='';
$categories = get_the_terms($id,'event-categories');
if($categories) {
$c=0;
if($pinwheel_slider_curr['enable_eventcat']=='1') {
$event_cat='<div class="pinwheel_eventcat_wrap"><span class="pinwheel_eventcat">';
foreach($categories as $category) {
$cat_name=$category->name;
$cat_link=get_term_link($category,'event-categories');
$comma=', ';
if($c=='0')$comma='';
$event_cat.=$comma.'<a href='.$cat_link.' '.$pinwheel_slider_css['eventm_cat'].'>'.$cat_name.'</a>';
$c++;
}
$event_cat.='</span></div>';
}
}
$trimmed=trim($slider_excerpt);
if( $pinwheel_slider_curr['show_content']=='1' and !empty($trimmed) )
$slider_excerpt = '<div class="eventwrap" >'. $slider_excerpt.'</div>';
$slider_excerpt .= '<div class="event_address_wrap">'.$event_addr.'</div>'.$event_cat;
}
/**
* ---------------------------------------------------------------------------------------------
* Filter to add The Events Calendar html fields(Category, Location) in slide excerpt html
*
* @return HTML including The Events Calendar fields
* ---------------------------------------------------------------------------------------------
**/
if($type == 'ecal' && class_exists('Tribe__Events__Main') ) {
$eventaddress = tribe_get_full_address($id);
$gmaplink = tribe_get_map_link($id);
$event_addr = '';
if($pinwheel_slider_curr['enable_eventadd']=='1') {
$event_addr= '<a class="pinwheel_eventaddr" href="'.$gmaplink.'"></a><span class="event_addr" '.$pinwheel_slider_css['eventm_addr'].'>'.$eventaddress.'</span>';
}
$event_cat='';
$categories = get_the_terms($id,'tribe_events_cat');
if($categories) {
$c=0;
if($pinwheel_slider_curr['enable_eventcat']=='1') {
$event_cat='<div class="pinwheel_eventcat_wrap"><span class="pinwheel_eventcat">';
foreach($categories as $category) {
$cat_name=$category->name;
$cat_link=get_term_link($category,'event-categories');
$comma=', ';
if($c=='0')$comma='';
$event_cat.=$comma.'<a href='.$cat_link.' '.$pinwheel_slider_css['eventm_cat'].'>'.$cat_name.'</a>';
$c++;
}
$event_cat.='</span></div>';
}
}
$trimmed=trim($slider_excerpt);
if(!empty($trimmed) )
$slider_excerpt = '<div class="eventwrap" >'. $slider_excerpt.'</div>';
$slider_excerpt .= '<div class="event_address_wrap">'.$event_addr.'</div>'.$event_cat;
}
return $slider_excerpt;
}
add_filter('pinwheel_slide_excerpt_html_multi', 'pinwheel_slide_multi_excerpt_html_filter',10,6);
?>