Example #1
0
 function FormatEvent_System($arFields, $arParams, $bMail = false)
 {
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
     }
     $arResult = array("EVENT" => $arFields, "CREATED_BY" => array(), "ENTITY" => array(), "EVENT_FORMATTED" => array());
     if (intval($arFields["ENTITY_ID"]) > 0) {
         $suffix = is_array($GLOBALS["arExtranetGroupID"]) && in_array($arFields["ENTITY_ID"], $GLOBALS["arExtranetGroupID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
         if ($bMail) {
             $arResult["ENTITY"]["FORMATTED"] = $arFields["GROUP_NAME"] . $suffix;
             $arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("SONET_GL_EVENT_ENTITY_G");
         } elseif (strpos($arFields["MESSAGE"], ",") > 0) {
             $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, false);
         }
     }
     if (in_array($arFields["TITLE"], array("moderate", "unmoderate", "join", "unjoin"))) {
         if (strpos($arFields["MESSAGE"], ",") !== false) {
             $arResult["CREATED_BY"] = false;
             $arGroup = array("IMAGE_ID" => $arFields["GROUP_IMAGE_ID"]);
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatarGroup($arGroup, $arParams);
             // group avatar
         } else {
             $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["MESSAGE"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
             $dbUser = CUser::GetByID($arFields["MESSAGE"]);
             if ($arUser = $dbUser->Fetch()) {
                 $arFieldsTooltip = array("ID" => $arUser["ID"], "NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"], "LOGIN" => $arUser["LOGIN"]);
                 $oldNameTemplate = $arParams["NAME_TEMPLATE"];
                 $arParams["NAME_TEMPLATE"] .= $suffix;
                 $arResult["CREATED_BY"]["TOOLTIP_FIELDS"] = CSocNetLogTools::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
                 $arParams["NAME_TEMPLATE"] = $oldNameTemplate;
                 if (!$bMail) {
                     $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arUser, $arParams, "");
                 }
             }
         }
     } else {
         $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
         $arFieldsTooltip = array("ID" => $arFields["USER_ID"], "NAME" => $arFields["~CREATED_BY_NAME"], "LAST_NAME" => $arFields["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arFields["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arFields["~CREATED_BY_LOGIN"]);
         $oldNameTemplate = $arParams["NAME_TEMPLATE"];
         $arParams["NAME_TEMPLATE"] .= $suffix;
         $arResult["CREATED_BY"]["TOOLTIP_FIELDS"] = CSocNetLogTools::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
         $arParams["NAME_TEMPLATE"] = $oldNameTemplate;
         if (!$bMail) {
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams, "CREATED_BY_");
         }
     }
     if (strlen($arFields["MESSAGE"]) > 0) {
         $arUsersID = explode(",", $arFields["MESSAGE"]);
         $bFirst = true;
         $count = 0;
         $user_tmp = "";
         if ($bMail) {
             $dbUser = CUser::GetList($by = "last_name", $order = "asc", array("ID" => implode(" | ", $arUsersID)));
             while ($arUser = $dbUser->Fetch()) {
                 $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
                 $count++;
                 if (!$bFirst) {
                     $user_tmp .= ", ";
                 }
                 if (strlen($arUser["NAME"]) > 0 || strlen($arUser["LAST_NAME"]) > 0) {
                     $user_tmp .= $arUser["NAME"] . " " . $arUser["LAST_NAME"] . $suffix;
                 } else {
                     $user_tmp .= $arUser["LOGIN"] . $suffix;
                 }
                 $bFirst = false;
             }
         } else {
             $ajax_page = $GLOBALS["APPLICATION"]->GetCurPageParam("", array("bxajaxid", "logout"));
             $dbUser = CUser::GetList($by = "last_name", $order = "asc", array("ID" => implode(" | ", $arUsersID)), array("FIELDS" => array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "PERSONAL_GENDER")));
             while ($arUser = $dbUser->Fetch()) {
                 if (defined("BX_COMP_MANAGED_CACHE")) {
                     $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
                 }
                 $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
                 $count++;
                 if (!$bFirst) {
                     $user_tmp .= ", ";
                 }
                 $oldNameTemplate = $arParams["NAME_TEMPLATE"];
                 $arParams["NAME_TEMPLATE"] .= $suffix;
                 $anchor_id = RandString(8);
                 if ($arParams["MOBILE"] == "Y") {
                     $user_tmp .= '<a href="' . str_replace(array("#user_id#", "#USER_ID#", "#id#", "#ID#"), $arUser["ID"], $arParams["~PATH_TO_USER"]) . '">' . CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $arParams["SHOW_LOGIN"] != "N" ? true : false) . '</a>';
                 } else {
                     $user_tmp .= '<a class="" id="anchor_' . $anchor_id . '" href="' . str_replace(array("#user_id#", "#USER_ID#", "#id#", "#ID#"), $arUser["ID"], $arParams["~PATH_TO_USER"]) . '">' . CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $arParams["SHOW_LOGIN"] != "N" ? true : false) . '</a>';
                     $user_tmp .= '<script type="text/javascript">';
                     $user_tmp .= 'BX.tooltip(' . $arUser["ID"] . ', "anchor_' . $anchor_id . '", "' . CUtil::JSEscape($ajax_page) . '");';
                     $user_tmp .= '</script>';
                 }
                 $arParams["NAME_TEMPLATE"] = $oldNameTemplate;
                 $bFirst = false;
                 $arLastUser = $arUser;
             }
         }
     }
     if ($bMail) {
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_" . strtoupper($arFields["TITLE"]) . "_" . ($count > 1 ? "2" : "1") . "_MAIL");
     } else {
         if (in_array($arFields["TITLE"], array("moderate", "unmoderate", "join", "unjoin"))) {
             if ($count == 1 && $arLastUser) {
                 $suffix = $arLastUser["PERSONAL_GENDER"];
             } else {
                 $suffix = "";
             }
         } else {
             $suffix = $arFields["CREATED_BY_PERSONAL_GENDER"];
         }
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_" . strtoupper($arFields["TITLE"]) . "_" . ($count > 1 ? "2" : "1" . (strlen(trim($suffix)) > 0 ? "_" . $suffix : "")));
         $title_tmp_24 = GetMessage("SONET_GL_EVENT_TITLE_SYSTEM_" . strtoupper($arFields["TITLE"]) . "_" . ($count > 1 ? "2_24" : "1_24" . (strlen(trim($suffix)) > 0 ? "_" . $suffix : "")));
     }
     $url = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arFields["ENTITY_ID"]));
     $suffix = is_array($GLOBALS["arExtranetGroupID"]) && in_array($arFields["ENTITY_ID"], $GLOBALS["arExtranetGroupID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
     if (strlen($url) > 0) {
         $group_tmp = '<a href="' . $url . '">' . $arFields["GROUP_NAME"] . '</a>' . $suffix;
     } else {
         $group_tmp = $arFields["GROUP_NAME"] . $suffix;
     }
     $title = str_replace(array("#USER_NAME#", "#ENTITY#", "#GROUP_NAME#"), array($user_tmp, $arResult["ENTITY"]["FORMATTED"], $group_tmp), $title_tmp);
     $title_tmp_24 = str_replace(array("#USER_NAME#"), array($user_tmp), $title_tmp_24);
     if ($bMail) {
         $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => false);
     } else {
         switch ($arFields["TITLE"]) {
             case "join":
             case "moderate":
             case "owner":
                 $classname = "join-group";
                 break;
             case "unjoin":
             case "exclude_group":
             case "unmoderate":
                 $classname = "leave-group";
                 break;
             default:
                 $classname = "";
         }
         if ($arParams["MOBILE"] == "Y") {
             $arResult["EVENT_FORMATTED"] = array("TITLE_24" => $title_tmp_24, "DESTINATION" => array(array("STYLE" => "", "TITLE" => $arFields["GROUP_NAME"] . $suffix, "URL" => $url)), "STYLE" => $classname);
         } else {
             $arResult["EVENT_FORMATTED"] = array("TITLE" => false, "MESSAGE" => $title, "IS_MESSAGE_SHORT" => true, "TITLE_24" => $title_tmp_24, "DESTINATION" => array(array("STYLE" => "sonetgroups", "TITLE" => $arFields["GROUP_NAME"] . $suffix, "URL" => $url)), "STYLE" => $classname);
         }
     }
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
     }
     return $arResult;
 }
