function build_header($full) { include GSADMININCPATH . 'configuration.php'; $str = ''; // meta description $description = get_page_meta_desc(false); if (!empty($description)) { $str .= '<meta name="description" content="' . $description . '" />' . "\n"; } // meta robots $metarobots = get_page_meta_robots(false); if (!empty($metarobots)) { $str .= '<meta name="robots" content="' . $metarobots . '" />' . "\n"; } // meta keywords $keywords = get_page_meta_keywords(false); if (!empty($keywords)) { $str .= '<meta name="keywords" content="' . $keywords . '" />' . "\n"; } // canonical link if ($full) { $canonical = exec_filter('linkcanonical', get_page_url(true)); // @filter linkcanonical (str) rel canonical link if (!empty($canonical)) { $str .= '<link rel="canonical" href="' . $canonical . '" />' . "\n"; } } // script queue $str .= getScripts(GSFRONT); $str = exec_filter('theme-header', $str); return $str; }
/** * Get Page Header HTML * * This will return header html for a particular page. This will include the * meta desriptions & keywords, canonical and title tags * * @since 1.0 * @uses exec_action * @uses get_page_url * @uses strip_quotes * @uses get_page_meta_desc * @uses get_page_meta_keywords * @uses $metad * @uses $title * @uses $content * @uses $site_full_name from configuration.php * @uses GSADMININCPATH * * @return string HTML for template header */ function get_header($full = true) { global $metad; global $title; global $content; include GSADMININCPATH . 'configuration.php'; // meta description if ($metad != '') { $description = get_page_meta_desc(FALSE); } else { if (getDef('GSAUTOMETAD', true)) { // get meta from content excerpt if (function_exists('mb_substr')) { $description = trim(mb_substr(strip_tags(strip_decode($content)), 0, 160)); } else { $description = trim(substr(strip_tags(strip_decode($content)), 0, 160)); } $description = str_replace('"', '', $description); $description = str_replace("'", '', $description); $description = preg_replace('/\\n/', " ", $description); $description = preg_replace('/\\r/', " ", $description); $description = preg_replace('/\\t/', " ", $description); $description = preg_replace('/ +/', " ", $description); } } if (!empty($description)) { echo '<meta name="description" content="' . $description . '" />' . "\n"; } // meta keywords $keywords = get_page_meta_keywords(FALSE); if ($keywords != '') { echo '<meta name="keywords" content="' . $keywords . '" />' . "\n"; } if ($full) { echo '<link rel="canonical" href="' . get_page_url(true) . '" />' . "\n"; } // script queue get_scripts_frontend(); exec_action('theme-header'); }
/** * Get Page Header HTML * * This will return header html for a particular page. This will include the * meta desriptions & keywords, canonical and title tags * * @since 1.0 * @uses exec_action * @uses get_page_url * @uses strip_quotes * @uses get_page_meta_desc * @uses get_page_meta_keywords * @uses $metad * @uses $title * @uses $content * @uses $site_full_name from configuration.php * @uses GSADMININCPATH * * @return string HTML for template header */ function get_header($full = true) { global $metad; global $title; global $content; include GSADMININCPATH . 'configuration.php'; // meta description if ($metad != '') { $desc = get_page_meta_desc(FALSE); } else { if (getDef('GSAUTOMETAD', true)) { // use content excerpt, NOT filtered $desc = strip_decode($content); if (getDef('GSCONTENTSTRIP', true)) { $desc = strip_content($desc); } $desc = cleanHtml($desc, array('style', 'script')); // remove unwanted elements that strip_tags fails to remove $desc = getExcerpt($desc, 160); // grab 160 chars $desc = strip_whitespace($desc); // remove newlines, tab chars $desc = encode_quotes($desc); $desc = trim($desc); } } if (!empty($desc)) { echo '<meta name="description" content="' . $desc . '" />' . "\n"; } // meta keywords $keywords = get_page_meta_keywords(FALSE); if ($keywords != '') { echo '<meta name="keywords" content="' . $keywords . '" />' . "\n"; } if ($full) { echo '<link rel="canonical" href="' . get_page_url(true) . '" />' . "\n"; } // script queue get_scripts_frontend(); exec_action('theme-header'); }
/** * Get Page Header HTML * * This will return header html for a particular page. This will include the * meta desriptions & keywords, canonical and title tags * * @since 1.0 * @uses exec_action * @uses get_page_url * @uses strip_quotes * @uses get_page_meta_desc * @uses get_page_meta_keywords * @uses $metad * @uses $title * @uses $content * @uses $site_full_name from configuration.php * @uses GSADMININCPATH * * @return string HTML for template header */ function get_header($full = true) { include GSADMININCPATH . 'configuration.php'; // meta description $description = get_page_meta_desc(false); if (!empty($description)) { echo '<meta name="description" content="' . $description . '" />' . "\n"; } // meta robots $metarobots = get_page_meta_robots(false); if (!empty($metarobots)) { echo '<meta name="robots" content="' . $metarobots . '" />' . "\n"; } // meta keywords $keywords = get_page_meta_keywords(false); if (!empty($keywords)) { echo '<meta name="keywords" content="' . $keywords . '" />' . "\n"; } // canonical link $canonical = exec_filter('linkcanonical', get_page_url(true)); if ($full and !empty($canonical)) { echo '<link rel="canonical" href="' . $canonical . '" />' . "\n"; } // script queue get_scripts_frontend(); exec_action('theme-header'); }
/** * Get Page Header HTML * * This will return header html for a particular page. This will include the * meta desriptions & keywords, canonical and title tags * * @since 1.0 * @uses exec_action * @uses get_page_url * @uses strip_quotes * @uses get_page_meta_desc * @uses get_page_meta_keywords * @uses $metad * @uses $title * @uses $content * @uses $site_full_name from configuration.php * @uses GSADMININCPATH * * @return string HTML for template header */ function get_header($full = true) { global $metad; global $title; global $content; include GSADMININCPATH . 'configuration.php'; if (function_exists('mb_substr')) { $description = trim(mb_substr(strip_tags(strip_decode($content)), 0, 160)); } else { $description = trim(substr(strip_tags(strip_decode($content)), 0, 160)); } if ($metad != '') { $description = get_page_meta_desc(FALSE); } else { $description = str_replace('"', '', $description); $description = str_replace("'", '', $description); $description = preg_replace('/\\n/', " ", $description); $description = preg_replace('/\\r/', " ", $description); $description = preg_replace('/\\t/', " ", $description); $description = preg_replace('/ +/', " ", $description); } $keywords = get_page_meta_keywords(FALSE); echo '<meta name="description" content="' . encode_quotes($description) . '" />' . "\n"; echo '<meta name="keywords" content="' . encode_quotes($keywords) . '" />' . "\n"; if ($full) { echo '<meta name="generator" content="' . $site_full_name . '" />' . "\n"; echo '<link rel="canonical" href="' . get_page_url(true) . '" />' . "\n"; } exec_action('theme-header'); }
?> favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<?php get_site_url(); ?> favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php get_theme_url(); ?> /css/style.css" /> <link rel="stylesheet" type="text/css" media="print" href="<?php get_theme_url(); ?> /css/print.css" /> <meta name="keywords" content="<?php get_page_meta_keywords(); ?> " /> <meta name="description" content="<?php get_page_meta_desc(); ?> " /> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <?php get_header(); ?> <!-- Required for some plugins to work; triggers theme header hooks as of GS 3.0. --> </head>