Ignore:
Timestamp:
Feb 10, 2012, 11:45:52 PM (12 years ago)
Author:
Zaphod
Message:

version 1.3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped-galleria/template/thumbnails.tpl

    r12975 r13089  
    11{if !empty($thumbnails)}
    22{php}
    3         global $stripped, $strippedgalleria;
     3        global $stripped, $strippedgalleria, $page;
    44        $this->assign( 'stripped', $stripped );
    55        $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']) );
    610{/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>
    2012{footer_script}
    2113{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:'\'':'&#39;'|replace:'"':'&quot;'}{literal}',
     21                        description: '{/literal}{$thumbnail.FILE_DESC|strip_tags:false|replace:'\'':'&#39;'|replace:'"':'&quot;'}{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                ];
    2227                        var Htotal=jQuery(window).height();
    2328                        var Hheader=jQuery("#content").position().top;
     
    2530                        var Hgallery = Htotal - Hheader - Hfooter - 2;
    2631            jQuery("#gallery").galleria({
    27                 height: Hgallery,
     32                                dataSource: data,
     33                                height: Hgallery,
    2834                                lightbox:{/literal}{if ($strippedgalleria.lightbox != 'none')}true{else}false{/if}{literal},
    2935                                clicknext:{/literal}{if ($strippedgalleria.clicknext)}true{else}false{/if}{literal},
     
    3541                                        this.attachKeyboard({
    3642                                                left: this.prev,
    37                                                 right: this.next
     43                                                right: this.next,
    3844                                        });
     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                                    });
    3976                                }
    4077            });
Note: See TracChangeset for help on using the changeset viewer.