set_prefilter('header', 'upmatasimple');
}
function upmatasimple ($content, &$smarty)
{
$search = '##';
$replacement = '';
return preg_replace($search, $replacement, $content);
}
function add_metasimple()
//meta homepage
{
global $template, $page, $meta_infosdesc, $conf;
$meta_infosdesc = array();
$meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
$meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
$meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
$meta_infosdesc['title'] = $template->get_template_vars('PAGE_TITLE');
if (!empty($meta_infosdesc['title']) and !empty($meta_infosdesc['info']))
{
$template->assign('PLUG_META', $meta_infosdesc['title']. ' - ' .$meta_infosdesc['info']);
}
elseif (!empty($meta_infosdesc['title']))
{
$template->assign('PLUG_META', $meta_infosdesc['title']);
}
}
function add_metadescacc()
//meta homepage
{
global $template, $page, $meta_infosdesc, $conf;
if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id']))
{
$descindex = & $conf['metasimple'];
if (!empty($descindex))
{
$template->assign('PLUG_META', $descindex);
}
else
{
$template->assign('PLUG_META', $meta_infosdesc['title']);
}
}
}
function add_metadesccat()
//meta albums
{
global $template, $page, $meta_infosdesc;
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('PLUG_META', $row['comment']);
}
}
}
function add_metadescimg()
//meta photos
{
global $template, $page, $meta_infosdesc;
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('PLUG_META', $row['comment']);
}
}
}
function set_metadesc_back()
{
global $template, $meta_infosdesc;
$template->assign
(array
(
'INFO_FILE' => $meta_infosdesc['info'],
'COMMENT_IMG' => $meta_infosdesc['comment']
)
);
}
?>