本文整理汇总了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);
}
示例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"]));
示例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);
}
}