当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetLogTools::FormatEvent_GetEntity方法代码示例

本文整理汇总了PHP中CSocNetLogTools::FormatEvent_GetEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::FormatEvent_GetEntity方法的具体用法?PHP CSocNetLogTools::FormatEvent_GetEntity怎么用?PHP CSocNetLogTools::FormatEvent_GetEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetLogTools的用法示例。


在下文中一共展示了CSocNetLogTools::FormatEvent_GetEntity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FormatComment_Data

 function FormatComment_Data($arFields, $arParams, $bMail = false, $arLog = array())
 {
     $arResult = array("EVENT_FORMATTED" => array());
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
     }
     if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
         $arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
         $arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
     }
     if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
         $news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
     } else {
         $news_tmp = $arLog["TITLE"];
     }
     $title_tmp = $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_" . $arLog["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_TITLE");
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? "<a href=\"asdfasdf\">" . $title . "</a>" : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
     if ($bMail) {
         $url = CSocNetLogTools::FormatEvent_GetURL($arLog, true);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     } else {
         $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" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "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($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;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:38,代码来源:include.php

示例2: FormatComment_Wiki

 static function FormatComment_Wiki($arFields, $arParams, $bMail = false, $arLog = array())
 {
     $arResult = array("EVENT_FORMATTED" => array());
     if ($bMail) {
         $arResult['CREATED_BY'] = CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail);
         $arResult['ENTITY'] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
     }
     if (!$bMail && array_key_exists('URL', $arLog) && strlen($arLog['URL']) > 0) {
         $wiki_tmp = '<a href="' . $arLog['URL'] . '">' . $arLog['TITLE'] . '</a>';
     } else {
         $wiki_tmp = $arLog['TITLE'];
     }
     $title = str_replace(array('#TITLE#', '#ENTITY#', '#CREATED_BY#'), array($wiki_tmp, $arResult['ENTITY']['FORMATTED'], $bMail ? $arResult['CREATED_BY']['FORMATTED'] : ''), $bMail ? GetMessage('WIKI_SOCNET_LOG_COMMENT_TITLE_MAIL') : GetMessage('WIKI_SOCNET_LOG_COMMENT_TITLE'));
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => $bMail ? CSocNetTextParser::killAllTags($arFields['MESSAGE']) : $arFields['MESSAGE']);
     if ($bMail) {
         $url = CSocNetLogTools::FormatEvent_GetURL($arLog);
         if (strlen($url) > 0) {
             $arResult['EVENT_FORMATTED']['URL'] = $url;
         }
     } else {
         static $parserLog = false;
         if (CModule::IncludeModule("forum")) {
             if (!$parserLog) {
                 $parserLog = new forumTextParser(LANGUAGE_ID);
             }
             $arAllow = array("HTML" => "N", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
             $parserLog->pathToUser = $arParams["PATH_TO_USER"];
             $parserLog->arUserfields = $arFields["UF"];
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
         } else {
             if (!$parserLog) {
                 $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" => "Y", "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") {
             if (CModule::IncludeModule("forum")) {
                 $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
             } else {
                 $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($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;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:47,代码来源:wiki_socnet.php

示例3: FormatTask4SocialNetwork

 public static function FormatTask4SocialNetwork($arFields, $arParams, $bMail = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     $task_datetime = null;
     if (!CModule::IncludeModule('socialnetwork')) {
         return false;
     }
     $APPLICATION->SetAdditionalCSS('/bitrix/js/tasks/css/tasks.css');
     if (isset($arFields['~PARAMS']) && $arFields['~PARAMS']) {
         $arFields['PARAMS'] = unserialize($arFields['~PARAMS']);
     } elseif (isset($arFields['PARAMS']) && $arFields['PARAMS']) {
         $arFields['PARAMS'] = unserialize($arFields['PARAMS']);
     } else {
         $arFields['PARAMS'] = array();
     }
     $arResult = array('EVENT' => $arFields, 'CREATED_BY' => CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail), 'ENTITY' => CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail), 'EVENT_FORMATTED' => array(), 'CACHED_CSS_PATH' => '/bitrix/js/tasks/css/tasks.css');
     if (!$bMail) {
         $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams);
     }
     if (!$bMail && $arParams["MOBILE"] != "Y" && array_key_exists("URL", $arFields) && strlen($arFields["URL"]) > 0) {
         $taskHtmlTitle = '<a href="' . $arFields["URL"] . '" onclick="if (taskIFramePopup.isLeftClick(event)) {taskIFramePopup.view(' . $arFields["SOURCE_ID"] . '); return false;}">' . $arFields["TITLE"] . '</a>';
     } else {
         $taskHtmlTitle = $arFields["TITLE"];
     }
     $actorUserId = null;
     $actorUserName = '';
     $actorMaleSuffix = '';
     $eventTitlePhraseSuffix = '_DEFAULT';
     if (isset($arParams['NAME_TEMPLATE'])) {
         $nameTemplate = $arParams['NAME_TEMPLATE'];
     } else {
         $nameTemplate = CSite::GetNameFormat();
     }
     if (isset($arFields["PARAMS"], $arFields['PARAMS']['TYPE'])) {
         if ($arFields["PARAMS"]["TYPE"] === "create") {
             $eventTitlePhraseSuffix = '_CREATE_24';
             if (isset($arFields["PARAMS"]["CREATED_BY"])) {
                 $actorUserId = $arFields["PARAMS"]["CREATED_BY"];
             }
         } elseif ($arFields["PARAMS"]["TYPE"] === 'modify') {
             $eventTitlePhraseSuffix = '_MODIFY_24';
             if (isset($arFields["PARAMS"]["CHANGED_BY"])) {
                 $actorUserId = $arFields["PARAMS"]["CHANGED_BY"];
             }
         } elseif ($arFields["PARAMS"]["TYPE"] === 'status') {
             $eventTitlePhraseSuffix = '_STATUS_24';
             if (isset($arFields["PARAMS"]["CHANGED_BY"])) {
                 $actorUserId = $arFields["PARAMS"]["CHANGED_BY"];
             }
         } elseif ($arFields["PARAMS"]["TYPE"] === 'comment') {
             $eventTitlePhraseSuffix = '';
         }
     }
     if ($actorUserId) {
         $rsUser = CUser::GetList($by = 'id', $order = 'asc', array('ID_EQUAL_EXACT' => (int) $actorUserId), array('FIELDS' => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'PERSONAL_GENDER')));
         if ($arUser = $rsUser->fetch()) {
             if (isset($arUser['PERSONAL_GENDER'])) {
                 switch ($arUser['PERSONAL_GENDER']) {
                     case "F":
                     case "M":
                         $actorMaleSuffix = '_' . $arUser['PERSONAL_GENDER'];
                         break;
                 }
             }
             $actorUserName = CUser::FormatName($nameTemplate, $arUser);
         }
     }
     $eventTitleTemplate = GetMessage('TASKS_SONET_GL_EVENT_TITLE_TASK' . $eventTitlePhraseSuffix . $actorMaleSuffix);
     $eventTitle = str_replace(array('#USER_NAME#', '#TITLE#'), array($actorUserName, $taskHtmlTitle), $eventTitleTemplate);
     $eventTitleWoTaskName = str_replace(array('#USER_NAME#', '#TITLE#'), array($actorUserName, ''), $eventTitleTemplate);
     $title_tmp = str_replace("#TITLE#", $taskHtmlTitle, GetMessage("TASKS_SONET_GL_EVENT_TITLE_TASK"));
     if ($arFields["PARAMS"] && $arFields["PARAMS"]["CREATED_BY"]) {
         $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arFields["PARAMS"]["CREATED_BY"], $GLOBALS["arExtranetUserID"]) ? GetMessage("TASKS_SONET_LOG_EXTRANET_SUFFIX") : "";
         $rsUser = CUser::GetList($by = 'id', $order = 'asc', array('ID_EQUAL_EXACT' => (int) $arFields['PARAMS']['CREATED_BY']), array('FIELDS' => array('PERSONAL_GENDER', 'ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN')));
         if ($arUser = $rsUser->Fetch()) {
             $title_tmp .= " (" . str_replace("#USER_NAME#", CUser::FormatName(CSite::GetNameFormat(false), $arUser) . $suffix, GetMessage("TASKS_SONET_GL_EVENT_TITLE_TASK_CREATED")) . ")";
         }
     }
     if ($bMail) {
         $title = str_replace(array("#TASK#", "#ENTITY#", "#CREATED_BY#"), array($title_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), GetMessage("SONET_GL_EVENT_TITLE_" . ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP ? "GROUP" : "USER") . "_TASK_MAIL"));
     } else {
         $title = $title_tmp;
         $title_24 = $eventTitle;
     }
     if (!$bMail && in_array($arFields["PARAMS"]["TYPE"], array("create", "status", 'modify', 'comment'), true)) {
         if (!(isset($arFields['PARAMS']['CHANGED_FIELDS']) && is_array($arFields['PARAMS']['CHANGED_FIELDS']))) {
             $arFields['PARAMS']['CHANGED_FIELDS'] = array();
         }
         $rsTask = CTasks::GetByID($arFields["SOURCE_ID"], false);
         if ($arTask = $rsTask->Fetch()) {
             $task_datetime = $arTask["CHANGED_DATE"];
             if ($arFields["PARAMS"]["TYPE"] == "create") {
                 if ($arParams["MOBILE"] == "Y") {
                     $title_24 = GetMessage("TASKS_SONET_GL_TASKS2_NEW_TASK_MESSAGE");
                     $message_24_1 = $taskHtmlTitle;
                 } else {
                     $message = $message_24_1 = $eventTitle;
                     $message_24_2 = $changes_24 = "";
                 }
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:tasknotifications.php

示例4: FormatEvent_System

 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) {
//.........这里部分代码省略.........
开发者ID:Satariall,项目名称:izurit,代码行数:101,代码来源:log_tools.php

示例5: FormatComment_Data

 function FormatComment_Data($arFields, $arParams, $bMail = false, $arLog = array())
 {
     $arResult = array("EVENT_FORMATTED" => array());
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_PROVIDER) {
         $arResult["ENTITY"] = CXDILFEventHandlers::GetEntity_Data($arLog, $bMail);
     } elseif (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
     }
     if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
         $arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
         $arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
     }
     if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
         $news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
     } else {
         $news_tmp = $arLog["TITLE"];
     }
     $title_tmp = $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_" . $arLog["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_TITLE");
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? $title : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
     if ($bMail) {
         $url = CSocNetLogTools::FormatEvent_GetURL($arLog, true);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     } else {
         static $parserLog = false;
         if (CModule::IncludeModule("forum")) {
             $arAllow = array("HTML" => "N", "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" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"], "USER" => $arParams["IM"] == "Y" ? "N" : "Y");
             if (!$parserLog) {
                 $parserLog = new forumTextParser(LANGUAGE_ID);
             }
             $parserLog->pathToUser = $arParams["PATH_TO_USER"];
             $parserLog->arUserfields = $arFields["UF"];
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow));
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = preg_replace("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/is" . BX_UTF_PCRE_MODIFIER, "\\2", $arResult["EVENT_FORMATTED"]["MESSAGE"]);
         } else {
             $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" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"], "USER" => "Y");
             if (!$parserLog) {
                 $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
             }
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
         }
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             if (CModule::IncludeModule("forum")) {
                 $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), $arAllow), 500);
             } else {
                 $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($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;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:57,代码来源:include.php


注:本文中的CSocNetLogTools::FormatEvent_GetEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。