Exemple #1
0
 protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     //print_r($item_array);
     $buffy = '';
     //checking the width of the tile and converting tags, quotes
     $smart_list_4_title = '';
     if (!empty($item_array['title'])) {
         $smart_list_4_title = $item_array['title'];
     }
     //creating each slide
     $buffy .= '<div class="td-item">';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'thumbnail');
     if (!empty($first_img_info[0])) {
         $buffy .= '<figure class="td-slide-smart-list-figure">
                                 <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '">
                                     <img src="' . $first_img_info[0] . '"/>
                                 </a>
                                 <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                            </figure>';
     }
     //adding description
     if (!empty($item_array['description'])) {
         $buffy .= '<div class="td-number-and-title"><h2><span class="td-sml-current-item-nr">' . $current_item_number . '</span><span class="td-sml-current-item-title">' . $smart_list_4_title . '</span></h2></div>
                           <span class="td-sml-description">' . $item_array['description'] . '</span>';
     }
     $buffy .= '</div>';
     return $buffy;
 }
 function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     //print_r($item_array);
     $buffy = '';
     //checking the width of the tile
     $smart_list_3_title = '';
     if (!empty($item_array['title'])) {
         //if we need to cut the title to a certain length, for top and bottom titles
         if (mb_strlen($item_array['title'], 'UTF-8') > 59) {
             $this->smart_list_3_title_between_controls = mb_substr($item_array['title'], 0, 59, 'UTF-8') . '...';
         } else {
             $this->smart_list_3_title_between_controls = $item_array['title'];
         }
         //if there are more then 28 chars, add `td-vertical-align-top` class for the main title in the slide
         $class_verticle_align_top = '';
         if (mb_strlen($item_array['title'], 'UTF-8') > 28) {
             $class_verticle_align_top = 'td-vertical-align-top';
         }
         //converting single and double quotes
         //we do this twice because if we check the converted (with htmlentities) string the title will be longer because the tags and quotes will become `&lt;`, `&quot;`, etc
         $smart_list_3_title = $item_array['title'];
     }
     //creating each slide
     $buffy .= '<div class="td-item" id="' . $this->smart_list_tip_3_unique_id . '_item_' . $current_item_id . '">';
     $buffy .= '<div class="td-number-and-title"><h2><span class="td-sml-current-item-nr">' . $current_item_number . '</span><span class="td-sml-current-item-title">' . $smart_list_3_title . '</span></h2></div>';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'medium');
     //image and caption
     $buffy_image = '';
     if (!empty($first_img_info[0])) {
         $buffy_image = '
                        <figure class="td-sml3-display-image td-slide-smart-list-figure">
                             <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" id="td-sml3-slide_' . $this->nr_slide_on_smart_list . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '" >
                                 <img src="' . $first_img_info[0] . '"/>
                             </a>
                             <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                        </figure>';
     }
     //adding description
     $temp_description = '';
     if (!empty($item_array['description'])) {
         //adding the title to the description; description comes between <p> and </p>, so we need to insert the title after first <p>
         $temp_description = substr($item_array['description'], 3);
         $buffy .= '<div class="td-sml-description">' . $buffy_image . $temp_description . '</div>';
         //bottom title
         //$buffy .= '<div class="td-sml3-bottom-title">' . $current_item_number . '. ' . $this->smart_list_3_title_between_controls . '</div>';
     }
     $buffy .= '</div>';
     $this->nr_slide_on_smart_list++;
     return $buffy;
 }
 protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     //print_r($item_array);
     $buffy = '';
     //checking the width of the tile
     $smart_list_5_title = '';
     if (!empty($item_array['title'])) {
         if (mb_strlen($item_array['title'], 'UTF-8') > 55) {
             $smart_list_5_title = mb_substr($item_array['title'], 0, 55, 'UTF-8') . '...';
         } else {
             $smart_list_5_title = $item_array['title'];
         }
     }
     //creating each slide
     $buffy .= '<div class="td-item">';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_1068x0');
     } else {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_696x0');
     }
     if (!empty($first_img_info[0])) {
         $buffy .= '
                         <figure class="td-slide-smart-list-figure td-slide-smart-list-5">
                         <span class="td-sml-current-item-nr">' . $current_item_number . '</span>
                             <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '">
                                 <img src="' . $first_img_info[0] . '"/>
                             </a>
                             <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                         </figure>';
     }
     //title
     $buffy .= '<div class="td-number-and-title"><h2 class="td-sml-current-item-title">' . $smart_list_5_title . '</h2></div>';
     //adding description
     if (!empty($item_array['description'])) {
         $buffy .= '<span class="td-sml-description">' . $item_array['description'] . '</span>';
     }
     $buffy .= '</div>';
     return $buffy;
 }
