1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Manage Properties Photos plugin for Piwigo by TEMMII | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2007-2020 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 | $repla1='<dl id="standard" class="imageInfoTable">{strip}'; |
---|
35 | $repla=' |
---|
36 | {foreach from=$add_info_photos item=addinfophotos} |
---|
37 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
38 | <div id="Author" class="imageInfo"> |
---|
39 | <dt>{\'Author\'|@translate}</dt> |
---|
40 | <dd>{$INFO_AUTHOR}</dd> |
---|
41 | </div> |
---|
42 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
43 | <div id="datecreate" class="imageInfo"> |
---|
44 | <dt>{\'Created on\'|@translate}</dt> |
---|
45 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
46 | </div> |
---|
47 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
48 | <div id="datepost" class="imageInfo"> |
---|
49 | <dt>{\'Posted on\'|@translate}</dt> |
---|
50 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
51 | </div> |
---|
52 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
53 | <div id="Dimensions" class="imageInfo"> |
---|
54 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
55 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
56 | </div> |
---|
57 | {else if $addinfophotos.AIPID == 5} |
---|
58 | <div id="File" class="imageInfo"> |
---|
59 | <dt>{\'File\'|@translate}</dt> |
---|
60 | <dd>{$INFO_FILE}</dd> |
---|
61 | </div> |
---|
62 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
63 | <div id="Filesize" class="imageInfo"> |
---|
64 | <dt>{\'Filesize\'|@translate}</dt> |
---|
65 | <dd>{$INFO_FILESIZE}</dd> |
---|
66 | </div> |
---|
67 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
68 | <div id="Tags" class="imageInfo"> |
---|
69 | <dt>{\'Tags\'|@translate}</dt> |
---|
70 | <dd> |
---|
71 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
72 | </dd> |
---|
73 | </div> |
---|
74 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
75 | <div id="Categories" class="imageInfo"> |
---|
76 | <dt>{\'Albums\'|@translate}</dt> |
---|
77 | <dd> |
---|
78 | <ul> |
---|
79 | {foreach from=$related_categories item=cat} |
---|
80 | <li>{$cat}</li> |
---|
81 | {/foreach} |
---|
82 | </ul> |
---|
83 | </dd> |
---|
84 | </div> |
---|
85 | {else if $addinfophotos.AIPID == 9} |
---|
86 | <div id="Visits" class="imageInfo"> |
---|
87 | <dt>{\'Visits\'|@translate}</dt> |
---|
88 | <dd>{$INFO_VISITS}</dd> |
---|
89 | </div> |
---|
90 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
91 | <div id="Average" class="imageInfo"> |
---|
92 | <dt>{\'Rating score\'|@translate}</dt> |
---|
93 | <dd> |
---|
94 | {if $rate_summary.count} |
---|
95 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
96 | {else} |
---|
97 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
98 | {/if} |
---|
99 | </dd> |
---|
100 | </div> |
---|
101 | {if isset($rating)} |
---|
102 | <div id="rating" class="imageInfo"> |
---|
103 | <dt> |
---|
104 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
105 | </dt> |
---|
106 | <dd> |
---|
107 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
108 | <div> |
---|
109 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
110 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
111 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
112 | {else} |
---|
113 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
114 | {/if} |
---|
115 | {/foreach} |
---|
116 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
117 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
118 | {footer_script} |
---|
119 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
120 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
121 | onSuccess : function(rating) {ldelim} |
---|
122 | var e = document.getElementById("updateRate"); |
---|
123 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
124 | e = document.getElementById("ratingScore"); |
---|
125 | if (e) e.innerHTML = rating.score; |
---|
126 | e = document.getElementById("ratingCount"); |
---|
127 | if (e) {ldelim} |
---|
128 | if (rating.count == 1) {ldelim} |
---|
129 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
130 | } else {ldelim} |
---|
131 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
132 | } |
---|
133 | {rdelim} |
---|
134 | {rdelim}{rdelim} ); |
---|
135 | {/footer_script} |
---|
136 | {/strip} |
---|
137 | </div> |
---|
138 | </form> |
---|
139 | </dd> |
---|
140 | </div> |
---|
141 | {/if} |
---|
142 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
143 | <div id="Privacy" class="imageInfo"> |
---|
144 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
145 | <dd> |
---|
146 | <div> |
---|
147 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
148 | </div> |
---|
149 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
150 | {footer_script require=\'jquery\'}{strip} |
---|
151 | function setPrivacyLevel(id, level){ |
---|
152 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
153 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
154 | { |
---|
155 | method: "POST", |
---|
156 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
157 | onSuccess: function(result) { |
---|
158 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
159 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
160 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
161 | } |
---|
162 | } |
---|
163 | ); |
---|
164 | } |
---|
165 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
166 | {/strip}{/footer_script} |
---|
167 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
168 | {foreach from=$available_permission_levels item=label key=level} |
---|
169 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
170 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
171 | {/foreach} |
---|
172 | </div> |
---|
173 | </dd> |
---|
174 | </div> |
---|
175 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
176 | <div id="Description" class="imageInfo"> |
---|
177 | <dt>{\'Description\'|@translate}</dt> |
---|
178 | <dd> |
---|
179 | {$COMMENT_IMG} |
---|
180 | </dd> |
---|
181 | </div> |
---|
182 | {footer_script} |
---|
183 | jQuery(document).ready(function(){ |
---|
184 | jQuery(".imageComment").hide(); |
---|
185 | }); |
---|
186 | {/footer_script} |
---|
187 | {else if $addinfophotos.AIPDATA} |
---|
188 | <div id="add_info" class="imageInfo"> |
---|
189 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
190 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
191 | </div> |
---|
192 | {/if} |
---|
193 | {/foreach} |
---|
194 | '; |
---|
195 | $repla2='{/strip} |
---|
196 | </dl> |
---|
197 | {if isset($metadata)}'; |
---|
198 | |
---|
199 | $repladarkroomcards=' |
---|
200 | <div id="infopanel-left" class="col-lg-6 col-12"> |
---|
201 | <!-- Picture infos --> |
---|
202 | <div id="card-informations" class="card mb-2"> |
---|
203 | <div class="card-body"> |
---|
204 | <h5 class="card-title">{\'Information\'|@translate}</h5> |
---|
205 | <div id="info-content" class="d-flex flex-column"> |
---|
206 | '.$repla.' |
---|
207 | </div></div></div></div> |
---|
208 | {if isset($metadata) || (isset($comment_add) || $COMMENT_COUNT > 0)} |
---|
209 | <div id="infopanel-right" class="col-lg-6 col-12"> |
---|
210 | <!-- metadata --> |
---|
211 | {if isset($metadata)} |
---|
212 | {if isset($loaded_plugins[\'exif_view\'])} |
---|
213 | {assign var="exif_make" value="{\'exif_field_Make\'|@translate}"} |
---|
214 | {assign var="exif_model" value="{\'exif_field_Model\'|@translate}"} |
---|
215 | {assign var="exif_lens" value="{\'exif_field_UndefinedTag:0xA434\'|@translate}"} |
---|
216 | {assign var="exif_fnumber" value="{\'exif_field_FNumber\'|@translate}"} |
---|
217 | {assign var="exif_iso" value="{\'exif_field_ISOSpeedRatings\'|@translate}"} |
---|
218 | {assign var="exif_focal_length" value="{\'exif_field_FocalLength\'|@translate}"} |
---|
219 | {assign var="exif_flash" value="{\'exif_field_Flash\'|@translate}"} |
---|
220 | {assign var="exif_exposure_time" value="{\'exif_field_ExposureTime\'|@translate}"} |
---|
221 | {assign var="exif_exposure_bias" value="{\'exif_field_ExposureBiasValue\'|@translate}"} |
---|
222 | {else} |
---|
223 | {assign var="exif_make" value="Make"} |
---|
224 | {assign var="exif_model" value="Model"} |
---|
225 | {assign var="exif_lens" value="UndefinedTag:0xA434"} |
---|
226 | {assign var="exif_fnumber" value="FNumber"} |
---|
227 | {assign var="exif_iso" value="ISOSpeedRatings"} |
---|
228 | {assign var="exif_focal_length" value="FocalLength"} |
---|
229 | {assign var="exif_flash" value="Flash"} |
---|
230 | {assign var="exif_exposure_time" value="ExposureTime"} |
---|
231 | {assign var="exif_exposure_bias" value="ExposureBiasValue"} |
---|
232 | {/if} |
---|
233 | |
---|
234 | <div id="card-metadata" class="card mb-2"> |
---|
235 | <div class="card-body"> |
---|
236 | <h5 class="card-title">{\'EXIF Metadata\'|@translate}</h5> |
---|
237 | <div id="metadata"> |
---|
238 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines) || array_key_exists("{$exif_model}", $metadata.0.lines))} |
---|
239 | <div class="row" style="line-height: 40px"> |
---|
240 | <div class="col-12"> |
---|
241 | <span class="camera-compact fa-3x mr-3" title="{$exif_make} & {$exif_model}"></span> |
---|
242 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines))}{$metadata.0.lines[{$exif_make}]}{/if} |
---|
243 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_model}", $metadata.0.lines))}{$metadata.0.lines[{$exif_model}]}{/if} |
---|
244 | </div> |
---|
245 | </div> |
---|
246 | {/if} |
---|
247 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_lens}", $metadata.0.lines))} |
---|
248 | <div class="row" style="line-height: 40px"> |
---|
249 | <div class="col-12"> |
---|
250 | <span class="camera-lens-h fa-3x mr-3" title="{$exif_lens}"></span> |
---|
251 | {$metadata.0.lines[{$exif_lens}]} |
---|
252 | </div> |
---|
253 | </div> |
---|
254 | {/if} |
---|
255 | <div class="row"> |
---|
256 | <div class="col-12{if $theme_config->fluid_width} col-xl-10{/if}"> |
---|
257 | <div class="row"> |
---|
258 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_fnumber}", $metadata.0.lines))} |
---|
259 | <div class="col-6 col-sm-4"> |
---|
260 | <span class="camera-aperture fa-2x pr-2" title="{$exif_fnumber}"></span> f/{$metadata.0.lines[{$exif_fnumber}]} |
---|
261 | </div> |
---|
262 | {/if} |
---|
263 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_focal_length}", $metadata.0.lines))} |
---|
264 | <div class="col-6 col-sm-4"> |
---|
265 | <span class="camera-focal-length fa-2x pr-2" title="{$exif_focal_length}"></span> {$metadata.0.lines[{$exif_focal_length}]} |
---|
266 | </div> |
---|
267 | {/if} |
---|
268 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_time}", $metadata.0.lines))} |
---|
269 | <div class="col-6 col-sm-4"> |
---|
270 | <span class="camera-shutter-speed fa-2x pr-2" title="{$exif_exposure_time}"></span> {$metadata.0.lines[{$exif_exposure_time}]} |
---|
271 | </div> |
---|
272 | {/if} |
---|
273 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_iso}", $metadata.0.lines))} |
---|
274 | <div class="col-6 col-sm-4"> |
---|
275 | <span class="camera-iso fa-2x pr-2" title="{$exif_iso}"></span> {$metadata.0.lines[{$exif_iso}]} |
---|
276 | </div> |
---|
277 | {/if} |
---|
278 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_bias}", $metadata.0.lines))} |
---|
279 | <div class="col-6 col-sm-4"> |
---|
280 | <span class="camera-exposure fa-2x pr-2" title="{$exif_exposure_bias}"></span> {$metadata.0.lines[{$exif_exposure_bias}]} |
---|
281 | </div> |
---|
282 | {/if} |
---|
283 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_flash}", $metadata.0.lines))} |
---|
284 | <div class="col-6 col-sm-4"> |
---|
285 | <span class="camera-flash fa-2x pr-2 float-left h-100" title="{$exif_flash}"></span><div> {$metadata.0.lines[{$exif_flash}]}</div> |
---|
286 | </div> |
---|
287 | {/if} |
---|
288 | </div> |
---|
289 | </div> |
---|
290 | </div> |
---|
291 | </div> |
---|
292 | <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> |
---|
293 | {footer_script require=\'jquery\'} |
---|
294 | $(\'#show_exif_data\').on(\'click\', function() { |
---|
295 | if ($(\'#full_exif_data\').hasClass(\'d-none\')) { |
---|
296 | $(\'#full_exif_data\').addClass(\'d-flex\').removeClass(\'d-none\'); |
---|
297 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Hide EXIF data"|@translate}\'); |
---|
298 | } else { |
---|
299 | $(\'#full_exif_data\').addClass(\'d-none\').removeClass(\'d-flex\'); |
---|
300 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Show EXIF data"|@translate}\'); |
---|
301 | } |
---|
302 | }); |
---|
303 | {/footer_script} |
---|
304 | <div id="full_exif_data" class="d-none flex-column mt-2"> |
---|
305 | {foreach from=$metadata item=meta} |
---|
306 | {foreach from=$meta.lines item=value key=label} |
---|
307 | <div> |
---|
308 | <dl class="row mb-0"> |
---|
309 | <dt class="col-sm-6">{$label}</dt> |
---|
310 | <dd class="col-sm-6">{$value}</td> |
---|
311 | </tr> |
---|
312 | </dl> |
---|
313 | </div> |
---|
314 | {/foreach} |
---|
315 | {/foreach} |
---|
316 | </div> |
---|
317 | </div> |
---|
318 | </div> |
---|
319 | {/if} |
---|
320 | <div id="card-comments" class="ml-2"> |
---|
321 | {include file=\'picture_info_comments.tpl\'} |
---|
322 | </div> |
---|
323 | </div> |
---|
324 | {/if} |
---|
325 | '; |
---|
326 | |
---|
327 | $repladarkroomtabs=' |
---|
328 | <div id="infopanel" class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
329 | <!-- Nav tabs --> |
---|
330 | <ul class="nav nav-tabs nav-justified flex-column flex-sm-row" role="tablist"> |
---|
331 | {if $theme_config->picture_info == \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
332 | <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> |
---|
333 | {if isset($metadata)} |
---|
334 | <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> |
---|
335 | {/if} |
---|
336 | {/if} |
---|
337 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
338 | <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> |
---|
339 | {/if} |
---|
340 | </ul> |
---|
341 | |
---|
342 | <!-- Tab panes --> |
---|
343 | <div class="tab-content d-flex justify-content-center"> |
---|
344 | {if $theme_config->picture_info === \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
345 | <div role="tabpanel" class="tab-pane active" id="tab_info"> |
---|
346 | <div id="info-content" class="info"> |
---|
347 | <div class="table-responsive"> |
---|
348 | <table class="table table-sm"> |
---|
349 | <colgroup> |
---|
350 | <col class="w-50"> |
---|
351 | <col class="w-50"> |
---|
352 | </colgroup> |
---|
353 | <tbody> |
---|
354 | <!--mpp --> |
---|
355 | {foreach from=$add_info_photos item=addinfophotos} |
---|
356 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
357 | <div id="Author" class="imageInfo"> |
---|
358 | <tr> |
---|
359 | <th scope="row">{\'Author\'|@translate}</th> |
---|
360 | <td>{$INFO_AUTHOR}</td> |
---|
361 | </tr> |
---|
362 | </div> |
---|
363 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
364 | <div id="datecreate" class="imageInfo"> |
---|
365 | <tr> |
---|
366 | <th scope="row">{\'Created on\'|@translate}</th> |
---|
367 | <td>{$INFO_CREATION_DATE}</td> |
---|
368 | </tr> |
---|
369 | </div> |
---|
370 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
371 | <div id="datepost" class="imageInfo"> |
---|
372 | <tr> |
---|
373 | <th scope="row">{\'Posted on\'|@translate}</th> |
---|
374 | <td>{$INFO_POSTED_DATE}</td> |
---|
375 | </tr> |
---|
376 | </div> |
---|
377 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
378 | <div id="Dimensions" class="imageInfo"> |
---|
379 | <tr> |
---|
380 | <th scope="row">{\'Dimensions\'|@translate}</th> |
---|
381 | <td>{$INFO_DIMENSIONS}</td> |
---|
382 | </tr> |
---|
383 | </div> |
---|
384 | {else if $addinfophotos.AIPID == 5} |
---|
385 | <div id="File" class="imageInfo"> |
---|
386 | <tr> |
---|
387 | <th scope="row">{\'File\'|@translate}</th> |
---|
388 | <td>{$INFO_FILE}</td> |
---|
389 | </tr> |
---|
390 | </div> |
---|
391 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
392 | <div id="Filesize" class="imageInfo"> |
---|
393 | <tr> |
---|
394 | <th scope="row">{\'Filesize\'|@translate}</th> |
---|
395 | <td>{$INFO_FILESIZE}</td> |
---|
396 | </tr> |
---|
397 | </div> |
---|
398 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
399 | <div id="Tags" class="imageInfo"> |
---|
400 | <tr> |
---|
401 | <th scope="row">{\'Tags\'|@translate}</th> |
---|
402 | <td> |
---|
403 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
404 | </td> |
---|
405 | </tr> |
---|
406 | </div> |
---|
407 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
408 | <div id="Categories" class="imageInfo"> |
---|
409 | <tr> |
---|
410 | <th scope="row">{\'Albums\'|@translate}</th> |
---|
411 | <td> |
---|
412 | <ul> |
---|
413 | {foreach from=$related_categories item=cat} |
---|
414 | <li>{$cat}</li> |
---|
415 | {/foreach} |
---|
416 | </ul> |
---|
417 | </td> |
---|
418 | </tr> |
---|
419 | </div> |
---|
420 | {else if $addinfophotos.AIPID == 9} |
---|
421 | <div id="Visits" class="imageInfo"> |
---|
422 | <tr> |
---|
423 | <th scope="row">{\'Visits\'|@translate}</th> |
---|
424 | <td>{$INFO_VISITS}</td> |
---|
425 | </tr> |
---|
426 | </div> |
---|
427 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
428 | <div id="Average" class="imageInfo"> |
---|
429 | <tr> |
---|
430 | <th scope="row">{\'Rating score\'|@translate}</th> |
---|
431 | <td> |
---|
432 | {if $rate_summary.count} |
---|
433 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
434 | {else} |
---|
435 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
436 | {/if} |
---|
437 | </td> |
---|
438 | </tr> |
---|
439 | </div> |
---|
440 | {if isset($rating)} |
---|
441 | <div id="rating" class="imageInfo"> |
---|
442 | <tr> |
---|
443 | <th scope="row"> |
---|
444 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
445 | </th> |
---|
446 | <td> |
---|
447 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
448 | <div> |
---|
449 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
450 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
451 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
452 | {else} |
---|
453 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
454 | {/if} |
---|
455 | {/foreach} |
---|
456 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
457 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
458 | {footer_script} |
---|
459 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
460 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
461 | onSuccess : function(rating) {ldelim} |
---|
462 | var e = document.getElementById("updateRate"); |
---|
463 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
464 | e = document.getElementById("ratingScore"); |
---|
465 | if (e) e.innerHTML = rating.score; |
---|
466 | e = document.getElementById("ratingCount"); |
---|
467 | if (e) {ldelim} |
---|
468 | if (rating.count == 1) {ldelim} |
---|
469 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
470 | } else {ldelim} |
---|
471 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
472 | } |
---|
473 | {rdelim} |
---|
474 | {rdelim}{rdelim} ); |
---|
475 | {/footer_script} |
---|
476 | {/strip} |
---|
477 | </div> |
---|
478 | </form> |
---|
479 | </td> |
---|
480 | </tr> |
---|
481 | </div> |
---|
482 | {/if} |
---|
483 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
484 | <div id="Privacy" class="imageInfo"> |
---|
485 | <tr> |
---|
486 | <th scope="row">{\'Who can see this photo?\'|@translate}</th> |
---|
487 | <td> |
---|
488 | <div> |
---|
489 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
490 | </div> |
---|
491 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
492 | {footer_script require=\'jquery\'}{strip} |
---|
493 | function setPrivacyLevel(id, level){ |
---|
494 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
495 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
496 | { |
---|
497 | method: "POST", |
---|
498 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
499 | onSuccess: function(result) { |
---|
500 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
501 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
502 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
503 | } |
---|
504 | } |
---|
505 | ); |
---|
506 | } |
---|
507 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
508 | {/strip}{/footer_script} |
---|
509 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
510 | {foreach from=$available_permission_levels item=label key=level} |
---|
511 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
512 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
513 | {/foreach} |
---|
514 | </div> |
---|
515 | </td> |
---|
516 | </tr> |
---|
517 | </div> |
---|
518 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
519 | <div id="Description" class="imageInfo"> |
---|
520 | <tr> |
---|
521 | <th scope="row">{\'Description\'|@translate}</th> |
---|
522 | <td> |
---|
523 | {$COMMENT_IMG} |
---|
524 | </td> |
---|
525 | </tr> |
---|
526 | </div> |
---|
527 | {footer_script} |
---|
528 | jQuery(document).ready(function(){ |
---|
529 | jQuery(".imageComment").hide(); |
---|
530 | }); |
---|
531 | {/footer_script} |
---|
532 | {else if $addinfophotos.AIPDATA} |
---|
533 | <div id="add_info" class="imageInfo"> |
---|
534 | <tr> |
---|
535 | <th scope="row label">{$addinfophotos.AIPWORDING}</th> |
---|
536 | <td class="value">{$addinfophotos.AIPDATA}</td> |
---|
537 | </tr> |
---|
538 | </div> |
---|
539 | {/if} |
---|
540 | {/foreach} |
---|
541 | <!--and mpp --> |
---|
542 | </tbody> |
---|
543 | </table> |
---|
544 | </div> |
---|
545 | </div> |
---|
546 | </div> |
---|
547 | <!-- metadata --> |
---|
548 | {if isset($metadata)} |
---|
549 | <div role="tabpanel" class="tab-pane" id="tab_metadata"> |
---|
550 | <div id="metadata" class="info"> |
---|
551 | <div class="table-responsive"> |
---|
552 | <table class="table table-sm"> |
---|
553 | <colgroup> |
---|
554 | <col class="w-50"> |
---|
555 | <col class="w-50"> |
---|
556 | </colgroup> |
---|
557 | <tbody> |
---|
558 | {foreach from=$metadata item=meta} |
---|
559 | {foreach from=$meta.lines item=value key=label} |
---|
560 | <tr> |
---|
561 | <th scope="row">{$label}</th> |
---|
562 | <td>{$value}</td> |
---|
563 | </tr> |
---|
564 | {/foreach} |
---|
565 | {/foreach} |
---|
566 | </tbody> |
---|
567 | </table> |
---|
568 | </div> |
---|
569 | </div> |
---|
570 | </div> |
---|
571 | {/if} |
---|
572 | {/if} |
---|
573 | |
---|
574 | <!-- comments --> |
---|
575 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
576 | <div role="tabpanel" class="tab-pane" id="tab_comments"> |
---|
577 | {include file=\'picture_info_comments.tpl\'} |
---|
578 | </div> |
---|
579 | {/if} |
---|
580 | </div> |
---|
581 | </div> |
---|
582 | |
---|
583 | '; |
---|
584 | |
---|
585 | $replasmart=' |
---|
586 | <ul data-role="listview" data-inset="true" id="PictureInfo"> |
---|
587 | {strip} |
---|
588 | <!--mpp --> |
---|
589 | {foreach from=$add_info_photos item=addinfophotos} |
---|
590 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
591 | <li id="Author" class="imageInfo"> |
---|
592 | <dt>{\'Author\'|@translate}</dt> |
---|
593 | <dd>{$INFO_AUTHOR}</dd> |
---|
594 | </li> |
---|
595 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
596 | <li id="datecreate" class="imageInfo"> |
---|
597 | <dt>{\'Created on\'|@translate}</dt> |
---|
598 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
599 | </li> |
---|
600 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
601 | <li id="datepost" class="imageInfo"> |
---|
602 | <dt>{\'Posted on\'|@translate}</dt> |
---|
603 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
604 | </li> |
---|
605 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
606 | <li id="Dimensions" class="imageInfo"> |
---|
607 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
608 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
609 | </li> |
---|
610 | {else if $addinfophotos.AIPID == 5} |
---|
611 | <li id="File" class="imageInfo"> |
---|
612 | <dt>{\'File\'|@translate}</dt> |
---|
613 | <dd>{$INFO_FILE}</dd> |
---|
614 | </li> |
---|
615 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
616 | <li id="Filesize" class="imageInfo"> |
---|
617 | <dt>{\'Filesize\'|@translate}</dt> |
---|
618 | <dd>{$INFO_FILESIZE}</dd> |
---|
619 | </li> |
---|
620 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
621 | <li id="Tags" class="imageInfo"> |
---|
622 | <dt>{\'Tags\'|@translate}</dt> |
---|
623 | <dd> |
---|
624 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
625 | </dd> |
---|
626 | </li> |
---|
627 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
628 | <li id="Categories" class="imageInfo"> |
---|
629 | <dt>{\'Albums\'|@translate}</dt> |
---|
630 | <dd> |
---|
631 | <ul> |
---|
632 | {foreach from=$related_categories item=cat} |
---|
633 | <li>{$cat}</li> |
---|
634 | {/foreach} |
---|
635 | </ul> |
---|
636 | </dd> |
---|
637 | </li> |
---|
638 | {else if $addinfophotos.AIPID == 9} |
---|
639 | <li id="Visits" class="imageInfo"> |
---|
640 | <dt>{\'Visits\'|@translate}</dt> |
---|
641 | <dd>{$INFO_VISITS}</dd> |
---|
642 | </li> |
---|
643 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
644 | <li id="Average" class="imageInfo"> |
---|
645 | <dt>{\'Rating score\'|@translate}</dt> |
---|
646 | <dd> |
---|
647 | {if $rate_summary.count} |
---|
648 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
649 | {else} |
---|
650 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
651 | {/if} |
---|
652 | </dd> |
---|
653 | </li> |
---|
654 | {if isset($rating)} |
---|
655 | <li id="rating" class="imageInfo"> |
---|
656 | <dt> |
---|
657 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
658 | </dt> |
---|
659 | <dd> |
---|
660 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
661 | <div> |
---|
662 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
663 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
664 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
665 | {else} |
---|
666 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
667 | {/if} |
---|
668 | {/foreach} |
---|
669 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
670 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
671 | {footer_script} |
---|
672 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
673 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
674 | onSuccess : function(rating) {ldelim} |
---|
675 | var e = document.getElementById("updateRate"); |
---|
676 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
677 | e = document.getElementById("ratingScore"); |
---|
678 | if (e) e.innerHTML = rating.score; |
---|
679 | e = document.getElementById("ratingCount"); |
---|
680 | if (e) {ldelim} |
---|
681 | if (rating.count == 1) {ldelim} |
---|
682 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
683 | } else {ldelim} |
---|
684 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
685 | } |
---|
686 | {rdelim} |
---|
687 | {rdelim}{rdelim} ); |
---|
688 | {/footer_script} |
---|
689 | {/strip} |
---|
690 | </div> |
---|
691 | </form> |
---|
692 | </dd> |
---|
693 | </li> |
---|
694 | {/if} |
---|
695 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
696 | <li id="Privacy" class="imageInfo"> |
---|
697 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
698 | <dd> |
---|
699 | <div> |
---|
700 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
701 | </div> |
---|
702 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
703 | {footer_script require=\'jquery\'}{strip} |
---|
704 | function setPrivacyLevel(id, level){ |
---|
705 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
706 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
707 | { |
---|
708 | method: "POST", |
---|
709 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
710 | onSuccess: function(result) { |
---|
711 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
712 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
713 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
714 | } |
---|
715 | } |
---|
716 | ); |
---|
717 | } |
---|
718 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
719 | {/strip}{/footer_script} |
---|
720 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
721 | {foreach from=$available_permission_levels item=label key=level} |
---|
722 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
723 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
724 | {/foreach} |
---|
725 | </div> |
---|
726 | </dd> |
---|
727 | </li> |
---|
728 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
729 | <li id="Description" class="imageInfo"> |
---|
730 | <dt>{\'Description\'|@translate}</dt> |
---|
731 | <dd> |
---|
732 | {$COMMENT_IMG} |
---|
733 | </dd> |
---|
734 | </li> |
---|
735 | {footer_script} |
---|
736 | jQuery(document).ready(function(){ |
---|
737 | jQuery(".imageComment").hide(); |
---|
738 | }); |
---|
739 | {/footer_script} |
---|
740 | {else if $addinfophotos.AIPDATA} |
---|
741 | <li id="add_info" class="imageInfo"> |
---|
742 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
743 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
744 | </li> |
---|
745 | {/if} |
---|
746 | {/foreach} |
---|
747 | <!--and mpp --> |
---|
748 | {if isset($metadata)} |
---|
749 | '; |
---|
750 | |
---|
751 | $replastandard=$repla1.$repla.$repla2; |
---|
752 | |
---|
753 | $repladarkroom='<div id="theImageInfos" class="row justify-content-center"> |
---|
754 | {if $theme_config->picture_info == \'cards\'}' |
---|
755 | .$repladarkroomcards.' |
---|
756 | {elseif $theme_config->picture_info == \'tabs\'}' |
---|
757 | .$repladarkroomtabs.' |
---|
758 | {elseif $theme_config->picture_info == \'sidebar\' || $theme_config->picture_info == \'disabled\'} |
---|
759 | <div class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
760 | {include file=\'picture_info_comments.tpl\'} |
---|
761 | </div> |
---|
762 | {/if} |
---|
763 | </div> |
---|
764 | |
---|
765 | {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|
766 | '; |
---|
767 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
768 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
769 | if($themeconfig->picture_info=='sidebar'){ |
---|
770 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
771 | return preg_replace($search, $replastandard , $content); |
---|
772 | }else{ |
---|
773 | $search = '/(<div id="theImageInfos" class="row justify-content-center">).*({if \!empty\(\$PLUGIN_PICTURE_AFTER\)}{\$PLUGIN_PICTURE_AFTER}{\/if})/is'; |
---|
774 | return preg_replace($search, $repladarkroom , $content); |
---|
775 | } |
---|
776 | }else if ($user['theme'] == 'smartpocket'){ |
---|
777 | $search = '/(<ul data-role="listview" data-inset="true" id="PictureInfo">).*({if isset\(\$metadata\)})/is'; |
---|
778 | return preg_replace($search, $replasmart , $content); |
---|
779 | }else{ |
---|
780 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
781 | return preg_replace($search, $replastandard , $content); |
---|
782 | } |
---|
783 | } |
---|
784 | |
---|
785 | add_event_handler('loc_begin_picture', 'add_InfoT'); |
---|
786 | |
---|
787 | function add_InfoT() { |
---|
788 | global $conf, $page, $template, $lang, $pwg_loaded_plugins; |
---|
789 | |
---|
790 | if (!empty($page['image_id'])) { |
---|
791 | if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} |
---|
792 | |
---|
793 | $tab_add_info_one_photo = tab_add_info_by_photo_show(); |
---|
794 | |
---|
795 | $query = 'select path FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\';'; |
---|
796 | $result = pwg_query($query); |
---|
797 | $row = pwg_db_fetch_assoc($result); |
---|
798 | $filename=$row['path']; |
---|
799 | $exif = exif_read_data($filename); |
---|
800 | $imginfo = array(); |
---|
801 | getimagesize($filename, $imginfo); |
---|
802 | if (isset ($imginfo['APP13'])){$iptc = iptcparse($imginfo['APP13']);} |
---|
803 | if (pwg_db_num_rows($tab_add_info_one_photo)) { |
---|
804 | while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { |
---|
805 | if($info_photos['Typ']==2){ |
---|
806 | $d = data_info_photosdate($page['image_id'], $info_photos['id_prop_pho']); |
---|
807 | }else{ |
---|
808 | $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); |
---|
809 | } |
---|
810 | $row = pwg_db_fetch_assoc($d); |
---|
811 | $items = array( |
---|
812 | 'AIPID' => $info_photos['id_prop_pho'], |
---|
813 | 'AIPORDER' => $info_photos['orderprop'], |
---|
814 | 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), |
---|
815 | ); |
---|
816 | if($info_photos['Typ']==2){ |
---|
817 | $items['AIPDATA']=$row['datadate']; |
---|
818 | if($info_photos['wording']=="**delpho**"){ |
---|
819 | $items['AIPWORDING'] =l10n('Delete photo'); |
---|
820 | } |
---|
821 | }else if($info_photos['Typ']==3){ |
---|
822 | if(strpos($info_photos['dataprop'],':')!==false){ |
---|
823 | $exiftab = explode(':', $info_photos['dataprop']); |
---|
824 | if (isset($exif[$exiftab[0]][$exiftab[1]])){ |
---|
825 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
826 | $items['AIPDATA']=exif_key_translation($exif[$exiftab[0]][$exiftab[1]], $exif[$exiftab[0]][$exiftab[1]]); |
---|
827 | }else{ |
---|
828 | $items['AIPDATA']= $exif[$exiftab[0]][$exiftab[1]]; |
---|
829 | } |
---|
830 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
831 | }else if (isset($lang['exif_field_'.$exiftab[1]])){ |
---|
832 | $items['AIPWORDING']= $lang['exif_field_'.$exiftab[1]]; |
---|
833 | }else{ |
---|
834 | $items['AIPWORDING']= $exiftab[1]; |
---|
835 | } |
---|
836 | } |
---|
837 | }else{ |
---|
838 | if (isset($exif[$info_photos['dataprop']])){ |
---|
839 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
840 | $items['AIPDATA']=exif_key_translation($info_photos['dataprop'], $exif[$info_photos['dataprop']]); |
---|
841 | }else{ |
---|
842 | $items['AIPDATA']= $exif[$info_photos['dataprop']]; |
---|
843 | } |
---|
844 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
845 | }else if (isset($lang['exif_field_'.$info_photos['dataprop']])){ |
---|
846 | $items['AIPWORDING']= $lang['exif_field_'.$info_photos['dataprop']]; |
---|
847 | }else{ |
---|
848 | $items['AIPWORDING']= $info_photos['dataprop']; |
---|
849 | } |
---|
850 | } |
---|
851 | } |
---|
852 | }else if($info_photos['Typ']==6){ |
---|
853 | $items['AIPWORDING']=trigger_change('AP_render_content', $info_photos['wording']); |
---|
854 | if (isset($iptc[$info_photos['dataprop']])){ |
---|
855 | $items['AIPDATA']=implode(", ", $iptc[$info_photos['dataprop']]); |
---|
856 | } |
---|
857 | }else{ |
---|
858 | $items['AIPDATA']=trigger_change('AP_render_content', $row['data']); |
---|
859 | |
---|
860 | } |
---|
861 | |
---|
862 | |
---|
863 | $template->append('add_info_photos', $items); |
---|
864 | } |
---|
865 | } |
---|
866 | |
---|
867 | $template->assign( |
---|
868 | array( |
---|
869 | 'A' => 'a' |
---|
870 | )); |
---|
871 | } |
---|
872 | } |
---|
873 | |
---|
874 | ?> |
---|