{if !empty($thumbnails)} {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'} {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} {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} {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)} {assign var=my value=$pwg->derivative('xlarge', $thumbnail.src_image)}{literal} { thumb: '{/literal}{$derivative->get_url()}{literal}', image: '{/literal}{$my->get_url()}{literal}', title: '{/literal}{$thumbnail.NAME|strip_tags:false|replace:'\'':'''|replace:'"':'"'|nl2br|regex_replace:"/[\r\n]/":""}{literal}', description: '{/literal}{$thumbnail.FILE_DESC|strip_tags:false|replace:'\'':'''|replace:'"':'"'|nl2br|regex_replace:"/[\r\n]/":""}{literal}', piwigo_id: {/literal}{$thumbnail.id}{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:600000, 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; 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; 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}