当前位置: 首页>>代码示例>>PHP>>正文


PHP SJB_System::getPageHead方法代码示例

本文整理汇总了PHP中SJB_System::getPageHead方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_System::getPageHead方法的具体用法?PHP SJB_System::getPageHead怎么用?PHP SJB_System::getPageHead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SJB_System的用法示例。


在下文中一共展示了SJB_System::getPageHead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public static function init()
 {
     if (SJB_System::getSettingByName('google_TrackingID') != '') {
         $page_head = '<script type="text/javascript">' . 'var _gaq = _gaq || [];' . '_gaq.push(["_setAccount", "' . SJB_System::getSettingByName('google_TrackingID') . '"]);' . '_gaq.push(["_addOrganic", "images.yandex.ru", "text"]);' . '_gaq.push(["_addOrganic", "images.google.ru", "q"]);' . '_gaq.push(["_addOrganic", "go.mail.ru", "q"]);' . '_gaq.push(["_addOrganic", "gogo.ru", "q"]);' . '_gaq.push(["_addOrganic", "nova.rambler.ru", "query"]);' . '_gaq.push(["_addOrganic", "rambler.ru", "words"]);' . '_gaq.push(["_addOrganic", "google.com.ua", "q"]);' . '_gaq.push(["_addOrganic", "search.ua", "q"]);' . '_gaq.push(["_setDomainName", "none"]);' . '_gaq.push(["_setAllowLinker", true]);' . '_gaq.push(["_trackPageview"]);' . '(function() {' . 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;' . 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";' . 'var s  = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);' . '})();' . '</script>';
         $head = SJB_System::getPageHead();
         SJB_System::setPageHead($head . ' ' . $page_head);
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:8,代码来源:google_analytics_plugin.php

示例2: setMetaOpenGraph

 /**
  * @param $listingSID
  */
 public static function setMetaOpenGraph($listingSID)
 {
     if (!empty($listingSID)) {
         $listing = SJB_ListingManager::getObjectBySID($listingSID);
         $listingStructure = SJB_ListingManager::createTemplateStructureForListing($listing);
         $siteUrl = SJB_System::getSystemSettings("SITE_URL");
         $location = SJB_LocationManager::locationFormat(array("location" => $listingStructure['Location']));
         $locationFormatted = !empty($location) ? " (" . $location . ")" : '';
         $title = htmlspecialchars(strip_tags(trim($listingStructure['Title']))) . $locationFormatted;
         $logoImage = !empty($listingStructure['user']['Logo']['file_url']) ? $listingStructure['user']['Logo']['file_url'] : '';
         $description = self::getListingDescriptionPreparedForSharer($listingStructure);
         $listingUrl = SJB_ListingManager::getListingUrlBySID($listingSID);
         $openGraphMetaBlock = "<meta property=\"og:type\" content=\"website\" />\n\t" . "<meta property=\"og:url\" content=\"{$listingUrl}\" />\n\t" . "<meta property=\"og:title\" content=\"{$title}\" />\n\t" . "<meta property=\"og:description\" content=\"{$description}\" />\n\t" . "<meta property=\"og:site_name\" content=\"{$siteUrl}\" />\n\t" . "<meta property=\"og:image\" content=\"{$logoImage}\" />";
         $head = SJB_System::getPageHead();
         SJB_System::setPageHead($head . ' ' . $openGraphMetaBlock);
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:20,代码来源:ListingManager.php

示例3: _tpl_head

 function _tpl_head($params, $content)
 {
     if (empty($content)) {
         return false;
     }
     $head = SJB_System::getPageHead();
     SJB_System::setPageHead($head . ' ' . $content);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:8,代码来源:TemplateProcessor.php


注:本文中的SJB_System::getPageHead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。