本文整理汇总了PHP中gpOutput::EndPhrase方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::EndPhrase方法的具体用法?PHP gpOutput::EndPhrase怎么用?PHP gpOutput::EndPhrase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpOutput
的用法示例。
在下文中一共展示了gpOutput::EndPhrase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetHead_TKD
/**
* Output the title, keywords, description and other meta for the current html document
* @static
*/
static function GetHead_TKD()
{
global $config, $page, $gpLayouts;
//charset
if ($page->gpLayout && isset($gpLayouts[$page->gpLayout]) && isset($gpLayouts[$page->gpLayout]['doctype'])) {
echo $gpLayouts[$page->gpLayout]['doctype'];
}
//start keywords;
$keywords = array();
if (count($page->meta_keywords)) {
$keywords = $page->meta_keywords;
} elseif (!empty($page->TitleInfo['keywords'])) {
$keywords = explode(',', $page->TitleInfo['keywords']);
}
//title
echo "\n<title>";
$page_title = '';
if (!empty($page->TitleInfo['browser_title'])) {
$page_title = $page->TitleInfo['browser_title'];
$keywords[] = $page->TitleInfo['browser_title'];
} elseif (!empty($page->label)) {
$page_title = strip_tags($page->label);
} elseif (isset($page->title)) {
$page_title = common::GetBrowserTitle($page->title);
}
echo $page_title;
if (!empty($page_title) && !empty($config['title'])) {
echo ' - ';
}
echo $config['title'] . '</title>';
if (!empty($page->TitleInfo['rel'])) {
echo "\n" . '<meta name="robots" content="' . $page->TitleInfo['rel'] . '" />';
}
//keywords
$keywords[] = strip_tags($page->label);
$site_keywords = explode(',', $config['keywords']);
$keywords = array_merge($keywords, $site_keywords);
$keywords = array_unique($keywords);
$keywords = array_diff($keywords, array(''));
echo "\n<meta name=\"keywords\" content=\"" . implode(', ', $keywords) . "\" />";
//description
$description = '';
if (!empty($page->meta_description)) {
$description .= $page->meta_description;
} elseif (!empty($page->TitleInfo['description'])) {
$description .= $page->TitleInfo['description'];
} else {
$description .= $page_title;
}
$description = gpOutput::EndPhrase($description);
if (!empty($config['desc'])) {
$description .= htmlspecialchars($config['desc']);
}
$description = trim($description);
if (!empty($description)) {
echo "\n<meta name=\"description\" content=\"" . $description . "\" />";
}
if (!isset($config['showgplink']) || $config['showgplink']) {
echo "\n<meta name=\"generator\" content=\"gpEasy CMS\" />";
}
}