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


PHP CSocNetLogTools::GetForumCommentMetaData方法代码示例

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


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

示例1: DeleteComment_Forum

 function DeleteComment_Forum($arFields)
 {
     $arRes = array();
     if (CModule::IncludeModule("forum") && isset($arFields["SOURCE_ID"]) && intval($arFields["SOURCE_ID"]) > 0 && isset($arFields["EVENT_ID"]) && strlen($arFields["EVENT_ID"]) > 0 && isset($arFields["LOG_SOURCE_ID"]) && intval($arFields["LOG_SOURCE_ID"]) > 0) {
         $logEventMeta = CSocNetLogTools::FindLogEventByCommentID($arFields["EVENT_ID"]);
         if (true || $logEventMeta["EVENT_ID"] == "forum") {
             if (CModule::IncludeModule("forum")) {
                 ForumActions("DEL", array("MID" => intval($arFields["SOURCE_ID"]), "PERMISSION" => "Y"), $strErrorMessage, $strOKMessage);
                 $arRes["ERROR"] = $strErrorMessage;
                 $arRes["NOTES"] = $strOKMessage;
             }
         } else {
             if ($logEventMeta) {
                 $arForumMetaData = CSocNetLogTools::GetForumCommentMetaData($logEventMeta["EVENT_ID"]);
             }
             if ($arForumMetaData) {
                 $messageId = intval($arFields["SOURCE_ID"]);
                 $rsMessage = CForumMessage::GetList(array(), array("ID" => $messageId), false, 0, array("SELECT" => array("FORUM_ID")));
                 if ($arMessage = $rsMessage->Fetch()) {
                     $forumId = intval($arMessage["FORUM_ID"]);
                 }
                 if ($forumId && intval($forumId) > 0) {
                     if (($arForumMetaData[0] == 'WF' || $arForumMetaData[0] == 'FORUM') && isset($arFields["LOG_ID"]) && intval($arFields["LOG_ID"]) > 0) {
                         $rsLog = CSocNetLog::GetList(array(), array("ID" => intval($arFields["LOG_ID"])), false, false, array("MESSAGE", "RATING_ENTITY_ID"));
                         if ($arLog = $rsLog->Fetch()) {
                             if ($arForumMetaData[0] == 'WF') {
                                 $entityId = $arLog["MESSAGE"];
                             } elseif ($arForumMetaData[0] == 'FORUM') {
                                 $entityId = $arLog["RATING_ENTITY_ID"];
                             }
                         }
                     } elseif ($arForumMetaData[0] == 'FORUM' && isset($arFields["LOG_ID"]) && intval($arFields["LOG_ID"]) > 0) {
                         $rsLog = CSocNetLog::GetList(array(), array("ID" => intval($arFields["LOG_ID"])), false, false, array("MESSAGE"));
                         if ($arLog = $rsLog->Fetch()) {
                             $entityId = $arLog["MESSAGE"];
                         }
                     } else {
                         $entityId = $arFields["LOG_SOURCE_ID"];
                     }
                     $feed = new \Bitrix\Forum\Comments\Feed(intval($forumId), array("type" => $arForumMetaData[1], "id" => intval($arFields["LOG_SOURCE_ID"]), "xml_id" => $arForumMetaData[0] . "_" . $entityId));
                     if (!$feed->delete($messageId)) {
                         $arRes["ERROR"] = "";
                         foreach ($feed->getErrors() as $error) {
                             $arRes["ERROR"] .= $error->getMessage();
                         }
                     } else {
                         $arRes["NOTES"] = GetMessage("SONET_DELETE_COMMENT_SOURCE_SUCCESS");
                     }
                 }
             }
         }
     }
     if (!isset($arRes["NOTES"])) {
         $arRes["ERROR"] = GetMessage("SONET_DELETE_COMMENT_SOURCE_ERROR");
     }
     return $arRes;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:57,代码来源:log_tools.php

示例2: __SLEGetLogRecord


//.........这里部分代码省略.........
                     }
                     $arEvent["MESSAGE_FORMAT"] = call_user_func($arEvent["CALLBACK_FUNC"], $arEvent);
                 }
                 $arEvent["FIELDS_FORMATTED"]["LOG_TIME_FORMAT"] = $timeFormated;
                 $arEvent["FIELDS_FORMATTED"]["LOG_UPDATE_TS"] = MakeTimeStamp($arEvent["LOG_UPDATE"]);
                 $arEvent["FIELDS_FORMATTED"]["LOG_DATE_TS"] = MakeTimeStamp($arEvent["LOG_DATE"]);
                 $arEvent["FIELDS_FORMATTED"]["LOG_DATE_DAY"] = ConvertTimeStamp(MakeTimeStamp($arEvent["LOG_DATE"]), "SHORT");
                 $arEvent["FIELDS_FORMATTED"]["LOG_UPDATE_DAY"] = ConvertTimeStamp(MakeTimeStamp($arEvent["LOG_UPDATE"]), "SHORT");
                 $arEvent["FIELDS_FORMATTED"]["COMMENTS_COUNT"] = $arEvent["COMMENTS_COUNT"];
                 $arEvent["FIELDS_FORMATTED"]["TMP_ID"] = $arEvent["TMP_ID"];
                 $arEvent["FIELDS_FORMATTED"]["DATETIME_FORMATTED"] = $dateTimeFormated;
                 $arCommentEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arEvent["EVENT_ID"]);
                 if (!array_key_exists("HAS_COMMENTS", $arEvent["FIELDS_FORMATTED"]) || $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] != "N") {
                     $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] = $arCommentEvent && (!array_key_exists("ENABLE_COMMENTS", $arEvent) || $arEvent["ENABLE_COMMENTS"] != "N") ? "Y" : "N";
                 }
             }
         }
         if (is_object($cache)) {
             $arCacheData = array("FIELDS_FORMATTED" => $arEvent["FIELDS_FORMATTED"]);
             $cache->EndDataCache($arCacheData);
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $GLOBALS["CACHE_MANAGER"]->EndTagCache();
             }
         }
     }
     if ($bEmpty) {
         return false;
     }
     $feature = CSocNetLogTools::FindFeatureByEventID($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
     if ($feature && (!array_key_exists($feature, $arSocNetFeaturesSettings) || array_key_exists("allowed", $arSocNetFeaturesSettings[$feature]) && is_array($arSocNetFeaturesSettings[$feature]["allowed"]) && !in_array($arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"], $arSocNetFeaturesSettings[$feature]["allowed"]))) {
         return false;
     }
     if (!array_key_exists("COMMENTS_PARAMS", $arEvent["FIELDS_FORMATTED"])) {
         $arForumMetaData = CSocNetLogTools::GetForumCommentMetaData($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
         if ($arForumMetaData && $arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"] > 0) {
             $arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => $arForumMetaData[1], "ENTITY_XML_ID" => $arForumMetaData[0] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["SOURCE_ID"], "NOTIFY_TAGS" => $arForumMetaData[2]);
         } else {
             $arEvent["FIELDS_FORMATTED"]["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => substr(strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], 0, 2), "ENTITY_XML_ID" => strtoupper($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]) . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], "NOTIFY_TAGS" => "");
         }
     }
     foreach (GetModuleEvents("socialnetwork", "OnSonetLogEntryMenuCreate", true) as $arModuleEvent) {
         if (!array_key_exists("FIELDS_FORMATTED", $arEvent)) {
             $arEvent["FIELDS_FORMATTED"] = array();
         }
         if (!array_key_exists("MENU", $arEvent["FIELDS_FORMATTED"])) {
             $arEvent["FIELDS_FORMATTED"]["MENU"] = array();
         }
         $arMenuItems = ExecuteModuleEventEx($arModuleEvent, array($arEvent));
         if (!empty($arMenuItems)) {
             $arEvent["FIELDS_FORMATTED"]["MENU"] = array_merge($arEvent["FIELDS_FORMATTED"]["MENU"], $arMenuItems);
         }
     }
     if (is_array($arCurrentUserSubscribe)) {
         $arEvent["FIELDS_FORMATTED"]["TRANSPORT"] = __SLEGetTransport($arEvent, $arCurrentUserSubscribe);
     }
     $arCommentEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"]);
     if (!$GLOBALS["USER"]->IsAuthorized()) {
         $arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = "N";
     } elseif ($arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && $arCommentEvent["OPERATION_ADD"] == "log_rights") {
         $arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = CSocNetLogRights::CheckForUser($arEvent["FIELDS_FORMATTED"]["EVENT"]["ID"], $GLOBALS["USER"]->GetID()) ? "Y" : "N";
     } else {
         $array_key = $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_TYPE"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["ENTITY_ID"] . "_" . $arEvent["FIELDS_FORMATTED"]["EVENT"]["EVENT_ID"];
         if (array_key_exists($array_key, $GLOBALS["CurUserCanAddComments"])) {
             $arEvent["FIELDS_FORMATTED"]["CAN_ADD_COMMENTS"] = $GLOBALS["CurUserCanAddComments"][$array_key] == "Y" && $arEvent["FIELDS_FORMATTED"]["HAS_COMMENTS"] == "Y" ? "Y" : "N";
         } else {
             if ($feature && $arCommentEvent && array_key_exists("OPERATION_ADD", $arCommentEvent) && strlen($arCommentEvent["OPERATION_ADD"]) > 0) {
开发者ID:webgksupport,项目名称:alpina,代码行数:67,代码来源:include.php

示例3: call_user_func

 $arEventTmp = CSocNetLogTools::FindLogCommentEventByID($arComment["EVENT_ID"]);
 if ($arEventTmp && array_key_exists("CLASS_FORMAT", $arEventTmp) && array_key_exists("METHOD_FORMAT", $arEventTmp)) {
     $arFIELDS_FORMATTED = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arComment, $arParams);
     $arTmpCommentEvent["MESSAGE_FORMAT"] = htmlspecialcharsback($arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"]);
 } else {
     $arTmpCommentEvent["MESSAGE_FORMAT"] = $arComment["MESSAGE"];
 }
 if ($arEventTmp && array_key_exists("CLASS_FORMAT", $arEventTmp) && array_key_exists("METHOD_FORMAT", $arEventTmp)) {
     $arFIELDS_FORMATTED = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arComment, array_merge($arParams, array("MOBILE" => "Y")));
     $strMessageMobile = htmlspecialcharsback($arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"]);
 } else {
     $strMessageMobile = $arComment["MESSAGE"];
 }
 $arResult["arCommentFormatted"] = $arTmpCommentEvent;
 if ($_REQUEST["pull"] == "Y" && CModule::IncludeModule("pull") && CPullOptions::GetNginxStatus()) {
     $arForumMetaData = CSocNetLogTools::GetForumCommentMetaData($arLog["EVENT_ID"]);
     if ($arLog["ENTITY_TYPE"] == "CRMACTIVITY" && CModule::IncludeModule('crm') && ($arActivity = CCrmActivity::GetByID($arLog["ENTITY_ID"], false)) && $arActivity["TYPE_ID"] == CCrmActivityType::Task) {
         $entity_xml_id = "TASK_" . $arActivity["ASSOCIATED_ENTITY_ID"];
     } elseif ($arLog["ENTITY_TYPE"] == "WF" && $arLog["SOURCE_ID"] > 0 && CModule::IncludeModule('bizproc') && ($workflowId = \CBPStateService::getWorkflowByIntegerId($arLog["SOURCE_ID"]))) {
         $entity_xml_id = "WF_" . $workflowId;
     } elseif ($arForumMetaData && $arLog["SOURCE_ID"] > 0) {
         $entity_xml_id = $arForumMetaData[0] . "_" . $arLog["SOURCE_ID"];
     } else {
         $entity_xml_id = strtoupper($arLog["EVENT_ID"]) . "_" . $arLog["ID"];
     }
     $commentId = !!$arComment["SOURCE_ID"] ? $arComment["SOURCE_ID"] : $arComment["ID"];
     $eventHandlerID = AddEventHandler("main", "system.field.view.file", array("CSocNetLogTools", "logUFfileShow"));
     $rights = CSocNetLogComponent::getCommentRights(array("EVENT_ID" => $arLog["EVENT_ID"], "SOURCE_ID" => $arLog["SOURCE_ID"]));
     $res = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("TEMPLATE_ID" => '', "RATING_TYPE_ID" => $arComment["RATING_TYPE_ID"], "ENTITY_XML_ID" => $entity_xml_id, "RECORDS" => array($commentId => array("ID" => $commentId, "NEW" => "Y", "APPROVED" => "Y", "POST_TIMESTAMP" => $arResult["timestamp"], "AUTHOR" => array("ID" => $arUser["ID"], "NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"], "AVATAR" => $arTmpCommentEvent["AVATAR_SRC"]), "FILES" => false, "UF" => $arComment["UF"], "~POST_MESSAGE_TEXT" => $arComment["~MESSAGE"], "WEB" => array("CLASSNAME" => "", "POST_MESSAGE_TEXT" => $arTmpCommentEvent["MESSAGE_FORMAT"], "AFTER" => $arTmpCommentEvent["UF"]), "MOBILE" => array("CLASSNAME" => "", "POST_MESSAGE_TEXT" => $strMessageMobile))), "NAV_STRING" => "", "NAV_RESULT" => "", "PREORDER" => "N", "RIGHTS" => array("MODERATE" => "N", "EDIT" => $rights["COMMENT_RIGHTS_EDIT"], "DELETE" => $rights["COMMENT_RIGHTS_DELETE"]), "VISIBLE_RECORDS_COUNT" => 1, "ERROR_MESSAGE" => "", "OK_MESSAGE" => "", "RESULT" => $commentId, "PUSH&PULL" => array("ACTION" => "REPLY", "ID" => $commentId), "MODE" => "PULL_MESSAGE", "VIEW_URL" => isset($arComment["EVENT"]["URL"]) && strlen($arComment["EVENT"]["URL"]) > 0 ? $arComment["EVENT"]["URL"] : (isset($arParams["PATH_TO_LOG_ENTRY"]) && strlen($arParams["PATH_TO_LOG_ENTRY"]) > 0 ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG_ENTRY"], array("log_id" => $arLog["ID"])) . "?commentId=#ID#" : ""), "EDIT_URL" => "__logEditComment('" . $entity_xml_id . "', '#ID#', '" . $arLog["ID"] . "');", "MODERATE_URL" => "", "DELETE_URL" => '/bitrix/components/bitrix/socialnetwork.log.entry/ajax.php?lang=' . LANGUAGE_ID . '&action=delete_comment&delete_comment_id=#ID#&post_id=' . $arLog["ID"] . '&site=' . SITE_ID, "AUTHOR_URL" => "", "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "LAZYLOAD" => "Y", "NOTIFY_TAG" => "", "NOTIFY_TEXT" => "", "SHOW_MINIMIZED" => "Y", "SHOW_POST_FORM" => "Y", "IMAGE_SIZE" => "", "mfi" => ""), array(), null);
     if ($eventHandlerID > 0) {
         RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:ajax.php


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