Your IP : 3.131.36.133


Current Path : /home/bitrix/ext_www/home-comfort.in.ua/local/components/webprofy/social.share/
Upload File :
Current File : /home/bitrix/ext_www/home-comfort.in.ua/local/components/webprofy/social.share/component.php

<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
	die();
}
$arResult = array();

if($this->InitComponentTemplate()) {
	$template = &$this->GetTemplate();
} else {
	return;
}

$arResult["SHOW_COUNTER"] = $arParams["SHOW_COUNTER"];

foreach($arParams["SERVICES"] as $key => $value) {
	$arResult["SERVICES"][$value] = array('CODE' => $value);
}

if(defined('SITE_SERVER_NAME') && strlen(SITE_SERVER_NAME) > 0) {
	$SiteServerName = SITE_SERVER_NAME;
} else {
	$SiteServerName = COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
}

if(strlen($SiteServerName) > 0) {
	$protocol = (CMain::IsHTTPS() ? "https" : "http");
	if($arParams["PAGE_URL"] != ''){
		if(mb_strpos($arParams["PAGE_URL"], 'http') !== 0) {
			$arResult["PAGE_URL"] = $protocol."://".$SiteServerName.$arParams["PAGE_URL"];
		} else {
			$arResult["PAGE_URL"] = $arParams["PAGE_URL"];
		}
	} else {
		$arResult["PAGE_URL"] = $protocol."://".$SiteServerName.wp_get_script_url();
	}
} else {
	$arResult["PAGE_URL"] = "";
}

if($arParams["PAGE_IMG"] != '') {
	$arResult["PAGE_IMG"] = $arParams["PAGE_IMG"];
	if(mb_strpos($arResult["PAGE_IMG"], 'http') !== 0){
		$arResult["PAGE_IMG"] = $protocol."://".$SiteServerName.$arResult["PAGE_IMG"];
	}
}

if($arParams["PAGE_TITLE"] != '') {
	$arResult["PAGE_TITLE"] = $arParams["PAGE_TITLE"];
}

if($arParams["PAGE_DESC"] != '') {
	$arResult["PAGE_DESC"] = $arParams["PAGE_DESC"];
}

//smart_share($arResult["PAGE_IMG"], $arResult["PAGE_TITLE"], $arResult["PAGE_DESC"], $arResult["PAGE_URL"]);

$this->IncludeComponentTemplate();