function i18n_gallery_replace_nojs_links($gallery, $selvar) { for ($i = 0; $i < count($gallery['items']); $i++) { ?> <?php echo $selvar; ?> .get(<?php echo $i; ?> ).href = '<?php echo i18n_gallery_image_link($gallery, $gallery['items'][$i], false); ?> '; <?php } }
function i18n_gallery_supersized_content($gallery, $pic) { $interval = intval(@$gallery['interval']) ? intval($gallery['interval']) : 5000; ?> <!--Thumbnail Navigation--> <div id="prevthumb"></div> <div id="nextthumb"></div> <!--Arrow Navigation--> <a id="prevslide" class="load-item"></a> <a id="nextslide" class="load-item"></a> <div id="thumb-tray" class="load-item"> <div id="thumb-back"></div> <div id="thumb-forward"></div> </div> <!--Time Bar--> <div id="progress-back" class="load-item"> <div id="progress-bar"></div> </div> <!--Control Bar--> <div id="controls-wrapper" class="load-item"> <div id="controls"> <a id="play-button"><img id="pauseplay" src="<?php echo i18n_gallery_site_link(); ?> plugins/i18n_gallery/images/supersized/pause.png"/></a> <!--Slide counter--> <div id="slidecounter"> <span class="slidenumber"></span> / <span class="totalslides"></span> </div> <!--Slide captions displayed here--> <div id="slidecaption"></div> <!--Thumb Tray button--> <a id="tray-button"><img id="tray-arrow" src="<?php echo i18n_gallery_site_link(); ?> plugins/i18n_gallery/images/supersized/button-tray-up.png"/></a> <!--Navigation--> <ul id="slide-list"></ul> </div> </div> <script type="text/javascript"> jQuery(function($) { $.supersized.themeVars.image_path = '<?php echo i18n_gallery_site_link(); ?> plugins/i18n_gallery/images/supersized/'; $.supersized({ //Functionality slideshow : 1, //Slideshow on/off autoplay : <?php echo @$pic != null ? 0 : 1; ?> , //Slideshow starts playing automatically start_slide : <?php echo @$pic != null ? intval($pic) + 1 : 1; ?> , //Start slide (0 is random) random : 0, //Randomize slide order (Ignores start slide) slide_interval : <?php echo intval($interval); ?> , //Length between transitions transition : 1, //0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left transition_speed : 500, //Speed of transition new_window : 1, //Image links open in new window/tab pause_hover : 0, //Pause slideshow on hover keyboard_nav : 1, //Keyboard navigation on/off performance : 1, //0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) image_protect : 1, //Disables image dragging and right click with Javascript image_path : '<?php echo i18n_gallery_site_link(); ?> plugins/i18n_gallery/images/supersized/', //Default image path //Size & Position min_width : 0, //Min width allowed (in pixels) min_height : 0, //Min height allowed (in pixels) vertical_center : 1, //Vertically center background horizontal_center: 1, //Horizontally center background fit_always : 1, fit_portrait : 1, //Portrait images will not exceed browser height fit_landscape : 1, //Landscape images will not exceed browser width //Components navigation : 1, //Slideshow controls on/off thumbnail_navigation : 1, //Thumbnail navigation slide_counter : 1, //Display slide numbers slide_captions : 1, //Slide caption (Pull from "title" in slides array) slide_links : 'blank', // Individual links for each slide (Options: false, 'number', 'name', 'blank') slides : [ //Slideshow Images <?php $first = true; foreach ($gallery['items'] as $item) { ?> <?php if (!$first) { echo ', '; } ?> { image: <?php echo json_encode(i18n_gallery_image_link($gallery, $item, false)); ?> , title: <?php echo json_encode(@$item["_title"]); ?> , thumb:<?php echo json_encode(i18n_gallery_thumb_link($gallery, $item, false)); ?> , url: <?php echo json_encode(i18n_gallery_site_link()); ?> } <?php $first = false; } ?> ] <?php foreach ($gallery as $key => $value) { if (substr($key, 0, 2) == 'x-') { ?> ,<?php echo substr($key, 2); ?> : <?php echo preg_match('/^(null|true|false|\\d+)$/', $value) ? $value : json_encode($value); } } ?> }); }); </script> <?php }
function i18n_gallery_fancybox_content($gallery, $pic) { $id = i18n_gallery_id($gallery); if (i18n_gallery_is_show_image($pic)) { $item = i18n_gallery_item($gallery, $pic); ?> <div class="gallery gallery-fancybox gallery-<?php echo $id; ?> "> <div class="gallery-image "> <a id="fancybox-close" href="<?php i18n_gallery_back_link(); ?> " title="<?php i18n_gallery_BACK(); ?> "></a> <h2><?php echo htmlspecialchars(@$item['_title']); ?> </h2> <img src="<?php i18n_gallery_image_link($gallery, $pic); ?> " alt="<?php echo htmlspecialchars(@$item['_title']); ?> "/> <?php if (@$item['_description']) { echo '<p>' . htmlspecialchars(@$item['_description']) . '</p>'; } ?> <a id="fancybox-left" href="<?php i18n_gallery_prev_link($gallery, $pic); ?> " title="<?php i18n_gallery_PREV(); ?> "><span id="fancybox-left-ico" class="fancy-ico"></span></a> <a id="fancybox-right" href="<?php i18n_gallery_next_link($gallery, $pic); ?> " title="<?php i18n_gallery_NEXT(); ?> "><span id="fancybox-right-ico" class="fancy-ico"></span></a> </div> </div> <?php } else { $thumb = i18n_gallery_thumb($gallery); $showtitles = i18n_gallery_check($gallery, 'thumbtitles', false); $pageSize = !isset($thumb) && i18n_gallery_check($gallery, 'pagify', false) ? (int) $gallery['pagesize'] : 0; ?> <div class="gallery gallery-fancybox gallery-<?php echo $id; ?> "> <?php $i = 0; foreach ($gallery['items'] as $item) { $text = @$item['_title']; if (!$text) { $text = @$item['_description']; } else { if (@$item['_description']) { $text .= ' - ' . $item['_description']; } } ?> <div class="gallery-thumb" <?php if (isset($thumb) && $thumb != $i) { echo 'style="display:none"'; } ?> > <a href="<?php i18n_gallery_pic_link($gallery, $i); ?> " rel="fancybox-<?php echo $id; ?> " title="<?php echo htmlspecialchars($text); ?> "> <img src="<?php i18n_gallery_thumb_link($gallery, $item); ?> " alt="<?php echo htmlspecialchars(@$item['_description']); ?> "/> </a> <?php if ($showtitles) { ?> <p class="gallery-title"><?php echo htmlspecialchars(@$item['_title']); ?> </p> <?php } ?> </div> <?php $i++; } ?> <div style="clear:both"></div> </div> <script type="text/javascript"> $(document).ready(function(){ var $sel = $("[rel=fancybox-<?php echo $id; ?> ]") <?php i18n_gallery_replace_nojs_links($gallery, '$sel'); ?> $sel.fancybox({ <?php if ($pageSize >= 1) { ?> onStart: function(arr,index,opts) { var page = Math.floor(index/<?php echo $pageSize; ?> ) + 1; $('.gallery-<?php echo $id; ?> ').pagify('setPage', page); }, <?php } ?> cyclic: true <?php foreach ($gallery as $key => $value) { if (substr($key, 0, 2) == 'x-') { ?> ,<?php echo substr($key, 2); ?> : <?php echo preg_match('/^(null|true|false|\\d+)$/', $value) ? $value : json_encode($value); } } ?> }); <?php if (i18n_gallery_is_goto_image($pic)) { ?> $("[rel=fancybox-<?php echo $id; ?> ]:eq(<?php echo (int) $pic; ?> )").trigger('click'); <?php } if ($pageSize >= 1) { ?> $('.gallery-<?php echo $id; ?> ').pagify({ pageSize:<?php echo $pageSize; ?> , items:'.gallery-thumb' }); <?php } ?> }); </script> <?php } }
function i18n_gallery_prettyphoto_content($gallery, $pic) { $id = i18n_gallery_id($gallery); if (i18n_gallery_is_show_image($pic)) { $item = i18n_gallery_item($gallery, $pic); ?> <div class="gallery gallery-prettyphoto gallery-<?php echo $id; ?> "> <div class="gallery-image pp_default"> <a class="pp_arrow_previous" href="<?php i18n_gallery_prev_link($gallery, $pic); ?> " title="<?php i18n_gallery_PREV(); ?> "><?php i18n_gallery_PREV(); ?> </a> <a class="pp_arrow_next" href="<?php i18n_gallery_next_link($gallery, $pic); ?> " title="<?php i18n_gallery_NEXT(); ?> "><?php i18n_gallery_NEXT(); ?> </a> <a class="pp_close" href="<?php i18n_gallery_back_link(); ?> " title="<?php i18n_gallery_BACK(); ?> "><?php i18n_gallery_BACK(); ?> </a> <h2><?php echo htmlspecialchars(@$item['_title']); ?> </h2> <img src="<?php i18n_gallery_image_link($gallery, $pic); ?> " alt="<?php echo htmlspecialchars(@$item['_title']); ?> "/> <?php if (@$item['_description']) { echo '<p>' . htmlspecialchars(@$item['_description']) . '</p>'; } ?> </div> </div> <?php } else { $thumb = i18n_gallery_thumb($gallery); $showtitles = i18n_gallery_check($gallery, 'thumbtitles', false); $pageSize = !isset($thumb) && i18n_gallery_check($gallery, 'pagify', false) ? (int) $gallery['pagesize'] : 0; ?> <div class="gallery gallery-prettyphoto gallery-<?php echo $id; ?> "> <?php $i = 0; foreach ($gallery['items'] as $item) { ?> <div class="gallery-thumb" <?php if (isset($thumb) && $thumb != $i) { echo 'style="display:none"'; } ?> > <a href="<?php i18n_gallery_pic_link($gallery, $i); ?> " rel="prettyPhoto[<?php echo $id; ?> ]" title="<?php echo htmlspecialchars(@$item['_description']); ?> "> <img src="<?php i18n_gallery_thumb_link($gallery, $item); ?> " alt="<?php echo htmlspecialchars(@$item['_title']); ?> "/> </a> <?php if ($showtitles) { ?> <p class="gallery-title"><?php echo htmlspecialchars(@$item['_title']); ?> </p> <?php } ?> </div> <?php $i++; } ?> <div style="clear:both"></div> </div> <script type="text/javascript"> $(document).ready(function(){ var $sel = $("a[rel='prettyPhoto[<?php echo $id; ?> ]']"); <?php i18n_gallery_replace_nojs_links($gallery, '$sel'); ?> $sel.prettyPhoto({ <?php if (i18n_gallery_check($gallery, 'autostart', false) && $pic == null) { echo "autoplay_slideshow: true, "; } if (@$gallery['theme']) { echo "theme: " . json_encode($gallery['theme']) . ", "; } if (intval(@$gallery['interval'])) { echo "slideshow: " . intval(@$gallery['interval']) . ", "; } ?> social_tools: false <?php foreach ($gallery as $key => $value) { if (substr($key, 0, 2) == 'x-') { ?> ,<?php echo substr($key, 2); ?> : <?php echo preg_match('/^(null|true|false|\\d+)$/', $value) ? $value : json_encode($value); } } ?> }); <?php if (i18n_gallery_is_goto_image($pic)) { ?> if (window.location.href.indexOf('#') < 0) $("a[rel='prettyPhoto[<?php echo $id; ?> ]']:eq(<?php echo (int) $pic; ?> )").trigger('click'); <?php } else { if (i18n_gallery_check($gallery, 'autostart', false)) { ?> if (window.location.href.indexOf('#') < 0) $("a[rel='prettyPhoto[<?php echo $id; ?> ]']:eq(0)").trigger('click'); <?php } } if ($pageSize >= 1) { ?> $('.gallery-<?php echo $id; ?> ').pagify({ pageSize:<?php echo $pageSize; ?> , items:'.gallery-thumb'}); <?php } ?> }); </script> <?php } }
function i18n_gallery_cycle_content($gallery, $pic) { global $SITEURL; $id = i18n_gallery_id($gallery); $w = @$gallery['width'] ? $gallery['width'] : (@$gallery['height'] ? (int) $gallery['height'] * $gallery['items'][0]['width'] / $gallery['items'][0]['height'] : $gallery['items'][0]['width']); $h = @$gallery['height'] ? $gallery['height'] : (@$gallery['width'] ? (int) $gallery['width'] * $gallery['items'][0]['height'] / $gallery['items'][0]['width'] : $gallery['items'][0]['height']); // set gallery width/height for i18n_gallery_image_link: $gallery['width'] = $w; $gallery['height'] = $h; $tp = @$gallery['textpos']; if (!isset($pic) || $pic === null) { $pic = 0; } else { if ($pic < 0) { $pic = -$pic - 1; } } $navtype = @$gallery['navtype'] ? $gallery['navtype'] : 'dots'; ?> <div id="gallery-cycle-<?php echo $id; ?> " class="gallery gallery-cycle gallery-<?php echo $id; ?> "> <div class="gallery-container"> <?php $count = count($gallery['items']); for ($i = 0; $i < $count; $i++) { $item = $gallery['items'][$i]; $descr = @$item['_description']; if ($descr && !preg_match('/^(<p>|<p |<div>|<div ).*/', $descr)) { $descr = '<p>' . $descr . '</p>'; } ?> <div class="gallery-slide" <?php if ($i != $pic) { echo 'style="display:none"'; } ?> > <?php if ($tp == 'bottom') { ?> <div class="gallery-image"><img src="<?php i18n_gallery_image_link($gallery, $item); ?> " alt=""/></div><?php } ?> <?php if ($tp) { ?> <div class="gallery-text"> <?php if (@$item['_title']) { echo '<h2>' . htmlspecialchars($item['_title']) . '</h2>'; } ?> <?php echo $descr; ?> </div> <?php } ?> <?php if ($tp != 'bottom') { ?> <div class="gallery-image"><img src="<?php i18n_gallery_image_link($gallery, $item); ?> " alt=""/></div><?php } ?> </div> <?php } ?> <a class="prev" href="<?php i18n_gallery_pic_link($gallery, $pic > 0 ? $pic - 1 : $count - 1); ?> "><img src="<?php echo $SITEURL; ?> plugins/i18n_gallery/images/cycle/prev.png" alt=""/></a> <a class="next" href="<?php i18n_gallery_pic_link($gallery, $pic < $count - 1 ? $pic + 1 : 0); ?> "><img src="<?php echo $SITEURL; ?> plugins/i18n_gallery/images/cycle/next.png" alt=""/></a> </div> <?php if (@$gallery['navtype']) { ?> <div class="gallery-control gallery-control-<?php echo $navtype; ?> "> <?php for ($i = 0; $i < count($gallery['items']); $i++) { echo '<a href="' . i18n_gallery_pic_link($gallery, $i, false) . '"' . ($pic == $i ? ' class="activeSlide"' : '') . '>' . ($navtype == 'numbers' ? $i + 1 : '•') . '</a>'; } ?> </div> <?php } ?> </div> <script type="text/javascript"> $(document).ready(function(){ <?php if ($tp == 'overlay') { ?> // set text positions $('.gallery-cycle.gallery-<?php echo $id; ?> .gallery-slide:hidden').each(function(i,elem) { $elem = $(elem); $text = $elem.find('.gallery-text'); $elem.css('left','-10000px').show(); $text.css('bottom',-$text.outerHeight()+'px'); $(elem).hide().css('left','0'); }); <?php } ?> $('.gallery-cycle.gallery-<?php echo $id; ?> .gallery-control').empty(); $('.gallery-cycle.gallery-<?php echo $id; ?> .gallery-container').cycle({ slideExpr: '.gallery-slide', fx: <?php echo @$gallery['effect'] ? json_encode($gallery['effect']) : 'scrollLeft'; ?> , speed: 1000, timeout: <?php echo @$gallery['interval'] ? intval(@$gallery['interval']) : 5000; ?> , pause: 1, prev: $('.gallery-cycle.gallery-<?php echo $id; ?> .gallery-container .prev').get(), next: $('.gallery-cycle.gallery-<?php echo $id; ?> .gallery-container .next').get(), <?php if ($tp == 'overlay') { ?> before: function(currSlideElem,nextSlideElem,options,forwardFlag) { $text = $(currSlideElem).find('.gallery-text'); $text.animate({ bottom:-$text.outerHeight() },100); }, after: function(currSlideElem,nextSlideElem,options,forwardFlag) { $text = $(nextSlideElem).find('.gallery-text'); $text.animate({ bottom:0 },200); }, <?php } foreach ($gallery as $key => $value) { if (substr($key, 0, 2) == 'x-') { ?> <?php echo substr($key, 2); ?> : <?php echo preg_match('/^(null|true|false|\\d+)$/', $value) ? $value : json_encode($value); ?> , <?php } } ?> pager: '.gallery-cycle.gallery-<?php echo $id; ?> .gallery-control', pagerAnchorBuilder: function(idx, slide) { return '<a href="#">'+<?php echo $navtype == 'numbers' ? '(idx+1)' : "'•'"; ?> +'</a>'; } }); }); </script> <?php }
function i18n_gallery_s3slider_content($gallery) { $id = 's3slider-' . i18n_gallery_id($gallery); ?> <div class="main_slider" id="<?php echo $id; ?> "> <?php foreach ($gallery['items'] as $item) { ?> <div> <img src="<?php i18n_gallery_image_link($gallery, $item); ?> " /> </div> <?php } ?> </div> <?php }
function i18n_gallery_s3slider_content($gallery) { $id = 's3slider-' . i18n_gallery_id($gallery); ?> <div id="<?php echo $id; ?> "> <ul id="<?php echo $id; ?> Content"> <?php foreach ($gallery['items'] as $item) { ?> <li class="<?php echo $id; ?> Image"> <img src="<?php i18n_gallery_image_link($gallery, $item); ?> " /> <span><strong><?php echo htmlspecialchars(@$item['_title']); ?> </strong><br/><?php echo htmlspecialchars(@$item['_description']); ?> </span> </li> <?php } ?> <div class="clear <?php echo $id; ?> Image"></div> </ul> </div> <script type="text/javascript"> $(document).ready(function() { $('#<?php echo $id; ?> ').s3Slider({ <?php echo intval(@$gallery['interval']) ? "timeOut: " . intval(@$gallery['interval']) : "timeout: 5000"; ?> }); }); </script> <?php }