本文整理汇总了PHP中CSocNetLogTools::GetDataFromRatingEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::GetDataFromRatingEntity方法的具体用法?PHP CSocNetLogTools::GetDataFromRatingEntity怎么用?PHP CSocNetLogTools::GetDataFromRatingEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::GetDataFromRatingEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnAddRatingVote
public static function OnAddRatingVote($rating_vote_id, $arRatingFields)
{
if (CModule::IncludeModule("socialnetwork") && CModule::IncludeModule("im")) {
$arData = CSocNetLogTools::GetDataFromRatingEntity($arRatingFields["ENTITY_TYPE_ID"], $arRatingFields["ENTITY_ID"], false);
if (is_array($arData) && isset($arData["LOG_ID"]) && intval($arData["LOG_ID"]) > 0) {
if ($arRatingFields["ENTITY_TYPE_ID"] != "LOG_COMMENT" && ($arLog = CSocNetLog::GetByID($arData["LOG_ID"])) && intval($arLog['USER_ID']) != intval($arRatingFields['USER_ID']) && isset($arLog["ENTITY_TYPE"]) && in_array($arLog["ENTITY_TYPE"], CCrmLiveFeedEntity::GetAll())) {
$title = self::GetNotifyEntryTitle($arLog, "LIKE");
if (strlen($title) > 0) {
if (!isset($arRatingFields["PATH_TO_LOG_ENTRY"]) || strlen($arRatingFields["PATH_TO_LOG_ENTRY"]) <= 0) {
$arRatingFields["PATH_TO_LOG_ENTRY"] = '/crm/stream/?log_id=#log_id#';
}
$url = str_replace(array("#log_id#"), array($arLog["ID"]), $arRatingFields["PATH_TO_LOG_ENTRY"]);
$serverName = (CMain::IsHTTPS() ? "https" : "http") . "://" . (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name", ""));
$arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "TO_USER_ID" => intval($arLog['USER_ID']), "FROM_USER_ID" => intval($arRatingFields['USER_ID']), "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "main", "NOTIFY_EVENT" => "rating_vote", "NOTIFY_TAG" => "RATING|" . ($arRatingFields['VALUE'] >= 0 ? "" : "DL|") . $arRatingFields['ENTITY_TYPE_ID'] . "|" . $arRatingFields['ENTITY_ID'], "NOTIFY_MESSAGE" => GetMessage("CRM_LF_LIKE_IM_NOTIFY", array("#title#" => "<a href=\"" . $url . "\" class=\"bx-notifier-item-action\">" . htmlspecialcharsbx($title) . "</a>")), "NOTIFY_MESSAGE_OUT" => GetMessage("CRM_LF_LIKE_IM_NOTIFY", array("#title#" => htmlspecialcharsbx($title))) . " (" . $serverName . $url . ")");
CIMNotify::Add($arMessageFields);
}
}
}
}
}
示例2: isset
$arParams["COMMENTS_IN_EVENT"] = isset($arParams["COMMENTS_IN_EVENT"]) && intval($arParams["COMMENTS_IN_EVENT"]) > 0 ? $arParams["COMMENTS_IN_EVENT"] : "3";
$arParams["DESTINATION_LIMIT"] = isset($arParams["DESTINATION_LIMIT"]) ? intval($arParams["DESTINATION_LIMIT"]) : 100;
$arParams["DESTINATION_LIMIT_SHOW"] = isset($arParams["DESTINATION_LIMIT_SHOW"]) ? intval($arParams["DESTINATION_LIMIT_SHOW"]) : 3;
if (CModule::IncludeModule("mobileapp")) {
$min_dimension = min(array(intval(CMobile::getInstance()->getDevicewidth()), intval(CMobile::getInstance()->getDeviceheight())));
if ($min_dimension < 650) {
$min_dimension = 650;
} elseif ($min_dimension < 1300) {
$min_dimension = 1300;
} else {
$min_dimension = 2050;
}
$arParams["IMAGE_MAX_WIDTH"] = intval(($min_dimension - 100) / 2);
}
if ($_REQUEST["ACTION"] == "CONVERT" && $arParams["LOG_ID"] <= 0) {
$arConvertRes = CSocNetLogTools::GetDataFromRatingEntity($_REQUEST["ENTITY_TYPE_ID"], $_REQUEST["ENTITY_ID"]);
if (is_array($arConvertRes) && $arConvertRes["LOG_ID"] > 0) {
$arParams["LOG_ID"] = $arConvertRes["LOG_ID"];
}
}
$arParams["SET_LOG_CACHE"] = isset($arParams["SET_LOG_CACHE"]) && $arParams["LOG_ID"] <= 0 && !$arResult["AJAX_CALL"] ? $arParams["SET_LOG_CACHE"] : "N";
$arParams["SET_LOG_COUNTER"] = $arParams["SET_LOG_CACHE"] == "Y" && (!$arResult["AJAX_CALL"] && \Bitrix\Main\Page\Frame::isAjaxRequest() || $arResult["RELOAD"]) ? "Y" : "N";
$arParams["SET_LOG_PAGE_CACHE"] = $arParams["LOG_ID"] <= 0 ? "Y" : "N";
$arParams["PAGE_SIZE"] = intval($arParams["PAGE_SIZE"]) > 0 ? $arParams["PAGE_SIZE"] : 7;
if (array_key_exists("pplogid", $_REQUEST)) {
$arPrevPageLogID = explode("|", trim($_REQUEST["pplogid"]));
if (is_array($arPrevPageLogID)) {
foreach ($arPrevPageLogID as $key => $val) {
preg_match('/^(\\d+)$/', $val, $matches);
if (count($matches) <= 0) {
unset($arPrevPageLogID[$key]);