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


PHP CBlogComment::Delete方法代码示例

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


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

示例1: CallBack_DeleteComment

 public static function CallBack_DeleteComment($arFields)
 {
     if (!CModule::IncludeModule("blog")) {
         return false;
     }
     if (!isset($arFields["SOURCE_ID"]) || intval($arFields["SOURCE_ID"]) <= 0) {
         return false;
     }
     $messageId = intval($arFields["SOURCE_ID"]);
     if (($arBlogComment = CBlogComment::GetByID($messageId)) && CBlogComment::Delete($messageId)) {
         $strOKMessage = GetMessage("IDEA_SONET_DELETE_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 {
         $strErrorMessage = GetMessage("IDEA_SONET_DELETE_COMMENT_SOURCE_ERROR");
     }
     return array("ERROR" => $strErrorMessage, "NOTES" => $strOKMessage);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:22,代码来源:idea_sonet_notify.php

示例2: GetMessage

        $arResult["Perm"] = CBlog::GetBlogUserCommentPerms($arBlog["ID"], $user_id);
    }
}
if ((!empty($arPost) && ($arPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH || $arResult["IDEA_MODERATOR"]) && $arPost["ENABLE_COMMENTS"] == "Y" || $simpleComment) && ($arBlog["ACTIVE"] == "Y" && $arGroup["SITE_ID"] == SITE_ID || $simpleComment)) {
    $arPost = CBlogTools::htmlspecialcharsExArray($arPost);
    $arResult["Post"] = $arPost;
    if ($arPost["BLOG_ID"] == $arBlog["ID"] || $simpleComment) {
        //Comment delete
        if (IntVal($_GET["delete_comment_id"]) > 0 && $arResult["IDEA_MODERATOR"]) {
            if ($_GET["success"] == "Y") {
                $arResult["MESSAGE"] = GetMessage("B_B_PC_MES_DELED");
            } else {
                $arComment = CBlogComment::GetByID(IntVal($_GET["delete_comment_id"]));
                if ($arResult["Perm"] >= BLOG_PERMS_MODERATE && !empty($arComment)) {
                    if (check_bitrix_sessid()) {
                        if (CBlogComment::Delete(IntVal($_GET["delete_comment_id"]))) {
                            BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/first_page/");
                            BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/pages/");
                            BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/comment/" . $arComment["POST_ID"] . "/");
                            BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/post/" . $arComment["POST_ID"] . "/");
                            $Notify = CIdeaManagment::getInstance()->Notification(array("TYPE" => "IDEA_COMMENT", "ID" => IntVal($_GET["delete_comment_id"])))->getSonetNotify()->Remove();
                            LocalRedirect($APPLICATION->GetCurPageParam("", $arRemoveUriParams));
                        }
                    } else {
                        $arResult["ERROR_MESSAGE"] = GetMessage("B_B_PC_MES_ERROR_SESSION");
                    }
                }
                $arResult["ERROR_MESSAGE"] = GetMessage("B_B_PC_MES_ERROR_DELETE");
            }
        } elseif (IntVal($_GET["show_comment_id"]) > 0) {
            $arComment = CBlogComment::GetByID(IntVal($_GET["show_comment_id"]));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例3: array

         }
         if (empty($arCacheInfo[$arResult["BLOG_GROUP_SITE_ID"]][$arResult["BLOG_URL"]])) {
             $arCacheInfo[$arResult["BLOG_GROUP_SITE_ID"]][$arResult["BLOG_URL"]] = array();
         }
         if (!in_array($arResult["POST_ID"], $arCacheInfo[$arResult["BLOG_GROUP_SITE_ID"]][$arResult["BLOG_URL"]])) {
             $arCacheInfo[$arResult["BLOG_GROUP_SITE_ID"]][$arResult["BLOG_URL"]][] = $arResult["POST_ID"];
         }
     }
 }
 foreach ($arID as $ID) {
     if (strlen($ID) <= 0) {
         continue;
     }
     switch ($_REQUEST['action']) {
         case "delete":
             if (!CBlogComment::Delete($ID)) {
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);
                 } 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);
                 }
             }
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:blog_comment.php


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