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


PHP CBlogComment::Update方法代码示例

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


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

示例1: rewritePreviousHistoryComment

 protected static function rewritePreviousHistoryComment(array $file)
 {
     if (!CModule::IncludeModule('blog')) {
         return;
     }
     $dbComments = CBlogComment::GetList(array('ID' => 'DESC'), array('POST_ID' => static::getPostIdForComment(), 'UF_BLOG_COMMENT_FH' => static::getStringForLike($file[0])), false, false, array('ID', 'POST_ID', 'BLOG_ID', 'UF_BLOG_COMMENT_FH'));
     if ($dbComments && ($lastComment = $dbComments->Fetch())) {
         $entityType = static::getEntityType($file[0]['ib_code']);
         $documentId = static::getEntityIdDocumentData($entityType, array('ELEMENT_ID' => $file[0]['id']));
         $filter = array("DOCUMENT_ID" => $documentId);
         $historyDoc = static::getIdHistoryDocument($filter);
         if (!empty($historyDoc['ID'])) {
             $newFileData = static::getDataFromValue($lastComment['UF_BLOG_COMMENT_FH']);
             $newFileData[0]['v'] = $historyDoc['ID'];
             CBlogComment::Update($lastComment['ID'], array('UF_BLOG_COMMENT_FH' => static::genData($newFileData[0], $newFileData[1]), 'HAS_PROPS' => 'Y'));
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:usertypewebdavelementhistory.php

示例2: CallBack_UpdateComment

 public static function CallBack_UpdateComment($arFields)
 {
     if (!CModule::IncludeModule('blog')) {
         return false;
     }
     if (!isset($arFields["SOURCE_ID"]) || intval($arFields["SOURCE_ID"]) <= 0) {
         return false;
     }
     $messageId = intval($arFields["SOURCE_ID"]);
     $ufFileID = array();
     $ufDocID = array();
     if ($arBlogComment = CBlogComment::GetByID($messageId)) {
         $arBlogCommentFields = array("POST_TEXT" => $arFields["TEXT_MESSAGE"]);
         $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arTmp);
         if (is_array($arTmp)) {
             if (array_key_exists("UF_SONET_COM_DOC", $arTmp)) {
                 $arBlogCommentFields["UF_BLOG_COMMENT_FILE"] = $arTmp["UF_SONET_COM_DOC"];
             }
         }
         if ($messageId = CBlogComment::Update($messageId, $arBlogCommentFields)) {
             $ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("BLOG_COMMENT", "UF_BLOG_COMMENT_FILE", $messageId, LANGUAGE_ID);
             $sNote = GetMessage("IDEA_SONET_UPDATE_COMMENT_SOURCE_SUCCESS");
             $cache = new CPHPCache();
             $cache->CleanDir(SITE_ID . "/idea/" . $arBlogComment["BLOG_ID"] . "/comment/" . $arBlogComment["POST_ID"] . "/");
             BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlogComment["BLOG_ID"] . "/first_page/");
             BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlogComment["BLOG_ID"] . "/pages/");
             BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlogComment["BLOG_ID"] . "/comment/" . $arBlogComment["POST_ID"] . "/");
             BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlogComment["BLOG_ID"] . "/post/" . $arBlogComment["POST_ID"] . "/");
         } else {
             if ($ex = $GLOBALS["APPLICATION"]->GetException()) {
                 $sError = $ex->GetString();
             } else {
                 $sError = GetMessage("IDEA_SONET_UPDATE_COMMENT_SOURCE_ERROR");
             }
         }
     } else {
         $sError = GetMessage("IDEA_SONET_UPDATE_COMMENT_SOURCE_ERROR");
     }
     return array("ERROR" => $sError, "NOTES" => $sNote, "UF" => array("FILE" => $ufFileID, "DOC" => $ufDocID));
 }
开发者ID:rasuldev,项目名称:torino,代码行数:40,代码来源:idea_sonet_notify.php

