set_prefilter('picture', 'adddinfoIT');
}
function adddinfoIT($content, &$smarty)
{
$search = '#
#';
$replacement = '
{if $INFO1}
{\'addinfo_info1\'|@translate}
{$INFO1}
{/if}
{if $INFO2}
{\'addinfo_info2\'|@translate}
{$INFO2}
{/if}
{if $INFO3}
{\'addinfo_info3\'|@translate}
{$INFO3}
{/if}
';
return preg_replace($search, $replacement, $content);
}
add_event_handler('loc_begin_picture', 'addInfoT');
function addInfoT()
{
global $conf, $page, $template, $tab, $cit, $nbr ;
load_language('plugin.lang', ADDINFO_PATH);
load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) );
// Affichage du bloc uniquement sur les page des photos
if ( !empty($page['image_id']) )
{
$query = '
select id,info1,info2,info3
FROM ' . ADDINFO_TABLE . '
WHERE id = \''.$page['image_id'].'\'
;';
$result = pwg_query($query);
$row = mysql_fetch_array($result);
$idaddinfo=$row['id'];
$info1=$row['info1'];
$info2=$row['info2'];
$info3=$row['info3'];
// Envoi des données au template
$template->assign (
array (
'INFO1' => $info1,
'INFO2' => $info2,
'INFO3' => $info3
) );
}
}
?>