{if !empty($thumbnails)} {php} global $stripped, $strippedgalleria, $page; $this->assign( 'stripped', $stripped ); $this->assign( 'strippedgalleria', $strippedgalleria ); $this->assign( 'get_root_url', get_root_url() ); $this->assign( 'catid', @$page['category']['id'] ); $this->assign( 'section', @$page['section'] ); $this->assign( 'tagids', @implode(',', @$page['tag_ids']) ); {/php} {footer_script} {literal} var data = [ {/literal}{foreach from=$thumbnails item=thumbnail name=thumb}{literal} { thumb: '{/literal}{$thumbnail.TN_SRC}{literal}', image: '{/literal}{$thumbnail.FILE_PATH}{literal}', big: '{/literal}{if (($thumbnail.FILE_HAS_HD) && ($strippedgalleria.lightbox == 'hd'))}{$thumbnail.HD_PATH}{else}{$thumbnail.FILE_PATH}{/if}{literal}', title: '{/literal}{$thumbnail.NAME|strip_tags:false|replace:'\'':'''|replace:'"':'"'}{literal}', description: '{/literal}{$thumbnail.FILE_DESC|strip_tags:false|replace:'\'':'''|replace:'"':'"'}{literal}', piwigo_id: {/literal}{$thumbnail.ID}{literal}, piwigo_hashd: {/literal}{if ($thumbnail.FILE_HAS_HD)}true{else}false{/if}{literal} }{/literal}{if (!$smarty.foreach.thumb.last)},{/if} {/foreach}{literal} ]; var Htotal=jQuery(window).height()-1; var Hheader=jQuery("#content").position().top; var Hfooter=jQuery("#footer").height(); var Hgallery = Htotal - Hheader - Hfooter - 2; jQuery("#gallery").galleria({ dataSource: data, height: Hgallery, lightbox:{/literal}{if ($strippedgalleria.lightbox != 'none')}true{else}false{/if}{literal}, clicknext:{/literal}{if ($strippedgalleria.clicknext)}true{else}false{/if}{literal}, transition:'{/literal}{$strippedgalleria.transition}{literal}', showCounter:false, imageTimeout:500000, maxScaleRatio:1, extend:function() { this.attachKeyboard({ left: this.prev, right: this.next }); this.bind("image", function(e) { var gid = e.index; var pid = this.getData(gid).piwigo_id; var hashd = this.getData(gid).piwigo_hashd; if (hashd) { jQuery("#downloadlink").show(); jQuery("#downloadlink").prop("href","action.php?id="+pid+"&part=h"); } else { jQuery("#downloadlink").hide(); } jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { imgid: "img-"+pid, catid: "{/literal}{$catid}{literal}", section: "{/literal}{$section}{literal}", tagids: "{/literal}{$tagids}{literal}" }); }); this.bind("lightbox_image", function() { var image=jQuery("img",".galleria-lightbox-content"); image.css("width","100%"); image.css("height","100%"); var gid=parseInt(jQuery(".galleria-lightbox-counter").text())-1; var pid = this.getData(gid).piwigo_id; var hashd = this.getData(gid).piwigo_hashd; jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { imgid: "img-"+pid, catid: "{/literal}{$catid}{literal}", section: "{/literal}{$section}{literal}", tagids: "{/literal}{$tagids}{literal}" }); }); } }); {/literal} {/footer_script} {/if}