1 | {define_derivative name='carousel' width='300' height='350' min_width='350'} |
---|
2 | {php} |
---|
3 | global $page, $template; |
---|
4 | $template->assign('cat_name', $page['category']['name']); |
---|
5 | |
---|
6 | {/php} |
---|
7 | |
---|
8 | {footer_script}{literal} |
---|
9 | (function($) { |
---|
10 | $(document).ready(function(){ |
---|
11 | |
---|
12 | var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)), |
---|
13 | start; |
---|
14 | |
---|
15 | if (isTouch==true){ |
---|
16 | start=""; |
---|
17 | }else{ |
---|
18 | start="onStart"; |
---|
19 | }; |
---|
20 | |
---|
21 | $("div.carousel").smoothDivScroll({ |
---|
22 | autoScrollingMode: start, |
---|
23 | touchScrolling: true, |
---|
24 | autoScrollingStep: {/literal}{$Slim.carousel_speed}{literal}, |
---|
25 | manualContinuousScrolling: true, |
---|
26 | mousewheelScrolling: "allDirections", |
---|
27 | |
---|
28 | }); |
---|
29 | |
---|
30 | $("div.carousel").bind("mouseover", function() { |
---|
31 | $(this).smoothDivScroll("stopAutoScrolling"); |
---|
32 | }).bind("mouseout", function() { |
---|
33 | $(this).smoothDivScroll("startAutoScrolling"); |
---|
34 | }); |
---|
35 | |
---|
36 | |
---|
37 | }); |
---|
38 | })(jQuery); |
---|
39 | {/literal}{/footer_script} |
---|
40 | |
---|
41 | {if (($Slim.style_slim)!=3)} |
---|
42 | {footer_script}{literal} |
---|
43 | (function($) { |
---|
44 | $(document).ready(function(){ |
---|
45 | $('.fancybox').fancybox({ |
---|
46 | helpers : { |
---|
47 | title : { |
---|
48 | type : 'over' |
---|
49 | }, |
---|
50 | }, |
---|
51 | afterLoad: function() { |
---|
52 | $("div.carousel").smoothDivScroll("stopAutoScrolling"); |
---|
53 | }, |
---|
54 | afterClose: function() { |
---|
55 | $("div.carousel").smoothDivScroll("startAutoScrolling"); |
---|
56 | } |
---|
57 | }); |
---|
58 | |
---|
59 | }); |
---|
60 | })(jQuery); |
---|
61 | {/literal}{/footer_script} |
---|
62 | {/if} |
---|
63 | |
---|
64 | <div class="carousel"> |
---|
65 | {if !empty($category_thumbnails)} |
---|
66 | {foreach from=$category_thumbnails item=cat} |
---|
67 | <div class="illustration"> |
---|
68 | <a href="{$cat.URL}"> |
---|
69 | <img src="{$pwg->derivative_url($carousel, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}" min-width="{$carousel->max_width()}" height="{$carousel->max_height()-22}"/> |
---|
70 | |
---|
71 | <div class="CatMPdescription"> |
---|
72 | <h3> |
---|
73 | {$cat.NAME} |
---|
74 | </h3> |
---|
75 | <div> |
---|
76 | {$cat.CAPTION_NB_IMAGES} |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | </a> |
---|
80 | </div> |
---|
81 | {/foreach} |
---|
82 | {/if} |
---|
83 | {foreach from=$thumbnails item=thumbnail} |
---|
84 | {assign var=derivative value=$pwg->derivative($carousel, $thumbnail.src_image)} |
---|
85 | <div class="illustration"> |
---|
86 | <a href="{if ($Slim.style_slim)!=3}{$thumbnail.path}" class="fancybox" data-fancybox-group="gallery"{else}{$thumbnail.URL}"{/if} title="{$thumbnail.NAME|strip_tags:false|replace:'\'':'''|replace:'"':'"'}"> |
---|
87 | <img class="thumbnail" src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" height="{$carousel->max_height()-22}"/> |
---|
88 | {if $SHOW_THUMBNAIL_CAPTION } |
---|
89 | <div class="CatMPdescription"> |
---|
90 | <H3> |
---|
91 | {$thumbnail.NAME} |
---|
92 | {if !empty($thumbnail.icon_ts)} |
---|
93 | <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)"> |
---|
94 | {/if} |
---|
95 | </h3> |
---|
96 | {if isset($thumbnail.NB_COMMENTS) or isset($thumbnail.NB_HITS)} |
---|
97 | <div> |
---|
98 | {if isset($thumbnail.NB_COMMENTS)} |
---|
99 | <p class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments"> |
---|
100 | {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)} |
---|
101 | </p> |
---|
102 | {/if} |
---|
103 | {if isset($thumbnail.NB_HITS)} |
---|
104 | <p class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits"> |
---|
105 | {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)} |
---|
106 | </p> |
---|
107 | {/if} |
---|
108 | </div> |
---|
109 | {/if} |
---|
110 | </div> |
---|
111 | {/if} |
---|
112 | </a> |
---|
113 | </div> |
---|
114 | {/foreach} |
---|
115 | </div> |
---|
116 | |
---|