Example #2
0
 function FormatEvent_Data($arFields, $arParams, $bMail = false)
 {
     $arResult = array("EVENT" => $arFields, "URL" => "");
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail);
         $rsRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         $arRights = array();
         while ($arRight = $rsRight->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         $arDestination = CSocNetLogTools::FormatDestinationFromRights($arRights, $arParams, $iMoreCount);
     }
     $title = "";
     $arEventParams = unserialize(strlen($arFields["~PARAMS"]) > 0 ? $arFields["~PARAMS"] : $arFields["PARAMS"]);
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER)) && is_array($arEventParams) && count($arEventParams) > 0 && array_key_exists("ENTITY_NAME", $arEventParams) && strlen($arEventParams["ENTITY_NAME"]) > 0) {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arEventParams["ENTITY_NAME"] . '</a>';
         } else {
             $title_tmp = $arEventParams["ENTITY_NAME"];
         }
     } else {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arFields["TITLE"] . '</a>';
         } else {
             $title_tmp = $arFields["TITLE"];
         }
     }
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($title_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_" . $arFields["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_TITLE"));
     $url = false;
     if (strlen($arFields["URL"]) > 0) {
         $url = $arFields["URL"];
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         if (!$bMail) {
             $message = $arFields["MESSAGE"];
         } else {
             $message = $arFields["TITLE"] . "#BR##BR#" . $arFields["MESSAGE"];
         }
     } else {
         $message = $arFields["MESSAGE"];
     }
     $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
     $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
     $twitInfo = unserialize($arFields['~PARAMS']);
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $arFields["TITLE"], "TITLE_24" => "", "MESSAGE" => "<a  target=\"_blank\" style=\"text-decoration: none; color: #5C6470; font-weight: bold; font-size: 12px\" href=\"https://twitter.com/" . $twitInfo['SCREEN_NAME'] . "/status/" . $twitInfo['TWIT_ID'] . "\">" . $arFields["TITLE"] . "</a><p>" . ($bMail ? CSocNetTextParser::killAllTags($message) : $message), "IS_IMPORTANT" => false, "STYLE" => "", "DESTINATION" => $arDestination);
     if (intval($iMoreCount) > 0) {
         $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iMoreCount;
     }
     if (is_array($arEventParams) && array_key_exists("SOURCE_TIMESTAMP", $arEventParams)) {
         $arResult["EVENT_FORMATTED"]["LOG_DATE_FORMAT"] = ConvertTimeStamp($arEventParams["SOURCE_TIMESTAMP"], "FULL");
     }
     if (strlen($url) > 0) {
         $arResult["EVENT_FORMATTED"]["URL"] = $url;
     }
     if (!$bMail) {
         if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
             $arGroup = array("IMAGE_ID" => $arFields["GROUP_IMAGE_ID"]);
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatarGroup($arGroup, $arParams);
         } elseif ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER) {
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams, "USER_");
         } elseif ($arFields["ENTITY_TYPE"] == "N") {
             $arResult["EVENT_FORMATTED"]["AVATAR_STYLE"] = "avatar-info";
         }
         $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback(str_replace("#CUT#", "", $arResult["EVENT_FORMATTED"]["MESSAGE"])), array(), $arAllow), 500);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
         }
     }
     return $arResult;
 }
