本文整理汇总了PHP中CSocNetLogTools::FindLogEventByCommentID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLogTools::FindLogEventByCommentID方法的具体用法?PHP CSocNetLogTools::FindLogEventByCommentID怎么用?PHP CSocNetLogTools::FindLogEventByCommentID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetLogTools
的用法示例。
在下文中一共展示了CSocNetLogTools::FindLogEventByCommentID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arSubscribe["COMMON_EVENT"][$strTmp] = $value_default;
$arSubscribe["COMMON_EVENT"][$strTmp . "_INHERITED"] = true;
}
}
if (!array_key_exists("COMMON_ALL", $arSubscribe) || !array_key_exists($strTmp, $arSubscribe["COMMON_ALL"]) || $arSubscribe["COMMON_ALL"][$strTmp] == "I") {
$arSubscribe["COMMON_ALL"][$strTmp] = $value_default;
$arSubscribe["COMMON_ALL"][$strTmp . "_INHERITED"] = true;
}
$fullset_event_id = CSocNetLogTools::FindFullSetEventIDByEventID($event_id);
if ($fullset_event_id) {
$arEvent = CSocNetLogTools::FindLogEventByID($fullset_event_id, $entity_type);
} else {
$arEvent = CSocNetLogTools::FindLogEventByID($event_id, $entity_type);
}
if (!$arEvent) {
$arEvent = CSocNetLogTools::FindLogEventByCommentID($event_id);
if ($arEvent) {
$fullset_event_id = CSocNetLogTools::FindFullSetEventIDByEventID($arEvent["EVENT_ID"]);
if ($fullset_event_id) {
$arEvent = CSocNetLogTools::FindLogEventByID($fullset_event_id, $entity_type);
}
}
}
if ($arEvent) {
$arSubscribe["EVENT"]["TITLE"] = $arEvent["ENTITIES"][$entity_type]["TITLE_SETTINGS"];
if (array_key_exists("NAME_FORMATTED", $arEntityTmp) && strlen($arEntityTmp["NAME_FORMATTED"]) > 0) {
$arSubscribe["EVENT"]["TITLE_1"] = str_replace(array("#TITLE#"), array(array_key_exists("~NAME_FORMATTED", $arEntityTmp) ? $arEntityTmp["~NAME_FORMATTED"] : $arEntityTmp["NAME_FORMATTED"]), $arEvent["ENTITIES"][$entity_type]["TITLE_SETTINGS_1"]);
$arSubscribe["EVENT"]["TITLE_2"] = str_replace(array("#TITLE#"), array(array_key_exists("~NAME_FORMATTED", $arEntityTmp) ? $arEntityTmp["~NAME_FORMATTED"] : $arEntityTmp["NAME_FORMATTED"]), $arEvent["ENTITIES"][$entity_type]["TITLE_SETTINGS_2"]);
}
}
if (array_key_exists($entity_type, $GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"]) && array_key_exists("TITLE_SETTINGS_ALL", $GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"][$entity_type]) && strlen($GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"][$entity_type]["TITLE_SETTINGS_ALL"]) > 0) {
示例2: 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;
}