Exemple #4
0
 protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     //print_r($item_array);
     $buffy = '';
     // get the title
     $smart_list_1_title = '';
     if (!empty($item_array['title'])) {
         $smart_list_1_title = $item_array['title'];
     }
     //creating each slide
     $buffy .= '<div class="td-item" id="' . $this->smart_list_tip_1_unique_id . '_item_' . $current_item_id . '">';
     $buffy .= '<div class="td-number-and-title"><h2 class="td-sml-current-item-title">' . $current_item_number . '. ' . $smart_list_1_title . '</h2></div>';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_1068x0');
     } else {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_696x0');
     }
     if (!empty($first_img_info[0])) {
         $buffy .= '
                     <figure class="td-slide-smart-list-figure td-slide-smart-list-1">
                         <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" id="td-sml1-slide_' . $this->nr_slide_on_smart_list . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '">
                             <img src="' . $first_img_info[0] . '" />
                         </a>
                         <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                     </figure>
                     ';
     }
     //adding description
     if (!empty($item_array['description'])) {
         $buffy .= '<span class="td-sml-description">' . $item_array['description'] . '</span>';
     }
     $buffy .= '</div>';
     $this->nr_slide_on_smart_list++;
     return $buffy;
 }
Exemple #5
0
 protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     //print_r($item_array);
     $buffy = '';
     // render the pagination
     $buffy .= $this->callback_render_pagination();
     //creating each slide
     $buffy .= '<div class="td-item">';
     $buffy .= '<h2><span class="td-sml-current-item-title">' . $current_item_number . '. ' . $item_array['title'] . '</span></h2>';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     //adding description
     if (!empty($item_array['description'])) {
         $buffy .= '<span class="td-sml-description">' . $item_array['description'] . '</span>';
     }
     // ad smart list 6
     $buffy .= td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'smart_list_7'));
     if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_1068x0');
     } else {
         $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'td_696x0');
     }
     if (!empty($first_img_info[0])) {
         $buffy .= '
                         <figure class="td-slide-smart-list-figure td-slide-smart-list-7">
                             <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '">
                                 <img src="' . $first_img_info[0] . '"/>
                             </a>
                             <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                         </figure>';
     }
     // render the pagination
     $buffy .= $this->callback_render_pagination();
     $buffy .= '</div>';
     return $buffy;
 }
