1 | {if !empty($thumbnails)}{strip} |
---|
2 | {if $derivative_params->max_width()/$derivative_params->max_height() > 1.5 || ($derivative_params->max_height()<400 && !$derivative_params->sizing->max_crop)} |
---|
3 | {modus_thumbs} |
---|
4 | {else} |
---|
5 | {if $smarty.const.IMG_SQUARE == $derivative_params->type}{assign var='SHOW_THUMBNAIL_CAPTION' value=false}{/if} |
---|
6 | {html_style} |
---|
7 | {*Set some sizes according to maximum thumbnail width and height*} |
---|
8 | .thumbnails SPAN,.thumbnails .wrap2 A{ |
---|
9 | width:{$derivative_params->max_width()+2}px |
---|
10 | } |
---|
11 | .thumbnails .wrap2{ |
---|
12 | height:{$derivative_params->max_height()+3}px |
---|
13 | } |
---|
14 | |
---|
15 | @media {cssResolution min=1.3 max=1.7}{ |
---|
16 | .thumbnails SPAN,.thumbnails .wrap2 A{ |
---|
17 | width:{($derivative_params->max_width()/1.5+2)|intval}px |
---|
18 | } |
---|
19 | .thumbnails .wrap2{ |
---|
20 | height:{($derivative_params->max_height()/1.5+3)|intval}px |
---|
21 | } |
---|
22 | .thumbnails .wrap2 IMG{ |
---|
23 | max-width:{($derivative_params->max_width()/1.5)|intval}px; |
---|
24 | max-height:{($derivative_params->max_height()/1.5)|intval}px; |
---|
25 | } |
---|
26 | } |
---|
27 | |
---|
28 | @media {cssResolution min=1.7 max=2.5}{ |
---|
29 | .thumbnails SPAN,.thumbnails .wrap2 A{ |
---|
30 | width:{($derivative_params->max_width()/2+2)|intval}px |
---|
31 | } |
---|
32 | .thumbnails .wrap2{ |
---|
33 | height:{($derivative_params->max_height()/2+3)|intval}px |
---|
34 | } |
---|
35 | .thumbnails .wrap2 IMG{ |
---|
36 | max-width:{($derivative_params->max_width()/2)|intval}px; |
---|
37 | max-height:{($derivative_params->max_height()/2)|intval}px; |
---|
38 | } |
---|
39 | } |
---|
40 | |
---|
41 | @media {cssResolution min=2.5}{ |
---|
42 | .thumbnails SPAN,.thumbnails .wrap2 A{ |
---|
43 | width:{($derivative_params->max_width()/3+2)|intval}px |
---|
44 | } |
---|
45 | .thumbnails .wrap2{ |
---|
46 | height:{($derivative_params->max_height()/3+3)|intval}px |
---|
47 | } |
---|
48 | .thumbnails .wrap2 IMG{ |
---|
49 | max-width:{($derivative_params->max_width()/3)|intval}px; |
---|
50 | max-height:{($derivative_params->max_height()/3)|intval}px; |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | {*=== If we cannot fit two images per width (1 comes from border, 7 comes from css li margin)===*} |
---|
55 | @media |
---|
56 | {$maxw=(2+2*($derivative_params->max_width()+1+7))|intval} |
---|
57 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' max=1}, |
---|
58 | {$maxw=(2+2*($derivative_params->max_width()/1.5+1+7))|intval} |
---|
59 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=1.3 max=1.7}, |
---|
60 | {$maxw=(2+2*($derivative_params->max_width()/2+1+7))|intval} |
---|
61 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=1.7 max=2.5}, |
---|
62 | {$maxw=(2+2*($derivative_params->max_width()/3+1+7))|intval} |
---|
63 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=2.5}{ |
---|
64 | .thumbnails .wrap2{ |
---|
65 | height:auto; |
---|
66 | border:0 |
---|
67 | } |
---|
68 | .thumbnails .thumbLegend{ |
---|
69 | height:auto; |
---|
70 | min-height:4em; |
---|
71 | overflow:visible; |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | {*=== If we cannot fit one image per width===*} |
---|
76 | @media |
---|
77 | {$maxw=(2+($derivative_params->max_width()+1+7))|intval} |
---|
78 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' max=1}, |
---|
79 | {$maxw=(2+($derivative_params->max_width()/1.5+1+7))|intval} |
---|
80 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=1.3 max=1.7}, |
---|
81 | {$maxw=(2+($derivative_params->max_width()/2+1+7))|intval} |
---|
82 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=1.7 max=2.5}, |
---|
83 | {$maxw=(2+($derivative_params->max_width()/3+1+7))|intval} |
---|
84 | {cssResolution base='(max-width:'|cat:$maxw|cat:'px)' min=2.5}{ |
---|
85 | .thumbnails .wrap1{ |
---|
86 | margin:0 0 5px |
---|
87 | } |
---|
88 | .thumbnails .wrap2{ |
---|
89 | display:block |
---|
90 | } |
---|
91 | .thumbnails SPAN, .thumbnails .wrap2 A{ |
---|
92 | max-width:99.8% |
---|
93 | } |
---|
94 | .thumbnails .wrap2 IMG{ |
---|
95 | max-width:100% |
---|
96 | } |
---|
97 | } |
---|
98 | {if $derivative_params->max_width() > 400} |
---|
99 | .thumbLegend {ldelim}font-size: 110%} |
---|
100 | {else} |
---|
101 | .thumbLegend {ldelim}font-size: 90%} |
---|
102 | {/if} |
---|
103 | {/html_style} |
---|
104 | {foreach from=$thumbnails item=thumbnail} |
---|
105 | <li> |
---|
106 | <span class="wrap1"> |
---|
107 | <span class="wrap2"> |
---|
108 | <a href="{$thumbnail.URL}"> |
---|
109 | {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)} |
---|
110 | <img src="{$derivative->get_url()}"{* {$derivative->get_size_htm()}*} alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}"> |
---|
111 | </a> |
---|
112 | </span> |
---|
113 | {if $SHOW_THUMBNAIL_CAPTION } |
---|
114 | <div class="thumbLegend"> |
---|
115 | {$thumbnail.NAME} |
---|
116 | {if !empty($thumbnail.icon_ts)} |
---|
117 | <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)"> |
---|
118 | {/if} |
---|
119 | {if isset($thumbnail.NB_COMMENTS)} |
---|
120 | <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments"> |
---|
121 | <br> |
---|
122 | {$thumbnail.NB_COMMENTS|@translate_dec:'%d comment':'%d comments'} |
---|
123 | </span> |
---|
124 | {/if} |
---|
125 | |
---|
126 | {if isset($thumbnail.NB_HITS)} |
---|
127 | <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits"> |
---|
128 | <br> |
---|
129 | {$thumbnail.NB_HITS|@translate_dec:'%d hit':'%d hits'} |
---|
130 | </span> |
---|
131 | {/if} |
---|
132 | <span class="thumbDesc"><br>{$thumbnail.DESCRIPTION}</span> |
---|
133 | </div> |
---|
134 | {/if} |
---|
135 | </span> |
---|
136 | </li> |
---|
137 | {/foreach} |
---|
138 | {/if} |
---|
139 | {/strip}{/if} |
---|