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


PHP CSocNetLogTools::AddComment_Review_UpdateElement_Forum方法代码示例

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


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

示例1: AddComment_Photo_Forum

 public static function AddComment_Photo_Forum($arFields, $FORUM_ID, $arLog)
 {
     if (!CModule::IncludeModule("forum")) {
         return false;
     }
     if (!CModule::IncludeModule("iblock")) {
         return false;
     }
     $ufFileID = array();
     $ufDocID = array();
     $arElement = false;
     $arFilteredText = array();
     $arFilter = array("ID" => $arLog["SOURCE_ID"]);
     $arSelectedFields = array("IBLOCK_ID", "ID", "NAME", "TAGS", "CODE", "IBLOCK_SECTION_ID", "DETAIL_PAGE_URL", "CREATED_BY", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PROPERTY_FORUM_TOPIC_ID", "PROPERTY_FORUM_MESSAGE_CNT");
     $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
     if ($db_res && ($res = $db_res->GetNext())) {
         $arElement = $res;
     }
     if ($arElement) {
         // check iblock properties
         CSocNetLogTools::AddComment_Review_CheckIBlock_Forum($arElement);
         $dbMessage = CForumMessage::GetList(array(), array("PARAM2" => $arElement["ID"]));
         if (!($arMessage = $dbMessage->Fetch())) {
             // Add Topic
             $TOPIC_ID = CSocNetLogTools::AddComment_Review_CreateRoot_Forum($arElement, $FORUM_ID);
             $bNewTopic = true;
         } else {
             $TOPIC_ID = $arMessage["TOPIC_ID"];
         }
         if (intval($TOPIC_ID) > 0) {
             if (COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
                 $arFields["TEXT_MESSAGE"] = $arFilteredText["TEXT_MESSAGE"] = CFilterUnquotableWords::Filter($arFields["TEXT_MESSAGE"]);
                 $arFilteredText["MESSAGE"] = CFilterUnquotableWords::Filter($arFields["MESSAGE"]);
             }
             // Add comment
             $messageID = false;
             $arFieldsMessage = array("POST_MESSAGE" => $arFields["TEXT_MESSAGE"], "USE_SMILES" => "Y", "PARAM2" => $arElement["ID"], "APPROVED" => "Y");
             $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arTmp);
             if (is_array($arTmp)) {
                 if (array_key_exists("UF_SONET_COM_DOC", $arTmp)) {
                     $GLOBALS["UF_FORUM_MESSAGE_DOC"] = $arTmp["UF_SONET_COM_DOC"];
                 } elseif (array_key_exists("UF_SONET_COM_FILE", $arTmp)) {
                     $arFieldsMessage["FILES"] = array();
                     foreach ($arTmp["UF_SONET_COM_FILE"] as $file_id) {
                         $arFieldsMessage["FILES"][] = array("FILE_ID" => $file_id);
                     }
                 }
             }
             $messageID = ForumAddMessage("REPLY", $FORUM_ID, $TOPIC_ID, 0, $arFieldsMessage, $sError, $sNote);
             if (!$messageID) {
                 $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
             } else {
                 // get UF DOC value and FILE_ID there
                 $dbAddedMessageFiles = CForumFiles::GetList(array("ID" => "ASC"), array("MESSAGE_ID" => $messageID));
                 while ($arAddedMessageFiles = $dbAddedMessageFiles->Fetch()) {
                     $ufFileID[] = $arAddedMessageFiles["FILE_ID"];
                 }
                 $ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("FORUM_MESSAGE", "UF_FORUM_MESSAGE_DOC", $messageID, LANGUAGE_ID);
                 CSocNetLogTools::AddComment_Review_UpdateElement_Forum($arElement, $TOPIC_ID, $bNewTopic);
             }
         } else {
             $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
         }
     } else {
         $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
     }
     return array_merge($arFilteredText, array("SOURCE_ID" => $messageID, "RATING_TYPE_ID" => "FORUM_POST", "RATING_ENTITY_ID" => $messageID, "ERROR" => $strError, "NOTES" => "", "UF" => array("FILE" => $ufFileID, "DOC" => $ufDocID), "IM_MESSAGE" => $messageID ? $arFields["TEXT_MESSAGE"] : false));
 }
开发者ID:rasuldev,项目名称:torino,代码行数:68,代码来源:log_tools_photo.php

示例2: AddComment_Review_UpdateElement

 function AddComment_Review_UpdateElement($arElement, $topicID, $bNewTopic)
 {
     CSocNetLogTools::AddComment_Review_UpdateElement_Forum($arElement, $topicID, $bNewTopic);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:4,代码来源:log_tools.php


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