set_prefilter('header', 'titleb'); } function titleb($content, &$smarty) { $search = '#.*?#'; $replacement = '{$PERSO_TITLE}'; return preg_replace($search, $replacement, $content); } function Title() { global $template, $page, $conf; $titleindex = & $conf['titlesimple']; if (!empty($titleindex)) { $template->assign('PERSO_TITLE', $titleindex); } else { $titleindex = & $conf['gallery_title']; $template->assign('PERSO_TITLE', $titleindex); } } function Titleacc() { global $template, $page, $conf; if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id'])) { $titleindex = & $conf['titlesimple_accueil']; if (!empty($titleindex)) { $template->assign('PERSO_TITLE', $titleindex); } } } function Titlecat() { global $template, $page; if (!empty($page['category']['id']) ) { $query = ' select id,comment FROM ' . CATEGORIES_TABLE . ' WHERE id = \''.$page['category']['id'].'\' ;'; $result = pwg_query($query); $row = mysql_fetch_array($result); if (!empty($row['comment'])) { $template->assign('PERSO_TITLE', $row['comment']); } } } function Titleimg() { global $template, $page; if ( !empty($page['image_id']) ) { $query = ' select id,comment FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\' ;'; $result = pwg_query($query); $row = mysql_fetch_array($result); if (!empty($row['comment'])) { $template->assign('PERSO_TITLE', $row['comment']); } } } ?>