當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSocNetLogTools::AddComment_Review_CreateRoot_Blog方法代碼示例

本文整理匯總了PHP中CSocNetLogTools::AddComment_Review_CreateRoot_Blog方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSocNetLogTools::AddComment_Review_CreateRoot_Blog方法的具體用法?PHP CSocNetLogTools::AddComment_Review_CreateRoot_Blog怎麽用?PHP CSocNetLogTools::AddComment_Review_CreateRoot_Blog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSocNetLogTools的用法示例。


在下文中一共展示了CSocNetLogTools::AddComment_Review_CreateRoot_Blog方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: AddComment_Photo_Blog

 public static function AddComment_Photo_Blog($arFields, $BLOG_ID, $arLog)
 {
     if (!CModule::IncludeModule("blog")) {
         return false;
     }
     if (!CModule::IncludeModule("iblock")) {
         return false;
     }
     $arElement = false;
     $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_BLOG_POST_ID", "PROPERTY_BLOG_COMMENT_CNT", "PROPERTY_REAL_PICTURE");
     $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
     if ($db_res && ($res = $db_res->GetNext())) {
         $arElement = $res;
     }
     if ($arElement) {
         // check iblock properties
         $ELEMENT_BLOG_POST_ID = CSocNetLogTools::AddComment_Review_CheckIBlock_Blog($arElement);
         if ($ELEMENT_BLOG_POST_ID <= 0) {
             // Add Post
             $POST_ID = CSocNetLogTools::AddComment_Review_CreateRoot_Blog($arElement, $BLOG_ID);
             $bNewPost = true;
         } else {
             $POST_ID = $ELEMENT_BLOG_POST_ID;
         }
         if (intval($POST_ID) > 0) {
             // Add comment
             $commentID = false;
             $UserIP = CBlogUser::GetUserIP();
             $arFieldsComment = array("POST_ID" => $POST_ID, "BLOG_ID" => $BLOG_ID, "POST_TEXT" => trim($arFields["TEXT_MESSAGE"]), "DATE_CREATE" => ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"), "AUTHOR_IP" => $UserIP[0], "AUTHOR_IP1" => $UserIP[1], "PARENT_ID" => false);
             if ($GLOBALS["USER"]->IsAuthorized()) {
                 $arFieldsComment["AUTHOR_ID"] = $GLOBALS["USER"]->GetID();
             }
             $commentID = CBlogComment::Add($arFieldsComment);
             if (!$commentID) {
                 $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
             } else {
                 CSocNetLogTools::AddComment_Review_UpdateElement_Blog($arElement, $POST_ID, $BLOG_ID, $bNewPost);
             }
         } else {
             $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
         }
     } else {
         $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
     }
     return array("SOURCE_ID" => $commentID, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => $commentID, "ERROR" => $strError, "NOTES" => "", "IM_MESSAGE" => $arFieldsComment ? $arFieldsComment["POST_TEXT"] : false);
 }
開發者ID:rasuldev,項目名稱:torino,代碼行數:47,代碼來源:log_tools_photo.php


注:本文中的CSocNetLogTools::AddComment_Review_CreateRoot_Blog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。