public static function outputLink($gallery) { include_once GSPLUGINPATH . 'i18n_gallery/helper.php'; $url = @$gallery['url'] ? $gallery['url'] : 'index'; $parent = @$gallery['parent'] ? $gallery['parent'] : null; $tags = @$gallery['tags'] ? $gallery['tags'] : null; $thumb = i18n_gallery_thumb($gallery); $title = $gallery['title']; if (function_exists('return_i18n_languages')) { $languages = return_i18n_languages(); $deflang = return_i18n_default_language(); foreach ($languages as $language) { $fullkey = 'title' . ($language == $deflang ? '' : '_' . $language); if (isset($gallery[$fullkey])) { $title = $gallery[$fullkey]; break; } } } $link = function_exists('find_i18n_url') ? find_i18n_url($url, $parent) : find_url($url, $parent); if ($tags) { $link .= (strpos($link, '?') !== false ? '&' : '?') . 'imagetags=' . urlencode($tags); } if (isset($thumb)) { $item = @$gallery['items'][$thumb]; if (!$item) { $item = $gallery['items'][0]; } echo '<div class="gallery-link">'; echo '<a href="' . htmlspecialchars($link) . '" class="gallery-thumb-link">'; echo '<img src="'; i18n_gallery_thumb_link($gallery, $item); echo '" alt="' . htmlspecialchars($title) . '" title="' . htmlspecialchars($title) . '"/>'; echo '</a>'; echo '<span class="gallery-title">' . htmlspecialchars($title) . '</span>'; echo '</div>'; } else { echo '<a href="' . htmlspecialchars($link) . '" class="gallery-title-link">'; echo htmlspecialchars($title); echo '</a>'; } }
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 } }