Example #3
0
 function FormatEvent_Data($arFields, $arParams, $bMail = false)
 {
     $arResult = array("EVENT" => $arFields, "URL" => "");
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER) {
         $arResult["ENTITY"] = CXDILFEventHandlers::GetEntity_Data($arFields, $bMail);
         $rsRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         $arRights = array();
         while ($arRight = $rsRight->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         $arDestination = CSocNetLogTools::FormatDestinationFromRights($arRights, $arParams, $iMoreCount);
     } elseif (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail);
         if ($entity_type == SONET_SUBSCRIBE_ENTITY_GROUP) {
             $arDestination = array(array("STYLE" => "sonetgroups", "TITLE" => $arResult["ENTITY"]["FORMATTED"]["NAME"], "URL" => $arResult["ENTITY"]["FORMATTED"]["URL"], "IS_EXTRANET" => is_array($GLOBALS["arExtranetGroupID"]) && in_array($arFields["ENTITY_ID"], $GLOBALS["arExtranetGroupID"])));
         } else {
         }
     }
     $title = "";
     $arEventParams = unserialize(strlen($arFields["~PARAMS"]) > 0 ? $arFields["~PARAMS"] : $arFields["PARAMS"]);
     if (is_array($arEventParams) && array_key_exists("SCHEME_ID", $arEventParams)) {
         $rs = CXDILFScheme::GetByID($arEventParams["SCHEME_ID"]);
         if ($arScheme = $rs->Fetch()) {
             $arParams["IS_HTML"] = $arScheme["IS_HTML"];
         }
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER)) && is_array($arEventParams) && count($arEventParams) > 0 && array_key_exists("ENTITY_NAME", $arEventParams) && strlen($arEventParams["ENTITY_NAME"]) > 0) {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arEventParams["ENTITY_NAME"] . '</a>';
         } else {
             $title_tmp = $arEventParams["ENTITY_NAME"];
         }
     } else {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arFields["TITLE"] . '</a>';
         } else {
             $title_tmp = $arFields["TITLE"];
         }
     }
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($title_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_" . $arFields["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_TITLE"));
     $url = false;
     if (strlen($arFields["URL"]) > 0) {
         $url = $arFields["URL"];
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         if (!$bMail) {
             $message = "<b><a href='" . $arFields["URL"] . "'>" . $arFields["TITLE"] . "</a></b><br />" . $arFields["MESSAGE"];
         } else {
             $message = $arFields["TITLE"] . "#BR##BR#" . $arFields["MESSAGE"];
         }
     } else {
         $message = $arFields["MESSAGE"];
     }
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "TITLE_24" => $arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER ? $arParams["MOBILE"] == "Y" ? GetMessage("LFP_SOCNET_LOG_DATA_TITLE_24") : GetMessage("LFP_SOCNET_LOG_DATA_TITLE_IMPORTANT_24") : GetMessage("LFP_SOCNET_LOG_DATA_TITLE_24"), "MESSAGE" => $bMail ? CSocNetTextParser::killAllTags($message) : $message, "IS_IMPORTANT" => $arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER ? true : false, "STYLE" => $arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER ? "imp-post feed-external-massage" : "", "DESTINATION" => $arDestination);
     if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER) {
         $arResult["EVENT_FORMATTED"]["TITLE_24_2"] = $arFields["TITLE"];
     }
     if (intval($iMoreCount) > 0) {
         $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iMoreCount;
     }
     if (is_array($arEventParams) && array_key_exists("SOURCE_TIMESTAMP", $arEventParams)) {
         $arResult["EVENT_FORMATTED"]["LOG_DATE_FORMAT"] = ConvertTimeStamp($arEventParams["SOURCE_TIMESTAMP"], "FULL");
     }
     if (strlen($url) > 0) {
         $arResult["EVENT_FORMATTED"]["URL"] = $url;
     }
     if (!$bMail) {
         if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER) {
             $arResult["EVENT_FORMATTED"]["AVATAR_STYLE"] = "avatar-rss";
         } elseif ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
             $arGroup = array("IMAGE_ID" => $arFields["GROUP_IMAGE_ID"]);
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatarGroup($arGroup, $arParams);
         } elseif ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER) {
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams, "USER_");
         } elseif ($arFields["ENTITY_TYPE"] == "N") {
             $arResult["EVENT_FORMATTED"]["AVATAR_STYLE"] = "avatar-info";
         }
         $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "LOG_NL2BR" => $arParams["IS_HTML"] == "Y" ? "N" : "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback(str_replace("#CUT#", "", $arResult["EVENT_FORMATTED"]["MESSAGE"])), array(), $arAllow), 500);
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
         }
     }
     return $arResult;
 }