post_id = $post_id; $this->slides = avia_post_meta($this->post_id, 'slideshow'); $this->slidecount = count($this->slides); if(!$this->slidecount) return; $this->type = avia_post_meta($this->post_id, '_slideshow_type'); if($overwrite_small && (empty($this->type) || $this->type == 'small_caption')) { $this->type = $overwrite_small; } $this->autoplay = avia_post_meta($this->post_id, '_slideshow_autoplay'); $this->slide_duration = avia_post_meta($this->post_id, '_slideshow_duration'); switch($this->type) { case '2D_small_caption_welcome': $this->imagesize = "portfolio2"; break; case '2D_caption': $this->imagesize = "featured"; break; } } function description() { $output = ""; $buttonclass = 'dual_buttons'; global $avia_config; $title = avia_post_meta('_slideshow_welcome_title'); $text = avia_post_meta('_slideshow_welcome_text'); $linktext1 = avia_post_meta('_slideshow_welcome_button_1'); if($linktext1) { $link1 = avia_get_link($avia_config['meta'], '_slideshow_welcome_button_1_', $linktext1, $this->post_id); } $linktext2 = avia_post_meta('_slideshow_welcome_button_2'); if($linktext2) { $link2 = avia_get_link($avia_config['meta'], '_slideshow_welcome_button_2_', $linktext2, $this->post_id); } if(!$linktext1 || $linktext1 == $link1 || !$linktext2 || $linktext2 == $link2) { $buttonclass = 'single_buttons'; } $output .= "
"; $output .= "
"; $output .= "

".$title."

"; $output .= "
". wpautop( avia_remove_autop( nl2br( $text )))."
"; if($linktext1 || $linktext2) $output .= "
"; if($linktext1 && $linktext1 != $link1) $output .= "".$link1.""; if($linktext2 && $linktext2 != $link2) $output .= "".$link2.""; $output .= "
"; $output .= "
"; return $output; } function display() { $this->showcaption = true; if(!$this->type || $this->type == 'small_caption') return; $output = $shadow = ''; //add the cu3er javascript if(strpos($this->type, '3D') !== false) { //set fallback imagesize based on selected 3D slider if(strpos($this->type, 'welcome') !== false ) { $this->imagesize = 'portfolio2'; } else { $this->imagesize = 'featured'; } $output = $this->activate_cu3er(); } else { $shadow = ''; } //add the slide container $output .= "
"; //if a small slider with static text was choosen render the static text if(strpos($this->type, 'welcome') !== false) { $output .= $this->description(); } //add javascript slider eiter because the user chose it and also as fallback if the user doesnt have flash $output .= "
"; $output .= $this->slideshow(); $output .= $shadow; $output .= "
"; return $output; } function display_small($size = 'page', $force_display = false, $showcaption = true) { if(($force_display || $this->type == 'small_caption'|| $this->type == '' ) && is_array($this->slides) && !empty($this->slides[0]['slideshow_image'])) { $this->type = 'small_caption'; $this->imagesize = $size; $this->showcaption = $showcaption; return $this->slideshow(); } } function slideshow() { $counter = 1; $js_controller = 'autoslide_'.$this->autoplay; $js_controller .= ' autoslidedelay__'.$this->slide_duration; $output = "
"; $output .= ""; $output .= '
'; return $output; } ###################################################################### # XML & cu3er related functions ###################################################################### function generate_xml() { if(strpos($this->type, '3D') !== false) { $this->_build_xml_header(); foreach($this->slides as $slide_element) { $this->_build_xml_slides($slide_element); } $this->slideshow_xml .=''; } } function activate_cu3er() { $output = ""; $output .= ''."\n"; $output .= ''."\n"; $output .= ' '; return $output; } function _build_xml_slides($element) { if(is_numeric($element['slideshow_image'])) { $this->slideshow_xml .= ' imagesize3D, 'url').']]> '.avia_get_link($element, 'slideshow_', false, $this->post_id).' ' ; $this->_build_xml_transition($element); } } function _build_xml_transition($element) { $this->slideshow_xml .= 'slideshow_xml .= 'columns="'.$element['slice_vertical'].'" '; if(!empty($element['slice_horizontal'])) $this->slideshow_xml .= 'rows="'.$element['slice_horizontal'].'" '; if(!empty($element['direction'])) $this->slideshow_xml .= 'flipDirection="'.$element['direction'].'" '; if(!empty($element['order'])) $this->slideshow_xml .= 'flipOrder="'.$element['order'].'" '; if(!empty($element['element_depth'])) $this->slideshow_xml .= 'flipBoxDepth="'.$element['element_depth'].'" '; if(!empty($element['flip_depth'])) $this->slideshow_xml .= 'flipDepth="'.$element['flip_depth'].'" '; if(!empty($element['slideshow_transition'])) { switch($element['slideshow_transition']) { case "slide": $this->slideshow_xml .= 'type="2D" '; $this->slideshow_xml .= 'type2D="slide" '; $this->slideshow_xml .= 'flipEasing="Expo.easeInOut" '; break; case "90d": $this->slideshow_xml .= 'type="3D" '; $this->slideshow_xml .= 'flipAngle="90" '; $this->slideshow_xml .= 'flipEasing="Sine.easeOut" '; break; case "180d": $this->slideshow_xml .= 'type="3D" '; $this->slideshow_xml .= 'flipAngle="180" '; $this->slideshow_xml .= 'flipEasing="Sine.easeOut" '; break; case "fade": $this->slideshow_xml .= 'type="2D" '; $this->slideshow_xml .= 'type2D="fade" '; $this->slideshow_xml .= 'flipEasing="Expo.easeInOut" '; break; } } $this->slideshow_xml .='flipColor="0x878787" flipShader="none" flipOrderFromCenter="false" flipDuration=".6" flipDelay=".15" flipDelayRandomize=".5" />'; } function _build_xml_header() { $bg_image = $shadow = $camera = $slides = $branding = $controlls = $autoplayer = $prevnext = $description =''; $color_1 = substr(avia_get_option('color_1','#555555'),1); switch ($this->type) { case 'tablet_3D_welcome': //tablet 3D slider $bg_image =' '; $prevnext = ' false false false false '; $camera = ''; $this->imagesize3D = $this->type; $slides = ''; $branding = ''; $autoplayer = ''; $controlls = ' '; break; case '3D_small_welcome': //small 3D slider $this->imagesize3D = 'portfolio2'; $camera = ''; $shadow = ''; $slides = ''; $branding = ''; $autoplayer = ''; $controlls = ' '; break; case '3D_caption': //fullsize 3D slider $color_1 = "000000"; $this->imagesize3D = 'featured'; $prevnext = ' true true true true '; $camera = ''; $shadow = ''; $slides = ''; $branding = ''; $autoplayer = ''; $controlls = ' '; $description = ' true true true '; break; } //gerneric mask with defaults. the slider specific vars are filled in here $this->slideshow_xml .= ' 0 502 472 0xffffff '.$bg_image.' 1 '.$this->autoplay.' false '.$branding.' true true true '.$camera.$shadow.' '.$autoplayer.' true false '.$prevnext.' '.$controlls.' false false '.$description.' '.$slides; } }