• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/log_tools_photo.php
  • Класс: CSocNetPhotoCommentEvent
  • Вызов: CSocNetPhotoCommentEvent::SetVars
function SetVars($arParams, $arResult)
{
	if (
		!array_key_exists("IS_SOCNET", $arParams)
		|| $arParams["IS_SOCNET"] != "Y"
	)
		return;
	else
		$this->IsSocnet = true;

	$this->arPath["PATH_TO_SMILE"] = $arParams["PATH_TO_SMILE"];
	$this->arPath["DETAIL_URL"] = $arParams["~DETAIL_URL"];
	$this->arPath["SECTION_URL"] = $arParams["~SECTION_URL"];

	if (mb_strtolower($arParams["COMMENTS_TYPE"]) == "forum")
		$this->ForumID = $arParams["FORUM_ID"];
	elseif (mb_strtolower($arParams["COMMENTS_TYPE"]) == "blog")
	{
		$this->PhotoElementID = $arParams["ELEMENT_ID"];
		$this->PostID = $arResult["COMMENT_ID"];

		if (CModule::IncludeModule("blog"))
			if ($arBlog = CBlog::GetByUrl($arParams["BLOG_URL"]))
				$this->BlogID = $arBlog["ID"];
	}

	$this->bIsGroup = false;
	$this->entity_type = false;
	$this->entity_id = false;
	if (
		array_key_exists("USER_ALIAS", $arParams)
		&& $arParams["USER_ALIAS"] <> ''
	)
	{
		$arTmp = explode("_", $arParams["USER_ALIAS"]);
		if (
			is_array($arTmp)
			&& count($arTmp) == 2
		)
		{
			$entity_type = $arTmp[0];
			$this->entity_id = $arTmp[1];

			if ($entity_type == "group")
				$this->entity_type = SONET_ENTITY_GROUP;
			else
				$this->entity_type = SONET_ENTITY_USER;
		}
	}
}