Exemple #6
0
 protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number)
 {
     $buffy = '';
     //get the title
     $smart_list_3_title = '';
     if (!empty($item_array['title'])) {
         $smart_list_3_title = $item_array['title'];
     }
     //creating each slide
     $buffy .= '<div class="td-item" id="' . $this->smart_list_tip_3_unique_id . '_item_' . $current_item_id . '">';
     $buffy .= '<div class="td-number-and-title"><h2><span class="td-sml-current-item-nr">' . $current_item_number . '</span><span class="td-sml-current-item-title">' . $smart_list_3_title . '</span></h2></div>';
     //get image info
     $first_img_all_info = td_util::attachment_get_full_info($item_array['first_img_id']);
     //image caption
     $first_img_caption = '';
     if (!empty($first_img_all_info['caption'])) {
         $first_img_caption = $first_img_all_info['caption'];
     }
     $first_img_info = wp_get_attachment_image_src($item_array['first_img_id'], 'medium');
     //image and caption
     $buffy_image = '';
     if (!empty($first_img_info[0])) {
         $buffy_image = '
                        <figure class="td-sml3-display-image td-slide-smart-list-figure">
                             <a class="td-sml-link-to-image" href="' . $first_img_all_info['src'] . '" id="td-sml3-slide_' . $this->nr_slide_on_smart_list . '" data-caption="' . esc_attr($first_img_all_info['caption'], ENT_QUOTES) . '" >
                                 <img src="' . $first_img_info[0] . '"/>
                             </a>
                             <figcaption class="td-sml-caption"><div>' . $first_img_caption . '</div></figcaption>
                        </figure>';
     }
     if (!empty($item_array['description'])) {
         $buffy .= '<div class="td-sml-description">' . $buffy_image . $item_array['description'] . '</div>';
     }
     $buffy .= '</div>';
     $this->nr_slide_on_smart_list++;
     return $buffy;
 }
 /**
  * v3 23 ian 2015
  * @param $thumbType
  * @return string
  */
 function get_image($thumbType)
 {
     global $page;
     //        if ( //check to see if the current single template is configured to show the featured image on the second page
     //            !isset( td_global::$single_templates_list[td_global::$cur_single_template]['show_featured_image_on_all_pages'] )
     //            or td_global::$single_templates_list[td_global::$cur_single_template]['show_featured_image_on_all_pages'] === false
     //        ){
     if (td_api_single_template::_check_show_featured_image_on_all_pages(td_global::$cur_single_template) === false) {
         //the post is configured to show the featured image only on the first page
         if (!empty($page) and $page > 1) {
             return '';
         }
     }
     //do not show the featured image if the global setting is set to hide - show the video preview regardless of the setting
     if (td_util::get_option('tds_show_featured_image') == 'hide' and get_post_format($this->post->ID) != 'video') {
         return '';
     }
     //handle video post format
     if (get_post_format($this->post->ID) == 'video') {
         //if it's a video post...
         $td_post_video = get_post_meta($this->post->ID, 'td_post_video', true);
         $td_video_support = new td_video_support();
         //render the video if the post has a video in the featured video section of the post
         if (!empty($td_post_video['td_video'])) {
             return $td_video_support->renderVideo($td_post_video['td_video']);
         }
     } else {
         //if it's a normal post, show the default thumb
         if ($this->post_has_thumb) {
             //get the featured image id + full info about the 640px wide one
             $featured_image_id = get_post_thumbnail_id($this->post->ID);
             $featured_image_info = td_util::attachment_get_full_info($featured_image_id, $thumbType);
             //get the full size for the popup
             $featured_image_full_size_src = td_util::attachment_get_src($featured_image_id, 'full');
             $buffy = '';
             $show_td_modal_image = td_util::get_option('tds_featured_image_view_setting');
             if (is_single()) {
                 if ($show_td_modal_image != 'no_modal') {
                     //wrap the image_html with a link + add td-modal-image class
                     $image_html = '<a href="' . $featured_image_full_size_src['src'] . '" data-caption="' . esc_attr($featured_image_info['caption'], ENT_QUOTES) . '">';
                     $image_html .= '<img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" itemprop="image" class="entry-thumb td-modal-image" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt'] . '" title="' . $featured_image_info['title'] . '"/>';
                     $image_html .= '</a>';
                 } else {
                     //no_modal
                     $image_html = '<img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" itemprop="image" class="entry-thumb" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt'] . '" title="' . $featured_image_info['title'] . '"/>';
                 }
             } else {
                 //on blog index page
                 $image_html = '<a href="' . $this->href . '"><img width="' . $featured_image_info['width'] . '" height="' . $featured_image_info['height'] . '" itemprop="image" class="entry-thumb" src="' . $featured_image_info['src'] . '" alt="' . $featured_image_info['alt'] . '" title="' . $featured_image_info['title'] . '"/></a>';
             }
             $buffy .= '<div class="td-post-featured-image">';
             // caption - put html5 wrapper on when we have a caption
             if (!empty($featured_image_info['caption'])) {
                 $buffy .= '<figure>';
                 $buffy .= $image_html;
                 $buffy .= '<figcaption class="wp-caption-text">' . $featured_image_info['caption'] . '</figcaption>';
                 $buffy .= '</figure>';
             } else {
                 $buffy .= $image_html;
             }
             $buffy .= '</div>';
             return $buffy;
         } else {
             return '';
             //the post has no thumb
         }
     }
 }