示例3: array

 if ($arResult["Perm"] == BLOG_PERMS_PREMODERATE) {
     $arFields["PUBLISH_STATUS"] = BLOG_PUBLISH_STATUS_READY;
 }
 $commentUrl = CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"]));
 $arFields["PATH"] = $commentUrl;
 if (strpos($arFields["PATH"], "?") !== false) {
     $arFields["PATH"] .= "&";
 } else {
     $arFields["PATH"] .= "?";
 }
 $arFields["PATH"] .= $arParams["COMMENT_ID_VAR"] . "=" . $commentID . "#" . $commentID;
 $dbComment = CBlogComment::GetList(array(), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "PARENT_ID" => $commentID));
 if ($arComment = $dbComment->Fetch() && $blogModulePermissions < "W") {
     $arResult["COMMENT_ERROR"] = "<b>" . GetMessage("B_B_PC_COM_ERROR_EDIT") . "</b><br />" . GetMessage("B_B_PC_EDIT_ALREADY_COMMENTED");
 } else {
     if ($commentID = CBlogComment::Update($commentID, $arFields)) {
         //Notifications
         $Notify = CIdeaManagment::getInstance()->Notification(array_merge($arFields, array("TYPE" => 'IDEA_COMMENT', "ACTION" => 'UPDATE', "AUTHOR_ID" => $user_id, "ID" => $commentID, "POST_ID" => $arPost["ID"])));
         //Socialnetwork notification
         $Notify->getSonetNotify()->Send();
         //Email notification
         //$Notify->getEmailNotify()->Send();
         //END -> Notifications
         //start custom, use UF binding ::@Idea
         if ($arResult["IDEA_MODERATOR"] && $_REQUEST["BIND_OFFICIAL_ANSWER"] == "Y") {
             // Bind offical answer
             CIdeaManagment::getInstance()->IdeaComment($commentID)->Bind();
         }
         if ($arResult["IDEA_MODERATOR"] && $_REQUEST["BIND_IDEA_STATUS"] != "") {
             CIdeaManagment::getInstance()->Idea($arPost["ID"])->SetStatus($_REQUEST["BIND_IDEA_STATUS"]);
             BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/');
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例4: str_replace

                     $arComment["DATE_CREATE_DATE"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arComment["DATE_CREATE_DATE"]);
                 }
                 if ($arParams["MOBILE"] == "Y") {
                     $timestamp = MakeTimeStamp($arComment["DATE_CREATE"]);
                     $arComment["DATE_CREATE_TIME"] = FormatDate(GetMessage("SONET_SBPC_MOBILE_FORMAT_TIME"), $timestamp);
                 } else {
                     $arComment["DATE_CREATE_TIME"] = FormatDateFromDB($arComment["DATE_CREATE"], strpos($arParams["DATE_TIME_FORMAT_S"], 'a') !== false || ($arParams["DATE_TIME_FORMAT_S"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'GG:MI');
                 }
                 $arResult["CommentsResult"][] = $arComment;
                 $arResult["IDS"][] = $arComment["ID"];
                 $arFieldsHave = array();
                 if ($arComment["HAS_PROPS"] == "") {
                     $arFieldsHave["HAS_PROPS"] = $bHasProps ? "Y" : "N";
                 }
                 if (!empty($arFieldsHave)) {
                     CBlogComment::Update($arComment["ID"], $arFieldsHave, false);
                 }
                 $i++;
             } while ($i < count($arCommentsAll) && ($arComment = $arCommentsAll[$i]));
         }
         unset($arResult["MESSAGE"]);
         unset($arResult["ERROR_MESSAGE"]);
         if ($arParams["CACHE_TIME"] > 0) {
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $GLOBALS["CACHE_MANAGER"]->EndTagCache();
             }
             $cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
         }
     }
 }
 $arResult["MESSAGE"] = $tmp["MESSAGE"];
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例5: implode

 if (!empty($arCopyCat)) {
     $arCopyPostUpdate["CATEGORY_ID"] = implode(",", $arCopyCat);
 }
 if ($_POST["move2blogcopy"] == "Y") {
     $arCopyPostUpdate["NUM_COMMENTS"] = 0;
 }
 if (!empty($arCopyPostUpdate)) {
     $copyID = CBlogPost::Update($copyID, $arCopyPostUpdate);
     $arCopyPost = CBlogPost::GetByID($copyID);
 }
 if ($_POST["move2blogcopy"] != "Y") {
     if (CBlogPost::CanUserDeletePost($arParams["ID"], $user_id)) {
         $dbC = CBlogComment::GetList(array("ID" => "ASC"), array("BLOG_ID" => $arBlog["ID"], "POST_ID" => $arParams["ID"]), false, false, array("PATH", "PUBLISH_STATUS", "POST_TEXT", "TITLE", "DATE_CREATE", "AUTHOR_IP1", "AUTHOR_IP", "AUTHOR_EMAIL", "AUTHOR_NAME", "AUTHOR_ID", "PARENT_ID", "POST_ID", "BLOG_ID", "ID"));
         while ($arC = $dbC->Fetch()) {
             $arCTmp = array("BLOG_ID" => $arCopyBlog["ID"], "POST_ID" => $copyID);
             CBlogComment::Update($arC["ID"], $arCTmp);
         }
         $arFilter = array("POST_ID" => $arParams["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "Y");
         $res = CBlogImage::GetList(array("ID" => "ASC"), $arFilter);
         while ($arImg = $res->GetNext()) {
             $arNewImg = array("BLOG_ID" => $arCopyBlog["ID"], "POST_ID" => $copyID);
             CBlogImage::Update($arImg["ID"], $arNewImg);
         }
         if (!CBlogPost::Delete($arParams["ID"])) {
             $arResult["ERROR_MESSAGE"] = GetMessage("BPE_COPY_DELETE_ERROR");
         } else {
             CBlogPost::DeleteLog($arParams["ID"], $arParams["MICROBLOG"]);
         }
     }
 }
 BXClearCache(True, "/" . SITE_ID . "/blog/" . $arCopyBlog["URL"] . "/first_page/");
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例6: foreach

                 } else {
                     $lAdmin->AddGroupError(GetMessage("BLB_DELETE_ERROR"), $ID);
                 }
             }
             break;
         case "hide":
             if (!CBlogComment::Update($ID, array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_READY))) {
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);
                 } else {
                     $lAdmin->AddGroupError(GetMessage("BLB_HIDE_ERROR"), $ID);
                 }
             }
             break;
         case "show":
             if (!CBlogComment::Update($ID, array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH))) {
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);
                 } else {
                     $lAdmin->AddGroupError(GetMessage("BLB_SHOW_ERROR"), $ID);
                 }
             }
             break;
     }
 }
 if (!empty($arCacheInfo)) {
     foreach ($arCacheInfo as $site => $arB) {
         foreach ($arB as $blogUrl => $v) {
             foreach ($v as $postID) {
                 BXClearCache(True, "/" . $site . "/blog/" . $blogUrl . "/first_page/");
                 BXClearCache(True, "/" . $site . "/blog/" . $blogUrl . "/comment/" . $postID . "/");
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:blog_comment.php


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