Example #1
0
function wppa_slide_filmstrip($opt = '')
{
    // A single image slideshow needs no navigation
    if (wppa('is_single')) {
        return;
    }
    $do_it = false;
    // Init
    if (is_feed()) {
        $do_it = true;
    } else {
        // Not a feed
        if ($opt != 'optional') {
            $do_it = true;
        } else {
            // optional
            if (wppa_switch('wppa_filmstrip')) {
                // optional and option on
                if (!wppa('is_slideonly')) {
                    $do_it = true;
                }
                // always except slideonly
            }
            if (wppa('film_on')) {
                $do_it = true;
            }
            // explicitly turned on
        }
    }
    if (!$do_it) {
        return;
    }
    // Don't do it
    $t = -microtime(true);
    $alb = wppa_get_get('album');
    $thumbs = wppa_get_thumbs();
    if (!$thumbs || count($thumbs) < 1) {
        return;
    }
    $preambule = wppa_get_preambule();
    $width = (wppa_opt('tf_width') + wppa_opt('tn_margin')) * (count($thumbs) + 2 * $preambule);
    $width += wppa_opt('tn_margin') + 2;
    $topmarg = wppa_opt('thumbsize') / 2 - 16;
    $height = wppa_opt('thumbsize') + wppa_opt('tn_margin');
    $height1 = wppa_opt('thumbsize');
    $marg = '42';
    // 32
    $fs = '24';
    $fw = '42';
    if (wppa_in_widget()) {
        $width /= 2;
        $topmarg /= 2;
        $height /= 2;
        $height1 /= 2;
        $marg = '21';
        $fs = '12';
        $fw = '21';
    }
    $conw = wppa_get_container_width();
    if ($conw < 1) {
        $conw *= 640;
    }
    $w = $conw - (2 * 6 + 2 * 42 + 2 * wppa_opt('bwidth'));
    /* 2*padding + 2*arrows + 2*border */
    if (wppa_in_widget()) {
        $w = $conw - (2 * 6 + 2 * 21 + 2 * wppa_opt('bwidth'));
    }
    /* 2*padding + 2*arrow + 2*border */
    $IE6 = 'width: ' . $w . 'px;';
    $pagsiz = round($w / (wppa_opt('thumbsize') + wppa_opt('tn_margin')));
    if (wppa_in_widget()) {
        $pagsiz = round($w / (wppa_opt('thumbsize') / 2 + wppa_opt('tn_margin') / 2));
    }
    wppa_add_js_page_data('<script type="text/javascript">');
    wppa_add_js_page_data('wppaFilmPageSize[' . wppa('mocc') . '] = ' . $pagsiz . ';');
    wppa_add_js_page_data('</script>');
    if (is_feed()) {
        wppa_out('<div style="' . __wcs('wppa-box') . __wcs('wppa-nav') . '">');
    } else {
        wppa_out('<div' . ' class="wppa-box wppa-nav"' . ' style="text-align:center; ' . __wcs('wppa-box') . __wcs('wppa-nav') . 'height:' . $height . 'px;"' . ' >' . '<div' . ' style="float:left; text-align:left; cursor:pointer; margin-top:' . $topmarg . 'px; width: ' . $fw . 'px; font-size: ' . $fs . 'px;"' . ' >' . '<a' . ' class="wppa-prev-' . wppa('mocc') . ' wppa-arrow"' . ' style="' . __wcs('wppa-arrow') . '"' . ' id="prev-film-arrow-' . wppa('mocc') . '"' . ' onclick="wppaFirst(' . wppa('mocc') . ');"' . ' title="' . __('First', 'wp-photo-album-plus') . '"' . ' >' . '&laquo;' . '</a>' . '<a' . ' class="wppa-prev-' . wppa('mocc') . ' wppa-arrow"' . ' style="' . __wcs('wppa-arrow') . '"' . ' id="prev-film-arrow-1-' . wppa('mocc') . '"' . ' onclick="wppaPrev(' . wppa('mocc') . ');"' . ' title="' . __('Previous', 'wp-photo-album-plus') . '"' . ' >' . '&lsaquo;' . '</a>' . '</div>' . '<div' . ' style="float:right; text-align:right; cursor:pointer; margin-top:' . $topmarg . 'px; width: ' . $fw . 'px; font-size: ' . $fs . 'px;"' . ' >' . '<a' . ' class="wppa-next-' . wppa('mocc') . ' wppa-arrow"' . ' style="' . __wcs('wppa-arrow') . '"' . ' id="next-film-arrow-1-' . wppa('mocc') . '"' . ' onclick="wppaNext(' . wppa('mocc') . ');"' . ' title="' . __('Next', 'wp-photo-album-plus') . '"' . ' >' . '&rsaquo;' . '</a>' . '<a' . ' class="wppa-next-' . wppa('mocc') . ' wppa-arrow"' . ' style="' . __wcs('wppa-arrow') . '"' . ' id="next-film-arrow-' . wppa('mocc') . '"' . ' onclick="wppaLast(' . wppa('mocc') . ');"' . ' title="' . __('Last', 'wp-photo-album-plus') . '"' . ' >' . '&raquo;' . '</a>' . '</div>' . '<div' . ' id="filmwindow-' . wppa('mocc') . '"' . ' class="filmwindow"' . ' style="' . $IE6 . ' position:absolute; display: block; height:' . $height . 'px; margin: 0 0 0 ' . $marg . 'px; overflow:hidden;"' . ' >' . '<div' . ' id="wppa-filmstrip-' . wppa('mocc') . '"' . ' style="height:' . $height1 . 'px; width:' . $width . 'px; max-width:' . $width . 'px;margin-left: -100px;"' . ' >');
    }
    wppa_out('<style type="text/css" scoped >' . '.thumbnail-frame { ' . wppa_get_thumb_frame_style(false, 'film') . ' }' . '.wppa-filmthumb-active { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }' . '</style>');
    $cnt = count($thumbs);
    $start = $cnt - $preambule;
    $end = $cnt;
    $idx = $start;
    // Preambule
    while ($idx < $end) {
        $glue = $cnt == $idx + 1 ? true : false;
        $ix = $idx;
        while ($ix < 0) {
            $ix += $cnt;
        }
        $thumb = $thumbs[$ix];
        wppa_do_filmthumb($thumb['id'], $ix, false, $glue);
        $idx++;
    }
    // Real thumbs
    $idx = 0;
    foreach ($thumbs as $tt) {
        $thumb = $tt;
        $glue = $cnt == $idx + 1 ? true : false;
        wppa_do_filmthumb($thumb['id'], $idx, true, $glue);
        $idx++;
    }
    // Postambule
    $start = '0';
    $end = $preambule;
    $idx = $start;
    while ($idx < $end) {
        $ix = $idx;
        while ($ix >= $cnt) {
            $ix -= $cnt;
        }
        $thumb = $thumbs[$ix];
        wppa_do_filmthumb($thumb['id'], $ix, false);
        $idx++;
    }
    if (is_feed()) {
        wppa_out('</div>');
    } else {
        wppa_out('</div>');
        wppa_out('</div>');
        wppa_out('</div>');
    }
    $t += microtime(true);
    wppa_dbg_msg('Filmstrip took ' . $t . ' seconds.');
}
function wppa_alert($msg, $reload = false)
{
    global $wppa;
    if (!$reload) {
        wppa_add_js_page_data('<script type="text/javascript">alert( \'' . esc_js($msg) . '\' );jQuery( "#wppaer" ).html( "" );</script>');
    } else {
        $fullmsg = '<script id="wppaer" type="text/javascript" >alert( \'' . esc_js($msg) . '\' );jQuery( "#wppaer" ).html( "" );';
        if ($reload) {
            $fullmsg .= 'document.location.reload( true )';
        }
        $fullmsg .= '</script>';
        echo $fullmsg;
    }
}
function wppa_sphoto()
{
    $id = wppa('single_photo');
    $width = wppa_get_container_width();
    $height = floor($width / wppa_get_ratio($id));
    $usethumb = wppa_use_thumb_file($id, $width, $height);
    $src = $usethumb ? wppa_get_thumb_url($id, '', $width, $height) : wppa_get_photo_url($id, '', $width, $height);
    if (wppa_has_audio($id)) {
        $src = wppa_fix_poster_ext($src, $id);
    }
    if (!wppa_in_widget()) {
        wppa_bump_viewcount('photo', $id);
    }
    $autocol = wppa('auto_colwidth') || $width > 0 && $width <= 1.0;
    // The initial width is $width if not autocol, else it should default to initial column width when auto
    // or initial column width * fraction
    if ($autocol) {
        if ($width == 'auto') {
            $contwidth = wppa_opt('initial_colwidth');
        } else {
            $contwidth = wppa_opt('initial_colwidth') * $width;
        }
    } else {
        $contwidth = $width;
    }
    // Open the pseudo container
    wppa_out('<div' . ' id="wppa-container-' . wppa('mocc') . '"' . ' class="' . (wppa('align') ? 'align' . wppa('align') : '') . ' wppa-sphoto-' . wppa('mocc') . '"' . ' style="width:' . $contwidth . 'px;position:relative;"' . ' >');
    // The script for responsive
    wppa_add_js_page_data("\n" . '<script type="text/javascript">');
    if ($autocol) {
        wppa_add_js_page_data("\n" . 'wppaAutoColumnWidth[' . wppa('mocc') . '] = true;');
        if ($width > 0 && $width <= 1.0) {
            wppa_add_js_page_data("\n" . 'wppaAutoColumnFrac[' . wppa('mocc') . '] = ' . $width . ';');
        } else {
            wppa_add_js_page_data("\n" . 'wppaAutoColumnFrac[' . wppa('mocc') . '] = 1.0;');
        }
        wppa_add_js_page_data("\n" . 'wppaColWidth[' . wppa('mocc') . '] = 0;');
    }
    wppa_add_js_page_data("\n" . 'wppaTopMoc = ' . wppa('mocc') . ';');
    wppa_add_js_page_data("\n" . '</script>');
    wppa('portrait_only', true);
    $fis = wppa_get_fullimgstyle_a($id);
    $width = $fis['width'];
    $height = $fis['height'];
    $style = $fis['style'];
    $style .= 'box-sizing:content-box;vertical-align:middle;';
    // The link
    $link = wppa_get_imglnk_a('sphoto', $id);
    if ($link) {
        if ($link['is_lightbox']) {
            $lbtitle = wppa_get_lbtitle('sphoto', $id);
            $videobody = esc_attr(wppa_get_video_body($id));
            $audiobody = esc_attr(wppa_get_audio_body($id));
            $videox = wppa_get_videox($id);
            $videoy = wppa_get_videoy($id);
            wppa_out('<a' . ' href="' . $link['url'] . '"' . ($lbtitle ? ' ' . wppa('lbtitle') . '="' . $lbtitle . '"' : '') . ($videobody ? ' data-videohtml="' . $videobody . '"' : '') . ($audiobody ? ' data-audiohtml="' . $audiobody . '"' : '') . ($videox ? ' data-videonatwidth="' . $videox . '"' : '') . ($videoy ? ' data-videonatheight="' . $videoy . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '"' . ($link['target'] ? ' target="' . $link['target'] . '"' : '') . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' >');
        } else {
            wppa_out('<a' . ' href="' . $link['url'] . '"' . ' title="' . $link['title'] . '"' . ' target="' . $link['target'] . '"' . ' class="thumb-img"' . ' id="a-' . $id . '-' . wppa('mocc') . '"' . ' >');
        }
    }
    // The image
    $title = $link ? esc_attr($link['title']) : esc_attr(stripslashes(wppa_get_photo_name($id)));
    if ($link['is_lightbox']) {
        $style .= ' cursor:url( ' . wppa_get_imgdir() . wppa_opt('magnifier') . ' ),pointer;';
        $title = wppa_zoom_in($id);
    }
    if (wppa_is_video($id)) {
        if ($autocol) {
            wppa_out(wppa_get_video_html(array('id' => $id, 'controls' => !$link['is_lightbox'], 'style' => $style, 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
        } else {
            wppa_out(wppa_get_video_html(array('id' => $id, 'width' => $width, 'height' => $height, 'controls' => !$link['is_lightbox'], 'style' => $style, 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
        }
    } else {
        wppa_out('<img' . ' src="' . $src . '"' . ' ' . wppa_get_imgalt($id) . ' class="size-medium wppa-sphoto wppa-simg-' . wppa('mocc') . '"' . ' ' . wppa_get_imgalt($id) . ($title ? ' title="' . $title . '" ' : '') . ' style="' . $style . '"' . ($autocol ? '' : ' width="' . $width . '" height="' . $height . '" ') . '/ >');
    }
    // Close the link
    if ($link) {
        wppa_out('</a>');
    }
    // Add audio?			sphoto
    if (wppa_has_audio($id)) {
        wppa_out('<div style="position:relative;z-index:11;" >');
        $margl = wppa_opt('fullimage_border_width') === '' ? 0 : wppa_opt('fullimage_border_width') + 1;
        $margb = $margl;
        wppa_out(wppa_get_audio_html(array('id' => $id, 'cursor' => 'cursor:pointer;', 'style' => $style . 'position:absolute;' . 'left:' . $margl . 'px;' . 'bottom:' . $margb . 'px;' . 'padding:0;' . 'margin:0;' . 'border:none;' . 'height:' . wppa_get_audio_control_height() . 'px;' . 'border-radius:0;', 'class' => 'size-medium wppa-sphoto wppa-simg-' . wppa('mocc'))));
        wppa_out('</div>');
    }
    // The pseudo container
    wppa_out('</div>');
}
function wppa_run_slidecontainer($type = '')
{
    global $thumbs;
    //	if ( wppa( 'is_filmonly' ) ) return;
    $c = is_array($thumbs) ? count($thumbs) : '0';
    wppa_dbg_msg('Running slidecontainer type ' . $type . ' with ' . $c . ' elements in thumbs, is_single=' . wppa('is_single'));
    if (wppa('is_single') && is_feed()) {
        // process feed for single image slideshow here, normal slideshow uses filmthumbs
        $style_a = wppa_get_fullimgstyle_a(wppa('start_photo'));
        $style = $style_a['style'];
        $width = $style_a['width'];
        $height = $style_a['height'];
        $imgalt = wppa_get_imgalt(wppa('start_photo'));
        wppa_out('<a href="' . get_permalink() . '">' . '<img' . ' src="' . wppa_get_photo_url(wppa('start_photo'), '', $width, $height) . '"' . ' style="' . $style . '"' . ' width="' . $width . '"' . ' height="' . $height . '" ' . $imgalt . ' />' . '</a>');
        return;
    } elseif ($type == 'slideshow') {
        // Find slideshow start method
        switch (wppa_opt('start_slide')) {
            case 'run':
                $startindex = -1;
                break;
            case 'still':
                $startindex = 0;
                break;
            case 'norate':
                $startindex = -2;
                break;
            default:
                echo 'Unexpected error unknown wppa_start_slide in wppa_run_slidecontainer';
        }
        // A requested photo id overrules the method. $startid >0 is requested photo id, -1 means: no id requested
        if (wppa('start_photo')) {
            $startid = wppa('start_photo');
        } else {
            $startid = -1;
        }
        // Create next ids
        $ix = 0;
        if ($thumbs) {
            while ($ix < count($thumbs)) {
                if ($ix == count($thumbs) - 1) {
                    $thumbs[$ix]['next_id'] = $thumbs[0]['id'];
                } else {
                    $thumbs[$ix]['next_id'] = $thumbs[$ix + 1]['id'];
                }
                $ix++;
            }
        }
        // Produce scripts for slides
        $index = 0;
        if ($thumbs) {
            $t = -microtime(true);
            wppa_add_js_page_data("\n" . '<script type="text/javascript">');
            foreach ($thumbs as $thumb) {
                if (wppa_switch('next_on_callback')) {
                    wppa_add_js_page_data("\n" . 'wppaStoreSlideInfo( ' . wppa_get_slide_info($index, $thumb['id'], $thumb['next_id']) . ' );');
                } else {
                    wppa_add_js_page_data("\n" . 'wppaStoreSlideInfo( ' . wppa_get_slide_info($index, $thumb['id']) . ' );');
                }
                if ($startid == $thumb['id']) {
                    $startindex = $index;
                }
                // Found the requested id, put the corresponding index in $startindex
                $index++;
            }
            wppa_add_js_page_data("\n" . '</script>');
            $t += microtime(true);
            wppa_dbg_msg('SlideInfo took ' . $t . ' seconds.');
        }
        wppa_add_js_page_data("\n" . '<script type="text/javascript">');
        // How to start if slideonly
        if (wppa('is_slideonly')) {
            if (wppa_switch('start_slideonly')) {
                $startindex = -1;
                // There are no navigations, so start running, overrule everything
            } else {
                $startindex = 0;
            }
        }
        // Vertical align
        if (wppa('is_slideonly')) {
            $ali = wppa('ss_widget_valign') ? wppa('ss_widget_valign') : ($ali = 'fit');
            wppa_add_js_page_data("\n" . 'wppaFullValign[' . wppa('mocc') . '] = "' . $ali . '";');
        } else {
            wppa_add_js_page_data("\n" . 'wppaFullValign[' . wppa('mocc') . '] = "' . wppa_opt('fullvalign') . '";');
        }
        // Horizontal align
        wppa_add_js_page_data("\n" . 'wppaFullHalign[' . wppa('mocc') . '] = "' . wppa_opt('fullhalign') . '";');
        // Portrait only ?
        if (wppa('portrait_only')) {
            wppa_add_js_page_data("\n" . 'wppaPortraitOnly[' . wppa('mocc') . '] = true;');
        }
        // Start command with appropriate $startindex: -2 = at norate, -1 run from first, >=0 still at index
        // If we use lightbox on slideshow, wait for documen.ready, if we do not use lightbox, go immediately.
        if (wppa_opt('slideshow_linktype') == 'lightbox' || wppa_opt('slideshow_linktype') == 'lightboxsingle' || wppa_opt('film_linktype') == 'lightbox') {
            wppa_add_js_page_data("\n" . 'jQuery( document ).ready( function() { wppaStartStop( ' . wppa('mocc') . ', ' . $startindex . ' ); } );');
        } else {
            wppa_add_js_page_data("\n" . 'wppaStartStop( ' . wppa('mocc') . ', ' . $startindex . ' );');
        }
        wppa_add_js_page_data("\n" . '</script>');
    } else {
        wppa_out('<span style="color:red;">' . 'Error, wppa_run_slidecontainer() called with wrong argument: ' . $type . '. Possible values: \'single\' or \'slideshow\'' . '</span>');
    }
}
function wppa_alert($msg, $reload = false, $escape = true)
{
    global $wppa;
    if ($escape) {
        $msg = esc_js($msg);
    }
    if (!$reload && $msg) {
        wppa_add_js_page_data('<script type="text/javascript">alert( \'' . $msg . '\' );jQuery( "#wppaer" ).html( "" );</script>');
    } elseif ($reload == 'home') {
        echo '<script id="wppaer" type="text/javascript" >' . ($msg ? 'alert( \'' . $msg . '\' );' : '') . 'jQuery( "#wppaer" ).html( "" );' . 'document.location.href="' . home_url() . '";' . '</script>';
    } else {
        echo '<script id="wppaer" type="text/javascript" >' . ($msg ? 'alert( \'' . $msg . '\' );' : '') . 'jQuery( "#wppaer" ).html( "" );' . 'document.location.reload( true );' . '</script>';
    }
}
function wppa_slide_filmstrip($opt = '')
{
    global $wppa;
    global $wppa_opt;
    global $thumb;
    // A single image slideshow needs no navigation
    if ($wppa['is_single']) {
        return;
    }
    $do_it = false;
    // Init
    if (is_feed()) {
        $do_it = true;
    } else {
        // Not a feed
        if ($opt != 'optional') {
            $do_it = true;
        } else {
            // optional
            if (wppa_switch('wppa_filmstrip')) {
                // optional and option on
                if (!$wppa['is_slideonly']) {
                    $do_it = true;
                }
                // always except slideonly
            }
            if ($wppa['film_on']) {
                $do_it = true;
            }
            // explicitly turned on
        }
    }
    if (!$do_it) {
        return;
    }
    // Don't do it
    $t = -microtime(true);
    $alb = wppa_get_get('album');
    // To be tested: // Album id is in $wppa['start_album']
    $thumbs = wppa_get_thumbs($alb);
    if (!$thumbs || count($thumbs) < 1) {
        return;
    }
    $preambule = wppa_get_preambule();
    $width = ($wppa_opt['wppa_tf_width'] + $wppa_opt['wppa_tn_margin']) * (count($thumbs) + 2 * $preambule);
    $width += $wppa_opt['wppa_tn_margin'] + 2;
    $topmarg = $wppa_opt['wppa_thumbsize'] / 2 - 16;
    $height = $wppa_opt['wppa_thumbsize'] + $wppa_opt['wppa_tn_margin'];
    $height1 = $wppa_opt['wppa_thumbsize'];
    $marg = '42';
    // 32
    $fs = '24';
    $fw = '42';
    if ($wppa['in_widget']) {
        $width /= 2;
        $topmarg /= 2;
        $height /= 2;
        $height1 /= 2;
        $marg = '21';
        $fs = '12';
        $fw = '21';
    }
    $conw = wppa_get_container_width();
    if ($conw < 1) {
        $conw *= 640;
    }
    $w = $conw - (2 * 6 + 2 * 42 + 2 * $wppa_opt['wppa_bwidth']);
    /* 2*padding + 2*arrows + 2*border */
    if ($wppa['in_widget']) {
        $w = $conw - (2 * 6 + 2 * 21 + 2 * $wppa_opt['wppa_bwidth']);
    }
    /* 2*padding + 2*arrow + 2*border */
    $IE6 = 'width: ' . $w . 'px;';
    $pagsiz = round($w / ($wppa_opt['wppa_thumbsize'] + $wppa_opt['wppa_tn_margin']));
    if ($wppa['in_widget']) {
        $pagsiz = round($w / ($wppa_opt['wppa_thumbsize'] / 2 + $wppa_opt['wppa_tn_margin'] / 2));
    }
    wppa_add_js_page_data('<script type="text/javascript">');
    //		$wppa['out'] .= wppa_nltab('+').'/* <![CDATA[ */';
    wppa_add_js_page_data('wppaFilmPageSize[' . $wppa['mocc'] . '] = ' . $pagsiz . ';');
    //		$wppa['out'] .= wppa_nltab('-').'/* ]]> */';
    wppa_add_js_page_data('</script>');
    if (is_feed()) {
        $wppa['out'] .= wppa_nltab() . '<div style="' . __wcs('wppa-box') . __wcs('wppa-nav') . '">';
    } else {
        $wppa['out'] .= wppa_nltab('+') . '<div class="wppa-box wppa-nav" style="text-align:center; ' . __wcs('wppa-box') . __wcs('wppa-nav') . 'height:' . $height . 'px;">';
        $wppa['out'] .= wppa_nltab() . '<div style="float:left; text-align:left; cursor:pointer; margin-top:' . $topmarg . 'px; width: ' . $fw . 'px; font-size: ' . $fs . 'px;">';
        $wppa['out'] .= wppa_nltab() . '<a class="wppa-prev-' . $wppa['mocc'] . ' wppa-arrow" style="' . __wcs('wppa-arrow') . '" id="prev-film-arrow-' . $wppa['mocc'] . '" onclick="wppaFirst(' . $wppa['mocc'] . ');" title="' . __a('First', 'wppa_theme') . '" >&laquo;</a>';
        $wppa['out'] .= wppa_nltab() . '<a class="wppa-prev-' . $wppa['mocc'] . ' wppa-arrow" style="' . __wcs('wppa-arrow') . '" id="prev-film-arrow-1-' . $wppa['mocc'] . '" onclick="wppaPrev(' . $wppa['mocc'] . ');" title="' . __a('Previous', 'wppa_theme') . '" >&lsaquo;</a>';
        $wppa['out'] .= wppa_nltab() . '</div>';
        $wppa['out'] .= wppa_nltab() . '<div style="float:right; text-align:right; cursor:pointer; margin-top:' . $topmarg . 'px; width: ' . $fw . 'px; font-size: ' . $fs . 'px;">';
        $wppa['out'] .= wppa_nltab() . '<a class="wppa-next-' . $wppa['mocc'] . ' wppa-arrow" style="' . __wcs('wppa-arrow') . '" id="next-film-arrow-1-' . $wppa['mocc'] . '" onclick="wppaNext(' . $wppa['mocc'] . ');" title="' . __a('Next', 'wppa_theme') . '" >&rsaquo;</a>';
        $wppa['out'] .= wppa_nltab() . '<a class="wppa-next-' . $wppa['mocc'] . ' wppa-arrow" style="' . __wcs('wppa-arrow') . '" id="next-film-arrow-' . $wppa['mocc'] . '" onclick="wppaLast(' . $wppa['mocc'] . ');" title="' . __a('Last', 'wppa_theme') . '" >&raquo;</a>';
        $wppa['out'] .= wppa_nltab() . '</div>';
        $wppa['out'] .= wppa_nltab() . '<div id="filmwindow-' . $wppa['mocc'] . '" class="filmwindow" style="' . $IE6 . ' position:absolute; display: block; height:' . $height . 'px; margin: 0 0 0 ' . $marg . 'px; overflow:hidden;">';
        $wppa['out'] .= wppa_nltab('+') . '<div id="wppa-filmstrip-' . $wppa['mocc'] . '" style="height:' . $height1 . 'px; width:' . $width . 'px; margin-left: -100px;">';
    }
    $cnt = count($thumbs);
    $start = $cnt - $preambule;
    $end = $cnt;
    $idx = $start;
    /* #wppa-container-'.$wppa['mocc'].' */
    $wppa['out'] .= '
			<style type="text/css" scoped >
				 .thumbnail-frame { ' . wppa_get_thumb_frame_style(false, 'film') . ' }
				.wppa-filmthumb-active { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
			</style>';
    while ($idx < $end) {
        $glue = $cnt == $idx + 1 ? true : false;
        $ix = $idx;
        while ($ix < 0) {
            $ix += $cnt;
        }
        $thumb = $thumbs[$ix];
        wppa_do_filmthumb($ix, false, $glue);
        $idx++;
    }
    $idx = 0;
    foreach ($thumbs as $tt) {
        $thumb = $tt;
        $glue = $cnt == $idx + 1 ? true : false;
        wppa_do_filmthumb($idx, true, $glue);
        $idx++;
    }
    $start = '0';
    $end = $preambule;
    $idx = $start;
    while ($idx < $end) {
        $ix = $idx;
        while ($ix >= $cnt) {
            $ix -= $cnt;
        }
        $thumb = $thumbs[$ix];
        wppa_do_filmthumb($ix, false);
        $idx++;
    }
    if (is_feed()) {
        $wppa['out'] .= wppa_nltab('-') . '</div>';
    } else {
        $wppa['out'] .= wppa_nltab('-') . '</div>';
        $wppa['out'] .= wppa_nltab('-') . '</div>';
        $wppa['out'] .= wppa_nltab('-') . '</div>';
    }
    $t += microtime(true);
    wppa_dbg_msg('Filmstrip took ' . $t . ' seconds.');
}