1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Manage Properties Photos plugin for Piwigo by TEMMII | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2007-2021 ddtddt http://temmii.com/piwigo/ | |
---|
6 | // +-----------------------------------------------------------------------+ |
---|
7 | // | This program is free software; you can redistribute it and/or modify | |
---|
8 | // | it under the terms of the GNU General Public License as published by | |
---|
9 | // | the Free Software Foundation | |
---|
10 | // | | |
---|
11 | // | This program is distributed in the hope that it will be useful, but | |
---|
12 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
13 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
14 | // | General Public License for more details. | |
---|
15 | // | | |
---|
16 | // | You should have received a copy of the GNU General Public License | |
---|
17 | // | along with this program; if not, write to the Free Software | |
---|
18 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
19 | // | USA. | |
---|
20 | // +-----------------------------------------------------------------------+ |
---|
21 | |
---|
22 | //Ajout du prefiltre |
---|
23 | add_event_handler('loc_begin_picture', 'add_info_photo_pre', 05); |
---|
24 | |
---|
25 | function add_info_photo_pre() { |
---|
26 | global $template; |
---|
27 | $template->set_prefilter('picture', 'add_info_photo_preT'); |
---|
28 | } |
---|
29 | |
---|
30 | function add_info_photo_preT($content, &$smarty) { |
---|
31 | |
---|
32 | global $conf, $user; |
---|
33 | |
---|
34 | $replastandard='<dl id="standard" class="imageInfoTable">{strip} |
---|
35 | {foreach from=$add_info_photos item=addinfophotos} |
---|
36 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
37 | <div id="Author" class="imageInfo"> |
---|
38 | <dt>{\'Author\'|@translate}</dt> |
---|
39 | <dd>{$INFO_AUTHOR}</dd> |
---|
40 | </div> |
---|
41 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
42 | <div id="datecreate" class="imageInfo"> |
---|
43 | <dt>{\'Created on\'|@translate}</dt> |
---|
44 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
45 | </div> |
---|
46 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
47 | <div id="datepost" class="imageInfo"> |
---|
48 | <dt>{\'Posted on\'|@translate}</dt> |
---|
49 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
50 | </div> |
---|
51 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
52 | <div id="Dimensions" class="imageInfo"> |
---|
53 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
54 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
55 | </div> |
---|
56 | {else if $addinfophotos.AIPID == 5} |
---|
57 | <div id="File" class="imageInfo"> |
---|
58 | <dt>{\'File\'|@translate}</dt> |
---|
59 | <dd>{$INFO_FILE}</dd> |
---|
60 | </div> |
---|
61 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
62 | <div id="Filesize" class="imageInfo"> |
---|
63 | <dt>{\'Filesize\'|@translate}</dt> |
---|
64 | <dd>{$INFO_FILESIZE}</dd> |
---|
65 | </div> |
---|
66 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
67 | <div id="Tags" class="imageInfo"> |
---|
68 | <dt>{\'Tags\'|@translate}</dt> |
---|
69 | <dd> |
---|
70 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
71 | </dd> |
---|
72 | </div> |
---|
73 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
74 | <div id="Categories" class="imageInfo"> |
---|
75 | <dt>{\'Albums\'|@translate}</dt> |
---|
76 | <dd> |
---|
77 | <ul> |
---|
78 | {foreach from=$related_categories item=cat} |
---|
79 | <li>{$cat}</li> |
---|
80 | {/foreach} |
---|
81 | </ul> |
---|
82 | </dd> |
---|
83 | </div> |
---|
84 | {else if $addinfophotos.AIPID == 9} |
---|
85 | <div id="Visits" class="imageInfo"> |
---|
86 | <dt>{\'Visits\'|@translate}</dt> |
---|
87 | <dd>{$INFO_VISITS}</dd> |
---|
88 | </div> |
---|
89 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
90 | <div id="Average" class="imageInfo"> |
---|
91 | <dt>{\'Rating score\'|@translate}</dt> |
---|
92 | <dd> |
---|
93 | {if $rate_summary.count} |
---|
94 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
95 | {else} |
---|
96 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
97 | {/if} |
---|
98 | </dd> |
---|
99 | </div> |
---|
100 | {if isset($rating)} |
---|
101 | <div id="rating" class="imageInfo"> |
---|
102 | <dt> |
---|
103 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
104 | </dt> |
---|
105 | <dd> |
---|
106 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
107 | <div> |
---|
108 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
109 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
110 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
111 | {else} |
---|
112 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
113 | {/if} |
---|
114 | {/foreach} |
---|
115 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
116 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
117 | {footer_script} |
---|
118 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
119 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
120 | onSuccess : function(rating) {ldelim} |
---|
121 | var e = document.getElementById("updateRate"); |
---|
122 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
123 | e = document.getElementById("ratingScore"); |
---|
124 | if (e) e.innerHTML = rating.score; |
---|
125 | e = document.getElementById("ratingCount"); |
---|
126 | if (e) {ldelim} |
---|
127 | if (rating.count == 1) {ldelim} |
---|
128 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
129 | } else {ldelim} |
---|
130 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
131 | } |
---|
132 | {rdelim} |
---|
133 | {rdelim}{rdelim} ); |
---|
134 | {/footer_script} |
---|
135 | {/strip} |
---|
136 | </div> |
---|
137 | </form> |
---|
138 | </dd> |
---|
139 | </div> |
---|
140 | {/if} |
---|
141 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
142 | <div id="Privacy" class="imageInfo"> |
---|
143 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
144 | <dd> |
---|
145 | <div> |
---|
146 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
147 | </div> |
---|
148 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
149 | {footer_script require=\'jquery\'}{strip} |
---|
150 | function setPrivacyLevel(id, level){ |
---|
151 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
152 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
153 | { |
---|
154 | method: "POST", |
---|
155 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
156 | onSuccess: function(result) { |
---|
157 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
158 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
159 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
160 | } |
---|
161 | } |
---|
162 | ); |
---|
163 | } |
---|
164 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
165 | {/strip}{/footer_script} |
---|
166 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
167 | {foreach from=$available_permission_levels item=label key=level} |
---|
168 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
169 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
170 | {/foreach} |
---|
171 | </div> |
---|
172 | </dd> |
---|
173 | </div> |
---|
174 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
175 | <div id="Description" class="imageInfo"> |
---|
176 | <dt>{\'Description\'|@translate}</dt> |
---|
177 | <dd> |
---|
178 | {$COMMENT_IMG} |
---|
179 | </dd> |
---|
180 | </div> |
---|
181 | {footer_script} |
---|
182 | jQuery(document).ready(function(){ |
---|
183 | jQuery(".imageComment").hide(); |
---|
184 | }); |
---|
185 | {/footer_script} |
---|
186 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
187 | <div id="ImageId" class="imageInfo"> |
---|
188 | <dt>{\'Image id\'|@translate}</dt> |
---|
189 | <dd>{$addinfophotos.AIPDATA}</dd> |
---|
190 | </div> |
---|
191 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
192 | <div id="pab1" class="imageInfo"> |
---|
193 | <dt>{\'Photo added by\'|@translate}</dt> |
---|
194 | <dd>{$PAB}</dd> |
---|
195 | </div> |
---|
196 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
197 | <div id="DownloadCounter" class="imageInfo"> |
---|
198 | <dt>{\'Downloads\'|@translate}</dt> |
---|
199 | <dd>{$DOWNLOAD_COUNTER}</dd> |
---|
200 | </div> |
---|
201 | {else if $addinfophotos.AIPDATA} |
---|
202 | <div id="add_info" class="imageInfo"> |
---|
203 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
204 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
205 | </div> |
---|
206 | {/if} |
---|
207 | {/foreach} |
---|
208 | {/strip} |
---|
209 | </dl> |
---|
210 | {if isset($metadata)}'; |
---|
211 | |
---|
212 | $repladarkroomcards=' |
---|
213 | <div id="infopanel-left" class="col-lg-6 col-12"> |
---|
214 | <!-- Picture infos --> |
---|
215 | <div id="card-informations" class="card mb-2"> |
---|
216 | <div class="card-body"> |
---|
217 | <h5 class="card-title">{\'Information\'|@translate}</h5> |
---|
218 | <div id="info-content" class="d-flex flex-column"> |
---|
219 | {foreach from=$add_info_photos item=addinfophotos} |
---|
220 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
221 | <div id="Author" class="imageInfo"> |
---|
222 | <dl class="row mb-0"> |
---|
223 | <dt class="col-sm-5">{\'Author\'|@translate}</dt> |
---|
224 | <dd class="col-sm-7">{$INFO_AUTHOR}</dd> |
---|
225 | </dl> |
---|
226 | </div> |
---|
227 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
228 | <div id="datecreate" class="imageInfo"> |
---|
229 | <dl class="row mb-0"> |
---|
230 | <dt class="col-sm-5">{\'Created on\'|@translate}</dt> |
---|
231 | <dd class="col-sm-7">{$INFO_CREATION_DATE}</dd> |
---|
232 | </dl> |
---|
233 | </div> |
---|
234 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
235 | <div id="datepost" class="imageInfo"> |
---|
236 | <dl class="row mb-0"> |
---|
237 | <dt class="col-sm-5">{\'Posted on\'|@translate}</dt> |
---|
238 | <dd class="col-sm-7">{$INFO_POSTED_DATE}</dd> |
---|
239 | </dl> |
---|
240 | </div> |
---|
241 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
242 | <div id="Dimensions" class="imageInfo"> |
---|
243 | <dl class="row mb-0"> |
---|
244 | <dt class="col-sm-5">{\'Dimensions\'|@translate}</dt> |
---|
245 | <dd class="col-sm-7">{$INFO_DIMENSIONS}</dd> |
---|
246 | </dl> |
---|
247 | </div> |
---|
248 | {else if $addinfophotos.AIPID == 5} |
---|
249 | <div id="File" class="imageInfo"> |
---|
250 | <dl class="row mb-0"> |
---|
251 | <dt class="col-sm-5">{\'File\'|@translate}</dt> |
---|
252 | <dd class="col-sm-7">{$INFO_FILE}</dd> |
---|
253 | </dl> |
---|
254 | </div> |
---|
255 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
256 | <div id="Filesize" class="imageInfo"> |
---|
257 | <dl class="row mb-0"> |
---|
258 | <dt class="col-sm-5">{\'Filesize\'|@translate}</dt> |
---|
259 | <dd class="col-sm-7">{$INFO_FILESIZE}</dd> |
---|
260 | </dl> |
---|
261 | </div> |
---|
262 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
263 | {if $TAGAFF == 0} |
---|
264 | <div id="Tags" class="imageInfo"> |
---|
265 | <dl class="row mb-0"> |
---|
266 | <dt class="col-sm-5">{\'Tags\'|@translate}</dt> |
---|
267 | <dd class="col-sm-7"> |
---|
268 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
269 | </dd> |
---|
270 | </dl> |
---|
271 | </div> |
---|
272 | {/if} |
---|
273 | {if $TAGAFF == 1} |
---|
274 | </div> |
---|
275 | </div> |
---|
276 | </div> |
---|
277 | <div id="card-tags" class="card mb-2"> |
---|
278 | <div class="card-body"> |
---|
279 | <h5 class="card-title">{\'Tags\'|@translate}</h5> |
---|
280 | <div id="Tags" class="imageInfo"> |
---|
281 | {foreach from=$related_tags item=tag name=tag_loop}<a class="btn btn-primary btn-raised mr-1" href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
282 | </div> |
---|
283 | </div> |
---|
284 | </div> |
---|
285 | {/if} |
---|
286 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
287 | <div id="Categories" class="imageInfo"> |
---|
288 | <dl class="row mb-0"> |
---|
289 | <dt class="col-sm-5">{\'Albums\'|@translate}</dt> |
---|
290 | <dd class="col-sm-7"> |
---|
291 | {foreach from=$related_categories item=cat name=cat_loop} |
---|
292 | {if !$smarty.foreach.cat_loop.first}<br />{/if}{$cat} |
---|
293 | {/foreach} |
---|
294 | </dd> |
---|
295 | </dl> |
---|
296 | </div> |
---|
297 | {else if $addinfophotos.AIPID == 9} |
---|
298 | <div id="Visits" class="imageInfo"> |
---|
299 | <dl class="row mb-0"> |
---|
300 | <dt class="col-sm-5">{\'Visits\'|@translate}</dt> |
---|
301 | <dd class="col-sm-7">{$INFO_VISITS}</dd> |
---|
302 | </dl> |
---|
303 | </div> |
---|
304 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
305 | <div id="Average" class="imageInfo"> |
---|
306 | <dl class="row mb-0"> |
---|
307 | <dt class="col-sm-5">{\'Rating score\'|@translate}</dt> |
---|
308 | <dd class="col-sm-7"> |
---|
309 | {if $rate_summary.count} |
---|
310 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
311 | {else} |
---|
312 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
313 | {/if} |
---|
314 | </dd> |
---|
315 | </dl> |
---|
316 | </div> |
---|
317 | {if isset($rating)} |
---|
318 | <div id="rating" class="imageInfo"> |
---|
319 | <dl class="row mb-0"> |
---|
320 | <dt class="col-sm-5" id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</dt> |
---|
321 | <dd class="col-sm-7"> |
---|
322 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
323 | <div> |
---|
324 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
325 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
326 | <span class="rateButtonStarFull" data-value="{$mark}"></span> |
---|
327 | {else} |
---|
328 | <span class="rateButtonStarEmpty" data-value="{$mark}"></span> |
---|
329 | {/if} |
---|
330 | {/foreach} |
---|
331 | {strip}{combine_script id=\'core.scripts\' path=\'themes/default/js/scripts.js\' load=\'async\'} |
---|
332 | {combine_script id=\'rating\' require=\'core.scripts\' path=\'themes/bootstrap_darkroom/js/rating.js\' load=\'async\'} |
---|
333 | {footer_script require=\'jquery\'} |
---|
334 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
335 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
336 | onSuccess : function(rating) {ldelim} |
---|
337 | var e = document.getElementById("updateRate"); |
---|
338 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
339 | e = document.getElementById("ratingScore"); |
---|
340 | if (e) e.innerHTML = rating.score; |
---|
341 | e = document.getElementById("ratingCount"); |
---|
342 | if (e) {ldelim} |
---|
343 | if (rating.count == 1) {ldelim} |
---|
344 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
345 | {rdelim} else {ldelim} |
---|
346 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
347 | {rdelim} |
---|
348 | {rdelim} |
---|
349 | $(\'#averageRate\').find(\'span\').each(function() {ldelim} |
---|
350 | $(this).addClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarFull\' : \'rateButtonStarEmpty\'); |
---|
351 | $(this).removeClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarEmpty\' : \'rateButtonStarFull\'); |
---|
352 | {rdelim}); |
---|
353 | {rdelim} |
---|
354 | {rdelim}); |
---|
355 | {/footer_script} |
---|
356 | {/strip} |
---|
357 | </div> |
---|
358 | </form> |
---|
359 | </dd> |
---|
360 | </dl> |
---|
361 | </div> |
---|
362 | {/if} |
---|
363 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
364 | <div id="Privacy" class="imageInfo"> |
---|
365 | <dl class="row mb-0"> |
---|
366 | <dt class="col-sm-5">{\'Who can see this photo?\'|@translate}</dt> |
---|
367 | <dd class="col-sm-7"> |
---|
368 | <div> |
---|
369 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
370 | </div> |
---|
371 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
372 | {footer_script require=\'jquery\'}{strip} |
---|
373 | function setPrivacyLevel(id, level){ |
---|
374 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
375 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
376 | { |
---|
377 | method: "POST", |
---|
378 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
379 | onSuccess: function(result) { |
---|
380 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
381 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
382 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
383 | } |
---|
384 | } |
---|
385 | ); |
---|
386 | } |
---|
387 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
388 | {/strip}{/footer_script} |
---|
389 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
390 | {foreach from=$available_permission_levels item=label key=level} |
---|
391 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
392 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
393 | {/foreach} |
---|
394 | </div> |
---|
395 | </dd> |
---|
396 | </dl> |
---|
397 | </div> |
---|
398 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
399 | <div id="Description" class="imageInfo"> |
---|
400 | <dl class="row mb-0"> |
---|
401 | <dt class="col-sm-5">{\'Description\'|@translate}</dt> |
---|
402 | <dd class="col-sm-7"> |
---|
403 | {$COMMENT_IMG} |
---|
404 | </dd> |
---|
405 | </dl> |
---|
406 | </div> |
---|
407 | {footer_script} |
---|
408 | jQuery(document).ready(function(){ |
---|
409 | jQuery(".imageComment").hide(); |
---|
410 | }); |
---|
411 | {/footer_script} |
---|
412 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
413 | <div id="ImageId" class="imageInfo"> |
---|
414 | <dl class="row mb-0"> |
---|
415 | <dt class="col-sm-5">{\'Image id\'|@translate}</dt> |
---|
416 | <dd class="col-sm-7">{$addinfophotos.AIPDATA}</dd> |
---|
417 | </dl> |
---|
418 | </div> |
---|
419 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
420 | <div id="pab1" class="imageInfo"> |
---|
421 | <dl class="row mb-0"> |
---|
422 | <dt class="col-sm-5">{\'Photo added by\'|@translate}</dt> |
---|
423 | <dd class="col-sm-7">{$PAB}</dd> |
---|
424 | </dl> |
---|
425 | </div> |
---|
426 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
427 | <div id="DownloadCounter" class="imageInfo"> |
---|
428 | <dl class="row mb-0"> |
---|
429 | <dt class="col-sm-5">{\'Downloads\'|@translate}</dt> |
---|
430 | <dd class="col-sm-7">{$DOWNLOAD_COUNTER}</dd> |
---|
431 | </dl> |
---|
432 | </div> |
---|
433 | {else if $addinfophotos.AIPDATA} |
---|
434 | <div id="add_info" class="imageInfo"> |
---|
435 | <dl class="row mb-0"> |
---|
436 | <dt class="label col-sm-5">{$addinfophotos.AIPWORDING}</dt> |
---|
437 | <dd class="value col-sm-7">{$addinfophotos.AIPDATA}</dd> |
---|
438 | </dl> |
---|
439 | </div> |
---|
440 | {/if} |
---|
441 | {/foreach} |
---|
442 | {if $TAGAFF == 0} |
---|
443 | </div></div></div> |
---|
444 | {/if} |
---|
445 | </div> |
---|
446 | {if isset($metadata) || (isset($comment_add) || $COMMENT_COUNT > 0)} |
---|
447 | <div id="infopanel-right" class="col-lg-6 col-12"> |
---|
448 | <!-- metadata --> |
---|
449 | {if isset($metadata)} |
---|
450 | {if isset($loaded_plugins[\'exif_view\'])} |
---|
451 | {assign var="exif_make" value="{\'exif_field_Make\'|@translate}"} |
---|
452 | {assign var="exif_model" value="{\'exif_field_Model\'|@translate}"} |
---|
453 | {assign var="exif_lens" value="{\'exif_field_UndefinedTag:0xA434\'|@translate}"} |
---|
454 | {assign var="exif_fnumber" value="{\'exif_field_FNumber\'|@translate}"} |
---|
455 | {assign var="exif_iso" value="{\'exif_field_ISOSpeedRatings\'|@translate}"} |
---|
456 | {assign var="exif_focal_length" value="{\'exif_field_FocalLength\'|@translate}"} |
---|
457 | {assign var="exif_flash" value="{\'exif_field_Flash\'|@translate}"} |
---|
458 | {assign var="exif_exposure_time" value="{\'exif_field_ExposureTime\'|@translate}"} |
---|
459 | {assign var="exif_exposure_bias" value="{\'exif_field_ExposureBiasValue\'|@translate}"} |
---|
460 | {else} |
---|
461 | {assign var="exif_make" value="Make"} |
---|
462 | {assign var="exif_model" value="Model"} |
---|
463 | {assign var="exif_lens" value="UndefinedTag:0xA434"} |
---|
464 | {assign var="exif_fnumber" value="FNumber"} |
---|
465 | {assign var="exif_iso" value="ISOSpeedRatings"} |
---|
466 | {assign var="exif_focal_length" value="FocalLength"} |
---|
467 | {assign var="exif_flash" value="Flash"} |
---|
468 | {assign var="exif_exposure_time" value="ExposureTime"} |
---|
469 | {assign var="exif_exposure_bias" value="ExposureBiasValue"} |
---|
470 | {/if} |
---|
471 | |
---|
472 | <div id="card-metadata" class="card mb-2"> |
---|
473 | <div class="card-body"> |
---|
474 | <h5 class="card-title">{\'EXIF Metadata\'|@translate}</h5> |
---|
475 | <div id="metadata"> |
---|
476 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines) || array_key_exists("{$exif_model}", $metadata.0.lines))} |
---|
477 | <div class="row" style="line-height: 40px"> |
---|
478 | <div class="col-12"> |
---|
479 | <span class="camera-compact fa-3x mr-3" title="{$exif_make} & {$exif_model}"></span> |
---|
480 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines))}{$metadata.0.lines[{$exif_make}]}{/if} |
---|
481 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_model}", $metadata.0.lines))}{$metadata.0.lines[{$exif_model}]}{/if} |
---|
482 | </div> |
---|
483 | </div> |
---|
484 | {/if} |
---|
485 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_lens}", $metadata.0.lines))} |
---|
486 | <div class="row" style="line-height: 40px"> |
---|
487 | <div class="col-12"> |
---|
488 | <span class="camera-lens-h fa-3x mr-3" title="{$exif_lens}"></span> |
---|
489 | {$metadata.0.lines[{$exif_lens}]} |
---|
490 | </div> |
---|
491 | </div> |
---|
492 | {/if} |
---|
493 | <div class="row"> |
---|
494 | <div class="col-12{if $theme_config->fluid_width} col-xl-10{/if}"> |
---|
495 | <div class="row"> |
---|
496 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_fnumber}", $metadata.0.lines))} |
---|
497 | <div class="col-6 col-sm-4"> |
---|
498 | <span class="camera-aperture fa-2x pr-2" title="{$exif_fnumber}"></span> f/{$metadata.0.lines[{$exif_fnumber}]} |
---|
499 | </div> |
---|
500 | {/if} |
---|
501 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_focal_length}", $metadata.0.lines))} |
---|
502 | <div class="col-6 col-sm-4"> |
---|
503 | <span class="camera-focal-length fa-2x pr-2" title="{$exif_focal_length}"></span> {$metadata.0.lines[{$exif_focal_length}]} |
---|
504 | </div> |
---|
505 | {/if} |
---|
506 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_time}", $metadata.0.lines))} |
---|
507 | <div class="col-6 col-sm-4"> |
---|
508 | <span class="camera-shutter-speed fa-2x pr-2" title="{$exif_exposure_time}"></span> {$metadata.0.lines[{$exif_exposure_time}]} |
---|
509 | </div> |
---|
510 | {/if} |
---|
511 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_iso}", $metadata.0.lines))} |
---|
512 | <div class="col-6 col-sm-4"> |
---|
513 | <span class="camera-iso fa-2x pr-2" title="{$exif_iso}"></span> {$metadata.0.lines[{$exif_iso}]} |
---|
514 | </div> |
---|
515 | {/if} |
---|
516 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_bias}", $metadata.0.lines))} |
---|
517 | <div class="col-6 col-sm-4"> |
---|
518 | <span class="camera-exposure fa-2x pr-2" title="{$exif_exposure_bias}"></span> {$metadata.0.lines[{$exif_exposure_bias}]} |
---|
519 | </div> |
---|
520 | {/if} |
---|
521 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_flash}", $metadata.0.lines))} |
---|
522 | <div class="col-6 col-sm-4"> |
---|
523 | <span class="camera-flash fa-2x pr-2 float-left h-100" title="{$exif_flash}"></span><div> {$metadata.0.lines[{$exif_flash}]}</div> |
---|
524 | </div> |
---|
525 | {/if} |
---|
526 | </div> |
---|
527 | </div> |
---|
528 | </div> |
---|
529 | </div> |
---|
530 | <button id="show_exif_data" class="btn btn-primary btn-raised mt-1" style="text-transform: none;"><i class="fas fa-info mr-1"></i> {\'Show EXIF data\'|@translate}</button> |
---|
531 | {footer_script require=\'jquery\'} |
---|
532 | $(\'#show_exif_data\').on(\'click\', function() { |
---|
533 | if ($(\'#full_exif_data\').hasClass(\'d-none\')) { |
---|
534 | $(\'#full_exif_data\').addClass(\'d-flex\').removeClass(\'d-none\'); |
---|
535 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Hide EXIF data"|@translate}\'); |
---|
536 | } else { |
---|
537 | $(\'#full_exif_data\').addClass(\'d-none\').removeClass(\'d-flex\'); |
---|
538 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Show EXIF data"|@translate}\'); |
---|
539 | } |
---|
540 | }); |
---|
541 | {/footer_script} |
---|
542 | <div id="full_exif_data" class="d-none flex-column mt-2"> |
---|
543 | {foreach from=$metadata item=meta} |
---|
544 | {foreach from=$meta.lines item=value key=label} |
---|
545 | <div> |
---|
546 | <dl class="row mb-0"> |
---|
547 | <dt class="col-sm-6">{$label}</dt> |
---|
548 | <dd class="col-sm-6">{$value}</td> |
---|
549 | </tr> |
---|
550 | </dl> |
---|
551 | </div> |
---|
552 | {/foreach} |
---|
553 | {/foreach} |
---|
554 | </div> |
---|
555 | </div> |
---|
556 | </div> |
---|
557 | {/if} |
---|
558 | <div id="card-comments" class="ml-2"> |
---|
559 | {include file=\'picture_info_comments.tpl\'} |
---|
560 | </div> |
---|
561 | </div> |
---|
562 | {/if} |
---|
563 | '; |
---|
564 | |
---|
565 | $repladarkroomtabs=' |
---|
566 | <div id="infopanel" class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
567 | <!-- Nav tabs --> |
---|
568 | <ul class="nav nav-tabs nav-justified flex-column flex-sm-row" role="tablist"> |
---|
569 | {if $theme_config->picture_info == \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
570 | <li class="nav-item"><a class="flex-sm-fill text-sm-center nav-link active" href="#tab_info" aria-controls="tab_info" role="tab" data-toggle="tab">{\'Information\'|@translate}</a></li> |
---|
571 | {if isset($metadata)} |
---|
572 | <li class="nav-item"><a class="flex-sm-fill text-sm-center nav-link" href="#tab_metadata" aria-controls="tab_metadata" role="tab" data-toggle="tab">{\'EXIF Metadata\'|@translate}</a></li> |
---|
573 | {/if} |
---|
574 | {/if} |
---|
575 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
576 | <li class="nav-item{if $theme_config->picture_info == \'disabled\' || ($theme_config->picture_info != \'tabs\' && get_device() == \'desktop\')} active{/if}"><a class="flex-sm-fill text-sm-center nav-link" href="#tab_comments" aria-controls="tab_comments" role="tab" data-toggle="tab">{\'Comments\'|@translate} <span class="badge badge-secondary">{$COMMENT_COUNT}</span></a></li> |
---|
577 | {/if} |
---|
578 | </ul> |
---|
579 | |
---|
580 | <!-- Tab panes --> |
---|
581 | <div class="tab-content d-flex justify-content-center"> |
---|
582 | {if $theme_config->picture_info === \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
583 | <div role="tabpanel" class="tab-pane active" id="tab_info"> |
---|
584 | <div id="info-content" class="info"> |
---|
585 | <div class="table-responsive"> |
---|
586 | <table class="table table-sm"> |
---|
587 | <colgroup> |
---|
588 | <col class="w-50"> |
---|
589 | <col class="w-50"> |
---|
590 | </colgroup> |
---|
591 | <tbody> |
---|
592 | <!--mpp --> |
---|
593 | {foreach from=$add_info_photos item=addinfophotos} |
---|
594 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
595 | <div id="Author" class="imageInfo"> |
---|
596 | <tr> |
---|
597 | <th scope="row">{\'Author\'|@translate}</th> |
---|
598 | <td>{$INFO_AUTHOR}</td> |
---|
599 | </tr> |
---|
600 | </div> |
---|
601 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
602 | <div id="datecreate" class="imageInfo"> |
---|
603 | <tr> |
---|
604 | <th scope="row">{\'Created on\'|@translate}</th> |
---|
605 | <td>{$INFO_CREATION_DATE}</td> |
---|
606 | </tr> |
---|
607 | </div> |
---|
608 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
609 | <div id="datepost" class="imageInfo"> |
---|
610 | <tr> |
---|
611 | <th scope="row">{\'Posted on\'|@translate}</th> |
---|
612 | <td>{$INFO_POSTED_DATE}</td> |
---|
613 | </tr> |
---|
614 | </div> |
---|
615 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
616 | <div id="Dimensions" class="imageInfo"> |
---|
617 | <tr> |
---|
618 | <th scope="row">{\'Dimensions\'|@translate}</th> |
---|
619 | <td>{$INFO_DIMENSIONS}</td> |
---|
620 | </tr> |
---|
621 | </div> |
---|
622 | {else if $addinfophotos.AIPID == 5} |
---|
623 | <div id="File" class="imageInfo"> |
---|
624 | <tr> |
---|
625 | <th scope="row">{\'File\'|@translate}</th> |
---|
626 | <td>{$INFO_FILE}</td> |
---|
627 | </tr> |
---|
628 | </div> |
---|
629 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
630 | <div id="Filesize" class="imageInfo"> |
---|
631 | <tr> |
---|
632 | <th scope="row">{\'Filesize\'|@translate}</th> |
---|
633 | <td>{$INFO_FILESIZE}</td> |
---|
634 | </tr> |
---|
635 | </div> |
---|
636 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
637 | <div id="Tags" class="imageInfo"> |
---|
638 | <tr> |
---|
639 | <th scope="row">{\'Tags\'|@translate}</th> |
---|
640 | <td> |
---|
641 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
642 | </td> |
---|
643 | </tr> |
---|
644 | </div> |
---|
645 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
646 | <div id="Categories" class="imageInfo"> |
---|
647 | <tr> |
---|
648 | <th scope="row">{\'Albums\'|@translate}</th> |
---|
649 | <td> |
---|
650 | {foreach from=$related_categories item=cat name=cat_loop} |
---|
651 | {if !$smarty.foreach.cat_loop.first}<br />{/if}{$cat} |
---|
652 | {/foreach} |
---|
653 | </td> |
---|
654 | </tr> |
---|
655 | </div> |
---|
656 | {else if $addinfophotos.AIPID == 9} |
---|
657 | <div id="Visits" class="imageInfo"> |
---|
658 | <tr> |
---|
659 | <th scope="row">{\'Visits\'|@translate}</th> |
---|
660 | <td>{$INFO_VISITS}</td> |
---|
661 | </tr> |
---|
662 | </div> |
---|
663 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
664 | <div id="Average" class="imageInfo"> |
---|
665 | <tr> |
---|
666 | <th scope="row">{\'Rating score\'|@translate}</th> |
---|
667 | <td> |
---|
668 | {if $rate_summary.count} |
---|
669 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
670 | {else} |
---|
671 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
672 | {/if} |
---|
673 | </td> |
---|
674 | </tr> |
---|
675 | </div> |
---|
676 | {if isset($rating)} |
---|
677 | <div id="rating" class="imageInfo"> |
---|
678 | <tr> |
---|
679 | <th scope="row" id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</th> |
---|
680 | <td> |
---|
681 | <div id="rating" class="imageInfo"> |
---|
682 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
683 | <div> |
---|
684 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
685 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
686 | <span class="rateButtonStarFull" data-value="{$mark}"></span> |
---|
687 | {else} |
---|
688 | <span class="rateButtonStarEmpty" data-value="{$mark}"></span> |
---|
689 | {/if} |
---|
690 | {/foreach} |
---|
691 | {strip}{combine_script id=\'core.scripts\' path=\'themes/default/js/scripts.js\' load=\'async\'} |
---|
692 | {combine_script id=\'rating\' require=\'core.scripts\' path=\'themes/bootstrap_darkroom/js/rating.js\' load=\'async\'} |
---|
693 | {footer_script require=\'jquery\'} |
---|
694 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
695 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
696 | onSuccess : function(rating) {ldelim} |
---|
697 | var e = document.getElementById("updateRate"); |
---|
698 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
699 | e = document.getElementById("ratingScore"); |
---|
700 | if (e) e.innerHTML = rating.score; |
---|
701 | e = document.getElementById("ratingCount"); |
---|
702 | if (e) {ldelim} |
---|
703 | if (rating.count == 1) {ldelim} |
---|
704 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
705 | {rdelim} else {ldelim} |
---|
706 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
707 | {rdelim} |
---|
708 | {rdelim} |
---|
709 | $(\'#averageRate\').find(\'span\').each(function() {ldelim} |
---|
710 | $(this).addClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarFull\' : \'rateButtonStarEmpty\'); |
---|
711 | $(this).removeClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarEmpty\' : \'rateButtonStarFull\'); |
---|
712 | {rdelim}); |
---|
713 | {rdelim} |
---|
714 | {rdelim}); |
---|
715 | {/footer_script} |
---|
716 | {/strip} |
---|
717 | </div> |
---|
718 | </form> |
---|
719 | </div> |
---|
720 | </td> |
---|
721 | </tr> |
---|
722 | </div> |
---|
723 | {/if} |
---|
724 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
725 | <div id="Privacy" class="imageInfo"> |
---|
726 | <tr> |
---|
727 | <th scope="row">{\'Who can see this photo?\'|@translate}</th> |
---|
728 | <td> |
---|
729 | <div> |
---|
730 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
731 | </div> |
---|
732 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
733 | {footer_script require=\'jquery\'}{strip} |
---|
734 | function setPrivacyLevel(id, level){ |
---|
735 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
736 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
737 | { |
---|
738 | method: "POST", |
---|
739 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
740 | onSuccess: function(result) { |
---|
741 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
742 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
743 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
744 | } |
---|
745 | } |
---|
746 | ); |
---|
747 | } |
---|
748 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
749 | {/strip}{/footer_script} |
---|
750 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
751 | {foreach from=$available_permission_levels item=label key=level} |
---|
752 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
753 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
754 | {/foreach} |
---|
755 | </div> |
---|
756 | </td> |
---|
757 | </tr> |
---|
758 | </div> |
---|
759 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
760 | <div id="Description" class="imageInfo"> |
---|
761 | <tr> |
---|
762 | <th scope="row">{\'Description\'|@translate}</th> |
---|
763 | <td> |
---|
764 | {$COMMENT_IMG} |
---|
765 | </td> |
---|
766 | </tr> |
---|
767 | </div> |
---|
768 | {footer_script} |
---|
769 | jQuery(document).ready(function(){ |
---|
770 | jQuery(".imageComment").hide(); |
---|
771 | }); |
---|
772 | {/footer_script} |
---|
773 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
774 | <div id="ImageId" class="imageInfo"> |
---|
775 | <tr> |
---|
776 | <th scope="row">{\'Image id\'|@translate}</th> |
---|
777 | <td>{$addinfophotos.AIPDATA}</td> |
---|
778 | </tr> |
---|
779 | </div> |
---|
780 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
781 | <div id="pab1" class="imageInfo"> |
---|
782 | <tr> |
---|
783 | <th scope="row">{\'Photo added by\'|@translate}</th> |
---|
784 | <td>{$PAB}</td> |
---|
785 | </tr> |
---|
786 | </div> |
---|
787 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
788 | <div id="DownloadCounter" class="imageInfo"> |
---|
789 | <tr> |
---|
790 | <th scope="row">{\'Downloads\'|@translate}</th> |
---|
791 | <td>{$DOWNLOAD_COUNTER}</td> |
---|
792 | </tr> |
---|
793 | </div> |
---|
794 | {else if $addinfophotos.AIPDATA} |
---|
795 | <div id="add_info" class="imageInfo"> |
---|
796 | <tr> |
---|
797 | <th scope="row label">{$addinfophotos.AIPWORDING}</th> |
---|
798 | <td class="value">{$addinfophotos.AIPDATA}</td> |
---|
799 | </tr> |
---|
800 | </div> |
---|
801 | {/if} |
---|
802 | {/foreach} |
---|
803 | <!--and mpp --> |
---|
804 | </tbody> |
---|
805 | </table> |
---|
806 | </div> |
---|
807 | </div> |
---|
808 | </div> |
---|
809 | <!-- metadata --> |
---|
810 | {if isset($metadata)} |
---|
811 | <div role="tabpanel" class="tab-pane" id="tab_metadata"> |
---|
812 | <div id="metadata" class="info"> |
---|
813 | <div class="table-responsive"> |
---|
814 | <table class="table table-sm"> |
---|
815 | <colgroup> |
---|
816 | <col class="w-50"> |
---|
817 | <col class="w-50"> |
---|
818 | </colgroup> |
---|
819 | <tbody> |
---|
820 | {foreach from=$metadata item=meta} |
---|
821 | {foreach from=$meta.lines item=value key=label} |
---|
822 | <tr> |
---|
823 | <th scope="row">{$label}</th> |
---|
824 | <td>{$value}</td> |
---|
825 | </tr> |
---|
826 | {/foreach} |
---|
827 | {/foreach} |
---|
828 | </tbody> |
---|
829 | </table> |
---|
830 | </div> |
---|
831 | </div> |
---|
832 | </div> |
---|
833 | {/if} |
---|
834 | {/if} |
---|
835 | |
---|
836 | <!-- comments --> |
---|
837 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
838 | <div role="tabpanel" class="tab-pane" id="tab_comments"> |
---|
839 | {include file=\'picture_info_comments.tpl\'} |
---|
840 | </div> |
---|
841 | {/if} |
---|
842 | </div> |
---|
843 | </div> |
---|
844 | |
---|
845 | '; |
---|
846 | |
---|
847 | $replasmart=' |
---|
848 | <ul data-role="listview" data-inset="true" id="PictureInfo"> |
---|
849 | {strip} |
---|
850 | <!--mpp --> |
---|
851 | {foreach from=$add_info_photos item=addinfophotos} |
---|
852 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
853 | <li id="Author" class="imageInfo"> |
---|
854 | <dt>{\'Author\'|@translate}</dt> |
---|
855 | <dd>{$INFO_AUTHOR}</dd> |
---|
856 | </li> |
---|
857 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
858 | <li id="datecreate" class="imageInfo"> |
---|
859 | <dt>{\'Created on\'|@translate}</dt> |
---|
860 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
861 | </li> |
---|
862 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
863 | <li id="datepost" class="imageInfo"> |
---|
864 | <dt>{\'Posted on\'|@translate}</dt> |
---|
865 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
866 | </li> |
---|
867 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
868 | <li id="Dimensions" class="imageInfo"> |
---|
869 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
870 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
871 | </li> |
---|
872 | {else if $addinfophotos.AIPID == 5} |
---|
873 | <li id="File" class="imageInfo"> |
---|
874 | <dt>{\'File\'|@translate}</dt> |
---|
875 | <dd>{$INFO_FILE}</dd> |
---|
876 | </li> |
---|
877 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
878 | <li id="Filesize" class="imageInfo"> |
---|
879 | <dt>{\'Filesize\'|@translate}</dt> |
---|
880 | <dd>{$INFO_FILESIZE}</dd> |
---|
881 | </li> |
---|
882 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
883 | <li id="Tags" class="imageInfo"> |
---|
884 | <dt>{\'Tags\'|@translate}</dt> |
---|
885 | <dd> |
---|
886 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
887 | </dd> |
---|
888 | </li> |
---|
889 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
890 | <li id="Categories" class="imageInfo"> |
---|
891 | <dt>{\'Albums\'|@translate}</dt> |
---|
892 | <dd> |
---|
893 | <ul> |
---|
894 | {foreach from=$related_categories item=cat} |
---|
895 | <li>{$cat}</li> |
---|
896 | {/foreach} |
---|
897 | </ul> |
---|
898 | </dd> |
---|
899 | </li> |
---|
900 | {else if $addinfophotos.AIPID == 9} |
---|
901 | <li id="Visits" class="imageInfo"> |
---|
902 | <dt>{\'Visits\'|@translate}</dt> |
---|
903 | <dd>{$INFO_VISITS}</dd> |
---|
904 | </li> |
---|
905 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
906 | <li id="Average" class="imageInfo"> |
---|
907 | <dt>{\'Rating score\'|@translate}</dt> |
---|
908 | <dd> |
---|
909 | {if $rate_summary.count} |
---|
910 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
911 | {else} |
---|
912 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
913 | {/if} |
---|
914 | </dd> |
---|
915 | </li> |
---|
916 | {if isset($rating)} |
---|
917 | <li id="rating" class="imageInfo"> |
---|
918 | <dt> |
---|
919 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
920 | </dt> |
---|
921 | <dd> |
---|
922 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
923 | <div> |
---|
924 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
925 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
926 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
927 | {else} |
---|
928 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
929 | {/if} |
---|
930 | {/foreach} |
---|
931 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
932 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
933 | {footer_script} |
---|
934 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
935 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
936 | onSuccess : function(rating) {ldelim} |
---|
937 | var e = document.getElementById("updateRate"); |
---|
938 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
939 | e = document.getElementById("ratingScore"); |
---|
940 | if (e) e.innerHTML = rating.score; |
---|
941 | e = document.getElementById("ratingCount"); |
---|
942 | if (e) {ldelim} |
---|
943 | if (rating.count == 1) {ldelim} |
---|
944 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
945 | } else {ldelim} |
---|
946 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
947 | } |
---|
948 | {rdelim} |
---|
949 | {rdelim}{rdelim} ); |
---|
950 | {/footer_script} |
---|
951 | {/strip} |
---|
952 | </div> |
---|
953 | </form> |
---|
954 | </dd> |
---|
955 | </li> |
---|
956 | {/if} |
---|
957 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
958 | <li id="Privacy" class="imageInfo"> |
---|
959 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
960 | <dd> |
---|
961 | <div> |
---|
962 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
963 | </div> |
---|
964 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
965 | {footer_script require=\'jquery\'}{strip} |
---|
966 | function setPrivacyLevel(id, level){ |
---|
967 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
968 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
969 | { |
---|
970 | method: "POST", |
---|
971 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
972 | onSuccess: function(result) { |
---|
973 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
974 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
975 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
976 | } |
---|
977 | } |
---|
978 | ); |
---|
979 | } |
---|
980 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
981 | {/strip}{/footer_script} |
---|
982 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
983 | {foreach from=$available_permission_levels item=label key=level} |
---|
984 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
985 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
986 | {/foreach} |
---|
987 | </div> |
---|
988 | </dd> |
---|
989 | </li> |
---|
990 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
991 | <li id="Description" class="imageInfo"> |
---|
992 | <dt>{\'Description\'|@translate}</dt> |
---|
993 | <dd> |
---|
994 | {$COMMENT_IMG} |
---|
995 | </dd> |
---|
996 | </li> |
---|
997 | {footer_script} |
---|
998 | jQuery(document).ready(function(){ |
---|
999 | jQuery(".imageComment").hide(); |
---|
1000 | }); |
---|
1001 | {/footer_script} |
---|
1002 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
1003 | <li id="ImageId" class="imageInfo"> |
---|
1004 | <dt>{\'Image id\'|@translate}</dt> |
---|
1005 | <dd>{$addinfophotos.AIPDATA}</dd> |
---|
1006 | </li> |
---|
1007 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
1008 | <li id="pab1" class="imageInfo"> |
---|
1009 | <dt>{\'Photo added by\'|@translate}</dt> |
---|
1010 | <dd>{$PAB}</dd> |
---|
1011 | </li> |
---|
1012 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
1013 | <li id="DownloadCounter" class="imageInfo"> |
---|
1014 | <dt>{\'Downloads\'|@translate}</dt> |
---|
1015 | <dd>{$DOWNLOAD_COUNTER}</dd> |
---|
1016 | </li> |
---|
1017 | {else if $addinfophotos.AIPDATA} |
---|
1018 | <li id="add_info" class="imageInfo"> |
---|
1019 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
1020 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
1021 | </li> |
---|
1022 | {/if} |
---|
1023 | {/foreach} |
---|
1024 | <!--and mpp --> |
---|
1025 | {if isset($metadata)} |
---|
1026 | '; |
---|
1027 | |
---|
1028 | $repladarkroom='<div id="theImageInfos" class="row justify-content-center"> |
---|
1029 | {if $theme_config->picture_info == \'cards\'}' |
---|
1030 | .$repladarkroomcards.' |
---|
1031 | {elseif $theme_config->picture_info == \'tabs\'}' |
---|
1032 | .$repladarkroomtabs.' |
---|
1033 | {elseif $theme_config->picture_info == \'sidebar\' || $theme_config->picture_info == \'disabled\'} |
---|
1034 | <div class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
1035 | {include file=\'picture_info_comments.tpl\'} |
---|
1036 | </div> |
---|
1037 | {/if} |
---|
1038 | </div> |
---|
1039 | |
---|
1040 | {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|
1041 | '; |
---|
1042 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
1043 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
1044 | if($themeconfig->picture_info=='sidebar'){ |
---|
1045 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
1046 | return preg_replace($search, $replastandard , $content); |
---|
1047 | }else{ |
---|
1048 | $search = '/(<div id="theImageInfos" class="row justify-content-center">).*({if \!empty\(\$PLUGIN_PICTURE_AFTER\)}{\$PLUGIN_PICTURE_AFTER}{\/if})/is'; |
---|
1049 | return preg_replace($search, $repladarkroom , $content); |
---|
1050 | } |
---|
1051 | }else if ($user['theme'] == 'smartpocket'){ |
---|
1052 | $search = '/(<ul data-role="listview" data-inset="true" id="PictureInfo">).*({if isset\(\$metadata\)})/is'; |
---|
1053 | return preg_replace($search, $replasmart , $content); |
---|
1054 | }else{ |
---|
1055 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
1056 | return preg_replace($search, $replastandard , $content); |
---|
1057 | } |
---|
1058 | } |
---|
1059 | |
---|
1060 | add_event_handler('loc_begin_picture', 'add_InfoT'); |
---|
1061 | |
---|
1062 | function add_InfoT() { |
---|
1063 | global $conf, $page, $template, $lang, $pwg_loaded_plugins,$user; |
---|
1064 | |
---|
1065 | if (!empty($page['image_id'])) { |
---|
1066 | |
---|
1067 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
1068 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
1069 | if($themeconfig->picture_info=='cards'){ |
---|
1070 | $tagaff = pwg_db_fetch_assoc(pwg_query('SELECT wording FROM '. ADD_PROP_PHOTO_TABLE.' ORDER BY orderprop DESC LIMIT 1')); |
---|
1071 | if($tagaff['wording']=='Tags'){ |
---|
1072 | $template->assign('TAGAFF',1); |
---|
1073 | }else{ |
---|
1074 | $template->assign('TAGAFF',0); |
---|
1075 | } |
---|
1076 | } |
---|
1077 | } |
---|
1078 | |
---|
1079 | |
---|
1080 | if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} |
---|
1081 | |
---|
1082 | $tab_add_info_one_photo = tab_add_info_by_photo_show(); |
---|
1083 | |
---|
1084 | $query = 'select path FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\';'; |
---|
1085 | $result = pwg_query($query); |
---|
1086 | $row = pwg_db_fetch_assoc($result); |
---|
1087 | $filename=$row['path']; |
---|
1088 | $exif = @exif_read_data($filename); |
---|
1089 | $imginfo = array(); |
---|
1090 | getimagesize($filename, $imginfo); |
---|
1091 | if (isset ($imginfo['APP13'])){$iptc = iptcparse($imginfo['APP13']);} |
---|
1092 | if (pwg_db_num_rows($tab_add_info_one_photo)) { |
---|
1093 | while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { |
---|
1094 | if($info_photos['Typ']==2){ |
---|
1095 | $d = data_info_photosdate($page['image_id'], $info_photos['id_prop_pho']); |
---|
1096 | }else{ |
---|
1097 | $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); |
---|
1098 | } |
---|
1099 | $row = pwg_db_fetch_assoc($d); |
---|
1100 | $items = array( |
---|
1101 | 'AIPID' => $info_photos['id_prop_pho'], |
---|
1102 | 'AIPORDER' => $info_photos['orderprop'], |
---|
1103 | 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), |
---|
1104 | ); |
---|
1105 | if($info_photos['Typ']==2){ |
---|
1106 | if(isset($row['datadate'])){ |
---|
1107 | $items['AIPDATA']=format_date($row['datadate'],array('day_name', 'day', 'month', 'year','time')); |
---|
1108 | } |
---|
1109 | if($info_photos['wording']=="**delpho**"){ |
---|
1110 | $items['AIPWORDING'] =l10n('Delete photo'); |
---|
1111 | } |
---|
1112 | }else if($info_photos['Typ']==3){ |
---|
1113 | if(strpos($info_photos['dataprop'],':')!==false){ |
---|
1114 | $exiftab = explode(':', $info_photos['dataprop']); |
---|
1115 | if (isset($exif[$exiftab[0]][$exiftab[1]])){ |
---|
1116 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
1117 | $items['AIPDATA']=exif_key_translation($exif[$exiftab[0]][$exiftab[1]], $exif[$exiftab[0]][$exiftab[1]]); |
---|
1118 | }else{ |
---|
1119 | $items['AIPDATA']= $exif[$exiftab[0]][$exiftab[1]]; |
---|
1120 | } |
---|
1121 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
1122 | }else if (isset($lang['exif_field_'.$exiftab[1]])){ |
---|
1123 | $items['AIPWORDING']= $lang['exif_field_'.$exiftab[1]]; |
---|
1124 | }else{ |
---|
1125 | $items['AIPWORDING']= $exiftab[1]; |
---|
1126 | } |
---|
1127 | } |
---|
1128 | }else{ |
---|
1129 | if (isset($exif[$info_photos['dataprop']])){ |
---|
1130 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
1131 | $items['AIPDATA']=exif_key_translation($info_photos['dataprop'], $exif[$info_photos['dataprop']]); |
---|
1132 | }else{ |
---|
1133 | $items['AIPDATA']= $exif[$info_photos['dataprop']]; |
---|
1134 | } |
---|
1135 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
1136 | }else if (isset($lang['exif_field_'.$info_photos['dataprop']])){ |
---|
1137 | $items['AIPWORDING']= $lang['exif_field_'.$info_photos['dataprop']]; |
---|
1138 | }else{ |
---|
1139 | $items['AIPWORDING']= $info_photos['dataprop']; |
---|
1140 | } |
---|
1141 | } |
---|
1142 | } |
---|
1143 | }else if($info_photos['Typ']==6){ |
---|
1144 | $items['AIPWORDING']=trigger_change('AP_render_content', $info_photos['wording']); |
---|
1145 | if (isset($iptc[$info_photos['dataprop']])){ |
---|
1146 | $items['AIPDATA']=implode(", ", $iptc[$info_photos['dataprop']]); |
---|
1147 | } |
---|
1148 | }else if($info_photos['Typ']==1 AND $info_photos['dataprop']=='showid'){ |
---|
1149 | $items['AIPDATA']=$page['image_id']; |
---|
1150 | }else{ |
---|
1151 | if(isset($row['data'])){ |
---|
1152 | $items['AIPDATA']=trigger_change('AP_render_content', $row['data']); |
---|
1153 | }else{ |
---|
1154 | $items['AIPDATA']=''; |
---|
1155 | } |
---|
1156 | } |
---|
1157 | |
---|
1158 | |
---|
1159 | $template->append('add_info_photos', $items); |
---|
1160 | } |
---|
1161 | } |
---|
1162 | |
---|
1163 | $template->assign( |
---|
1164 | array( |
---|
1165 | 'A' => 'a' |
---|
1166 | )); |
---|
1167 | } |
---|
1168 | } |
---|
1169 | |
---|
1170 | ?> |
---|