set_prefilter('picture', 'add_info_photo_preT'); } function add_info_photo_preT($content, &$smarty) { global $conf; $search = '/(
).*({if isset\(\$metadata\)})/is'; $repla='
{strip} {foreach from=$add_info_photos item=addinfophotos} {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)}
{\'Author\'|@translate}
{$INFO_AUTHOR}
{else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)}
{\'Created on\'|@translate}
{$INFO_CREATION_DATE}
{else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)}
{\'Posted on\'|@translate}
{$INFO_POSTED_DATE}
{else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)}
{\'Dimensions\'|@translate}
{$INFO_DIMENSIONS}
{else if $addinfophotos.AIPID == 5}
{\'File\'|@translate}
{$INFO_FILE}
{else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)}
{\'Filesize\'|@translate}
{$INFO_FILESIZE}
{else if $addinfophotos.AIPID == 7 and isset($related_tags)}
{\'Tags\'|@translate}
{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}{$tag.name}{/foreach}
{else if $addinfophotos.AIPID == 8 and isset($related_categories)}
{\'Albums\'|@translate}
    {foreach from=$related_categories item=cat}
  • {$cat}
  • {/foreach}
{else if $addinfophotos.AIPID == 9}
{\'Visits\'|@translate}
{$INFO_VISITS}
{else if $addinfophotos.AIPID == 10 and isset($rate_summary)}
{\'Rating score\'|@translate}
{if $rate_summary.count} {$rate_summary.score} ({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'}) {else} {\'no rate\'|@translate} {/if}
{if isset($rating)}
{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}
{foreach from=$rating.marks item=mark name=rate_loop} {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} {else} {/if} {/foreach} {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} {footer_script} var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, onSuccess : function(rating) {ldelim} var e = document.getElementById("updateRate"); if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; e = document.getElementById("ratingScore"); if (e) e.innerHTML = rating.score; e = document.getElementById("ratingCount"); if (e) {ldelim} if (rating.count == 1) {ldelim} e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); } else {ldelim} e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); } {rdelim} {rdelim}{rdelim} ); {/footer_script} {/strip}
{/if} {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)}
{\'Who can see this photo?\'|@translate}
{$available_permission_levels[$current.level]}
{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} {footer_script require=\'jquery\'}{strip} function setPrivacyLevel(id, level){ (new PwgWS(\'{$ROOT_URL}\')).callService( "pwg.images.setPrivacyLevel", { image_id:id, level:level}, { method: "POST", onFailure: function(num, text) { alert(num + " " + text); }, onSuccess: function(result) { jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); } } ); } (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); {/strip}{/footer_script}
{else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)}
{\'Description\'|@translate}
{$COMMENT_IMG}
{footer_script} jQuery(document).ready(function(){ jQuery(".imageComment").hide(); }); {/footer_script} {else if $addinfophotos.AIPDATA}
{$addinfophotos.AIPWORDING}
{$addinfophotos.AIPDATA}
{/if} {/foreach} {/strip}
{if isset($metadata)} '; return preg_replace($search, $repla , $content); } add_event_handler('loc_begin_picture', 'add_InfoT'); function add_InfoT() { global $conf, $page, $template; if (!empty($page['image_id'])) { $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); if ($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc'); $tab_add_info_one_photo = tab_add_info_by_photo_show(); if (pwg_db_num_rows($tab_add_info_one_photo)) { while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); $row = pwg_db_fetch_assoc($d); $items = array( 'AIPID' => $info_photos['id_prop_pho'], 'AIPORDER' => $info_photos['orderprop'], 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), 'AIPDATA' => trigger_change('AP_render_content', $row['data']), ); $template->append('add_info_photos', $items); } } $template->assign( array( 'A' => 'a' )); } } ?>