本文整理汇总了PHP中SJB_System::setPageHead方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_System::setPageHead方法的具体用法?PHP SJB_System::setPageHead怎么用?PHP SJB_System::setPageHead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_System
的用法示例。
在下文中一共展示了SJB_System::setPageHead方法的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);
}
}
示例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);
}
}
示例3: _tpl_head
function _tpl_head($params, $content)
{
if (empty($content)) {
return false;
}
$head = SJB_System::getPageHead();
SJB_System::setPageHead($head . ' ' . $content);
}