// like get_header, but tags beginning with _ are ignored and the language is appended to the canonical URL
public static function outputHeader($full=true) {
global $metad, $metak, $title, $content, $url, $parent, $language;
include(GSADMININCPATH.'configuration.php');
if ($metad != '') {
$description = stripslashes(htmlspecialchars_decode($metad, ENT_QUOTES));
} else {
if (function_exists('mb_substr')) {
$description = trim(mb_substr(html_entity_decode(strip_tags(stripslashes(htmlspecialchars_decode($content, ENT_QUOTES))),ENT_QUOTES, 'UTF-8'), 0, 160));
} else {
$description = trim(substr(html_entity_decode(strip_tags(stripslashes(htmlspecialchars_decode($content, ENT_QUOTES))),ENT_QUOTES, 'UTF-8'), 0, 160));
}
$description = preg_replace('/\(%.*?%\)/', " ", $description);
$description = preg_replace('/\{%.*?%\}/', " ", $description);
$description = preg_replace('/\n/', " ", $description);
$description = preg_replace('/\r/', " ", $description);
$description = preg_replace('/\t/', " ", $description);
$description = preg_replace('/ +/', " ", $description);
}
$keywords = array();
$tags = preg_split("/\s*,\s*/", stripslashes(htmlspecialchars_decode($metak, ENT_QUOTES)));
if (count($tags) > 0) foreach ($tags as $tag) if (substr(trim($tag),0,1) != '_') $keywords[] = trim($tag);
echo '<meta name="description" content="'.htmlspecialchars(trim($description)).'" />'."\n";
echo '<meta name="keywords" content="'.htmlspecialchars(implode(', ',$keywords)).'" />'."\n";
if ($full) {
echo '<meta name="generator" content="'.$site_full_name.'" />'."\n";
echo '<link rel="canonical" href="'.find_i18n_url($url,$parent,$language).'" />'."\n";
}
get_scripts_frontend();
exec_action('theme-header');
}