/**
 * @param string $output - is empty !!!
 * @param $atts
 * @param bool $content
 * @return mixed
 */
function td_gallery_shortcode($output = '', $atts, $content = false)
{
    $buffy = '';
    //check for gallery  = slide
    if (!empty($atts) and !empty($atts['td_select_gallery_slide']) and $atts['td_select_gallery_slide'] == 'slide') {
        $td_double_slider2_no_js_limit = 7;
        $td_nr_columns_slide = 'td-slide-on-2-columns';
        $nr_title_chars = 95;
        //check to see if we have or not sidebar on the page, to set the small images when need to show them on center
        if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') {
            $td_double_slider2_no_js_limit = 11;
            $td_nr_columns_slide = 'td-slide-on-3-columns';
            $nr_title_chars = 170;
        }
        $title_slide = '';
        //check for the title
        if (!empty($atts['td_gallery_title_input'])) {
            $title_slide = $atts['td_gallery_title_input'];
            //check how many chars the tile have, if more then 84 then that cut it and add ... after
            if (mb_strlen($title_slide, 'UTF-8') > $nr_title_chars) {
                $title_slide = mb_substr($title_slide, 0, $nr_title_chars, 'UTF-8') . '...';
            }
        }
        $slide_images_thumbs_css = '';
        $slide_display_html = '';
        $slide_cursor_html = '';
        $image_ids = explode(',', $atts['ids']);
        //check to make sure we have images
        if (count($image_ids) == 1 and !is_numeric($image_ids[0])) {
            return;
        }
        $image_ids = array_map('trim', $image_ids);
        //trim elements of the $ids_gallery array
        //generate unique gallery slider id
        $gallery_slider_unique_id = td_global::td_generate_unique_id();
        $cur_item_nr = 1;
        foreach ($image_ids as $image_id) {
            //get the info about attachment
            $image_attachment = td_util::attachment_get_full_info($image_id);
            //get images url
            $td_temp_image_url_80x60 = wp_get_attachment_image_src($image_id, 'td_80x60');
            //for the slide - for small images slide popup
            $td_temp_image_url_full = $image_attachment['src'];
            //default big image - for magnific popup
            //if we are on full wight (3 columns use the default images not the resize ones)
            if (td_global::$cur_single_template_sidebar_pos == 'no_sidebar') {
                $td_temp_image_url = wp_get_attachment_image_src($image_id, 'td_1021x580');
                //1021x580 images - for big slide
            } else {
                $td_temp_image_url = wp_get_attachment_image_src($image_id, 'td_0x420');
                //0x420 image sizes - for big slide
            }
            //check if we have all the images
            if (!empty($td_temp_image_url[0]) and !empty($td_temp_image_url_80x60[0]) and !empty($td_temp_image_url_full)) {
                //css for display the small cursor image
                $slide_images_thumbs_css .= '
                    #' . $gallery_slider_unique_id . '  .td-doubleSlider-2 .td-item' . $cur_item_nr . ' {
                        background: url(' . $td_temp_image_url_80x60[0] . ') 0 0 no-repeat;
                    }';
                //html for display the big image
                $class_post_content = '';
                if (!empty($image_attachment['description']) or !empty($image_attachment['caption'])) {
                    $class_post_content = 'td-gallery-slide-content';
                }
                //if picture has caption & description
                $figcaption = '';
                if (!empty($image_attachment['caption']) or !empty($image_attachment['description'])) {
                    $figcaption = '<figcaption class = "td-slide-caption ' . $class_post_content . '">';
                    if (!empty($image_attachment['caption'])) {
                        $figcaption .= '<div class = "td-gallery-slide-copywrite">' . $image_attachment['caption'] . '</div>';
                    }
                    if (!empty($image_attachment['description'])) {
                        $figcaption .= '<span>' . $image_attachment['description'] . '</span>';
                    }
                    $figcaption .= '</figcaption>';
                }
                $slide_display_html .= '
                    <div class = "td-slide-item td-item' . $cur_item_nr . '">
                        <figure class="td-slide-galery-figure td-slide-popup-gallery">
                            <a class="slide-gallery-image-link" href="' . $td_temp_image_url_full . '" title="' . $image_attachment['title'] . '"  data-caption="' . esc_attr($image_attachment['caption'], ENT_QUOTES) . '"  data-description="' . htmlentities($image_attachment['description'], ENT_QUOTES) . '">
                                <img src="' . $td_temp_image_url[0] . '" alt="' . htmlentities($image_attachment['alt'], ENT_QUOTES) . '">
                            </a>
                            ' . $figcaption . '
                        </figure>
                    </div>';
                //html for display the small cursor image
                $slide_cursor_html .= '
                    <div class = "td-button td-item' . $cur_item_nr . '">
                        <div class = "td-border"></div>
                    </div>';
                $cur_item_nr++;
            }
            //end check for images
        }
        //end foreach
        //check if we have html code for the slider
        if (!empty($slide_display_html) and !empty($slide_cursor_html)) {
            //get the number of slides
            $nr_of_slides = count($image_ids);
            if ($nr_of_slides < 0) {
                $nr_of_slides = 0;
            }
            $buffy = '
                <style type="text/css">
                    ' . $slide_images_thumbs_css . '
                </style>

                <div id="' . $gallery_slider_unique_id . '" class="' . $td_nr_columns_slide . '">
                    <div class="post_td_gallery">
                        <div class="td-gallery-slide-top">
                           <div class="td-gallery-title">' . $title_slide . '</div>

                            <div class="td-gallery-controls-wrapper">
                                <div class="td-gallery-slide-count"><span class="td-gallery-slide-item-focus">1</span> ' . __td('of', TD_THEME_NAME) . ' ' . $nr_of_slides . '</div>
                                <div class="td-gallery-slide-prev-next-but">
                                    <i class = "td-icon-left doubleSliderPrevButton"></i>
                                    <i class = "td-icon-right doubleSliderNextButton"></i>
                                </div>
                            </div>
                        </div>

                        <div class = "td-doubleSlider-1 ">
                            <div class = "td-slider">
                                ' . $slide_display_html . '
                            </div>
                        </div>

                        <div class = "td-doubleSlider-2">
                            <div class = "td-slider">
                                ' . $slide_cursor_html . '
                            </div>
                        </div>

                    </div>

                </div>
                ';
            $slide_javascript = '
                    //total number of slides
                    var ' . $gallery_slider_unique_id . '_nr_of_slides = ' . $nr_of_slides . ';

                    jQuery(document).ready(function() {
                        //magnific popup
                        jQuery("#' . $gallery_slider_unique_id . ' .td-slide-popup-gallery").magnificPopup({
                            delegate: "a",
                            type: "image",
                            tLoading: "Loading image #%curr%...",
                            mainClass: "mfp-img-mobile",
                            gallery: {
                                enabled: true,
                                navigateByImgClick: true,
                                preload: [0,1],
                                tCounter: \'%curr% ' . __td('of', TD_THEME_NAME) . ' %total%\'
                            },
                            image: {
                                tError: "<a href=\'%url%\'>The image #%curr%</a> could not be loaded.",
                                    titleSrc: function(item) {//console.log(item.el);
                                    //alert(jQuery(item.el).data("caption"));
                                    return item.el.attr("data-caption") + "<div>" + item.el.attr("data-description") + "<div>";
                                }
                            },
                            zoom: {
                                    enabled: true,
                                    duration: 300,
                                    opener: function(element) {
                                        return element.find("img");
                                    }
                            },

                            callbacks: {
                                change: function() {
                                    // Will fire when popup is closed
                                    jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("goToSlide", this.currItem.index + 1 );
                                }
                            }

                        });

                        jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider({
                            scrollbar: true,
                            snapToChildren: true,
                            desktopClickDrag: true,
                            infiniteSlider: true,
                            responsiveSlides: true,
                            navPrevSelector: jQuery("#' . $gallery_slider_unique_id . ' .doubleSliderPrevButton"),
                            navNextSelector: jQuery("#' . $gallery_slider_unique_id . ' .doubleSliderNextButton"),
                            scrollbarHeight: "2",
                            scrollbarBorderRadius: "0",
                            scrollbarOpacity: "0.5",
                            onSliderResize: td_gallery_resize_update_vars_' . $gallery_slider_unique_id . ',
                            onSliderLoaded: doubleSlider2Load_' . $gallery_slider_unique_id . ',
                            onSlideChange: doubleSlider2Load_' . $gallery_slider_unique_id . ',
                            keyboardControls:true
                        });

                        //small image slide
                        jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button").each(function(i) {
                            jQuery(this).bind("click", function() {
                                jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("goToSlide", i+1);
                            });
                        });

                        //check the number of slides
                        if(' . $gallery_slider_unique_id . '_nr_of_slides > ' . $td_double_slider2_no_js_limit . ') {
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").iosSlider({
                                desktopClickDrag: true,
                                snapToChildren: true,
                                snapSlideCenter: true,
                                infiniteSlider: true
                            });
                        } else {
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").addClass("td_center_slide2");
                        }

                        function doubleSlider2Load_' . $gallery_slider_unique_id . '(args) {
                            //var currentSlide = args.currentSlideNumber;
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2").iosSlider("goToSlide", args.currentSlideNumber);


                            //put a transparent border around all small sliders
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button .td-border").css("border", "3px solid #ffffff").css("opacity", "0.5");
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button").css("border", "0");

                            //put a white border around the focused small slide
                            jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button:eq(" + (args.currentSlideNumber-1) + ") .td-border").css("border", "3px solid #ffffff").css("opacity", "1");
                            //jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-2 .td-button:eq(" + (args.currentSlideNumber-1) + ")").css("border", "3px solid #ffffff");

                            //write the current slide number
                            td_gallery_write_current_slide_' . $gallery_slider_unique_id . '(args.currentSlideNumber);
                        }

                        //writes the current slider beside to prev and next buttons
                        function td_gallery_write_current_slide_' . $gallery_slider_unique_id . '(slide_nr) {
                            jQuery("#' . $gallery_slider_unique_id . ' .td-gallery-slide-item-focus").html(slide_nr);
                        }


                        /*
                        * Resize the iosSlider when the page is resided (fixes bug on Android devices)
                        */
                        function td_gallery_resize_update_vars_' . $gallery_slider_unique_id . '(args) {
                            if(tdDetect.isAndroid) {
                                setTimeout(function(){
                                    jQuery("#' . $gallery_slider_unique_id . ' .td-doubleSlider-1").iosSlider("update");
                                }, 1500);
                            }
                        }
                    });';
            td_js_buffer::add_to_footer($slide_javascript);
        }
        //end check if we have html code for the slider
    }
    //end if slide
    //!!!!!! WARNING
    //$return has to be != empty to overwride the default output
    return $buffy;
}