Changeset 13089 for extensions/stripped-galleria/template/thumbnails.tpl
- Timestamp:
- Feb 10, 2012, 11:45:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/stripped-galleria/template/thumbnails.tpl
r12975 r13089 1 1 {if !empty($thumbnails)} 2 2 {php} 3 global $stripped, $strippedgalleria ;3 global $stripped, $strippedgalleria, $page; 4 4 $this->assign( 'stripped', $stripped ); 5 5 $this->assign( 'strippedgalleria', $strippedgalleria ); 6 $this->assign( 'get_root_url', get_root_url() ); 7 $this->assign( 'catid', @$page['category']['id'] ); 8 $this->assign( 'section', @$page['section'] ); 9 $this->assign( 'tagids', @implode(',', @$page['tag_ids']) ); 6 10 {/php} 7 <div id="gallery" class="test"> 8 {strip}{foreach from=$thumbnails item=thumbnail} 9 <a href="{$thumbnail.FILE_PATH}" {if (($thumbnail.FILE_HAS_HD) && ($strippedgalleria.lightbox == 'hd'))}rel="{$thumbnail.HD_PATH}"{/if}> 10 <img src="{$thumbnail.TN_SRC}" 11 {if ($stripped.imageCaption == 'description' )} 12 alt="{$thumbnail.FILE_DESC|strip_tags:false}" 13 {/if} 14 {if ($stripped.imageCaption == 'title' )} 15 alt="{$thumbnail.NAME}" 16 {/if} 17 /></a> 18 {/foreach}{/strip} 19 </div> 11 <div id="gallery"></div> 20 12 {footer_script} 21 13 {literal} 14 var data = [ 15 {/literal}{foreach from=$thumbnails item=thumbnail name=thumb}{literal} 16 { 17 thumb: '{/literal}{$thumbnail.TN_SRC}{literal}', 18 image: '{/literal}{$thumbnail.FILE_PATH}{literal}', 19 big: '{/literal}{if (($thumbnail.FILE_HAS_HD) && ($strippedgalleria.lightbox == 'hd'))}{$thumbnail.HD_PATH}{else}{$thumbnail.FILE_PATH}{/if}{literal}', 20 title: '{/literal}{$thumbnail.NAME|strip_tags:false|replace:'\'':'''|replace:'"':'"'}{literal}', 21 description: '{/literal}{$thumbnail.FILE_DESC|strip_tags:false|replace:'\'':'''|replace:'"':'"'}{literal}', 22 piwigo_id: {/literal}{$thumbnail.ID}{literal}, 23 piwigo_hashd: {/literal}{if ($thumbnail.FILE_HAS_HD)}true{else}false{/if}{literal} 24 }{/literal}{if (!$smarty.foreach.thumb.last)},{/if} 25 {/foreach}{literal} 26 ]; 22 27 var Htotal=jQuery(window).height(); 23 28 var Hheader=jQuery("#content").position().top; … … 25 30 var Hgallery = Htotal - Hheader - Hfooter - 2; 26 31 jQuery("#gallery").galleria({ 27 height: Hgallery, 32 dataSource: data, 33 height: Hgallery, 28 34 lightbox:{/literal}{if ($strippedgalleria.lightbox != 'none')}true{else}false{/if}{literal}, 29 35 clicknext:{/literal}{if ($strippedgalleria.clicknext)}true{else}false{/if}{literal}, … … 35 41 this.attachKeyboard({ 36 42 left: this.prev, 37 right: this.next 43 right: this.next, 38 44 }); 45 this.bind("image", function(e) { 46 var gid = e.index; 47 var pid = this.getData(gid).piwigo_id; 48 var hashd = this.getData(gid).piwigo_hashd; 49 if (hashd) { 50 jQuery("#downloadlink").show(); 51 jQuery("#downloadlink").prop("href","action.php?id="+pid+"&part=h"); 52 } else { 53 jQuery("#downloadlink").hide(); 54 } 55 jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { 56 imgid: "img-"+pid, 57 catid: "{/literal}{$catid}{literal}", 58 section: "{/literal}{$section}{literal}", 59 tagids: "{/literal}{$tagids}{literal}" 60 }); 61 }); 62 this.bind("lightbox_image", function() { 63 var image=jQuery("img",".galleria-lightbox-content"); 64 image.css("width","100%"); 65 image.css("height","100%"); 66 var gid=parseInt(jQuery(".galleria-lightbox-counter").text())-1; 67 var pid = this.getData(gid).piwigo_id; 68 var hashd = this.getData(gid).piwigo_hashd; 69 jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { 70 imgid: "img-"+pid, 71 catid: "{/literal}{$catid}{literal}", 72 section: "{/literal}{$section}{literal}", 73 tagids: "{/literal}{$tagids}{literal}" 74 }); 75 }); 39 76 } 40 77 });
Note: See TracChangeset
for help on using the changeset viewer.