當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gpOutput::EndPhrase方法代碼示例

本文整理匯總了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\" />";
     }
 }
開發者ID:Bomberus,項目名稱:gpEasy-CMS,代碼行數:65,代碼來源:gpOutput.php


注:本文中的gpOutput::EndPhrase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。