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


PHP CBlogPost::DeleteLog方法代码示例

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


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

示例1: GetMessage

                 $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_DEL_ERROR") . '<br />';
             }
         }
         $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_DEL_NO_RIGHTS") . '<br />';
     } else {
         $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_SESSID_WRONG") . '<br />';
     }
 }
 if ($_GET["hide"] == "Y" && !$arResult["bFromList"]) {
     if (check_bitrix_sessid()) {
         if ($arResult["PostPerm"] >= BLOG_PERMS_MODERATE) {
             if (CBlogPost::Update($arParams["ID"], array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_READY))) {
                 BXClearCache(True, "/" . SITE_ID . "/blog/popular_posts/");
                 BXClearCache(true, "/blog/socnet_post/" . intval($arParams["ID"] / 100) . "/" . $arParams["ID"] . "/");
                 BXClearCache(true, "/blog/socnet_post/gen/" . intval($arParams["ID"] / 100) . "/" . $arParams["ID"] . "/");
                 CBlogPost::DeleteLog($arParams["ID"]);
                 $url = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("user_id" => $arBlog["OWNER_ID"]));
                 if (strpos($url, "?") === false) {
                     $url .= "?";
                 } else {
                     $url .= "&";
                 }
                 $url .= "hide_id=" . $arParams["ID"] . "&success=Y";
                 LocalRedirect($url);
             } else {
                 $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_HIDE_ERROR") . '<br />';
             }
         } else {
             $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_HIDE_NO_RIGHTS") . '<br />';
         }
     } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: elseif

 if ($arParams["ID"] > 0) {
     if (array_key_exists("GRAT", $_POST) && is_array($_POST["GRAT"]) && array_key_exists("U", $_POST["GRAT"]) && is_array($_POST["GRAT"]["U"]) && array_key_exists("GRAT_TYPE", $_POST)) {
         if (is_array($arResult["PostToShow"]["GRAT_CURRENT"]) && count(array_diff($arResult["PostToShow"]["GRAT_CURRENT"]["USERS"], $_POST["GRAT"]["U"])) == 0 && count(array_diff($_POST["GRAT"]["U"], $arResult["PostToShow"]["GRAT_CURRENT"]["USERS"])) == 0 && ToLower($arResult["PostToShow"]["GRAT_CURRENT"]["TYPE"]) == ToLower($_POST["GRAT_TYPE"])) {
             $bNeedAddGrat = false;
         } elseif (is_array($arResult["PostToShow"]["GRAT_CURRENT"]) && intval($arResult["PostToShow"]["GRAT_CURRENT"]["ID"]) > 0 && CModule::IncludeModule("iblock")) {
             CIBlockElement::Delete($arResult["PostToShow"]["GRAT_CURRENT"]["ID"]);
         }
     }
     $arOldPost = CBlogPost::GetByID($arParams["ID"]);
     preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/ies" . BX_UTF_PCRE_MODIFIER, $arOldPost["DETAIL_TEXT"], $arMentionOld);
     $socnetRightsOld = CBlogPost::GetSocnetPerms($arParams["ID"]);
     if ($newID = CBlogPost::Update($arParams["ID"], $arFields)) {
         BXClearCache(true, "/blog/socnet_post/" . $arParams["ID"] . "/");
         $arFields["AUTHOR_ID"] = $arOldPost["AUTHOR_ID"];
         if ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_DRAFT && $arOldPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
             CBlogPost::DeleteLog($newID);
         } elseif ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH && $arOldPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
             $arParamsUpdateLog = array("allowVideo" => $arResult["allowVideo"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"]);
             CBlogPost::UpdateLog($newID, $arFields, $arBlog, $arParamsUpdateLog);
         }
     }
 } else {
     $arFields["=DATE_CREATE"] = $DB->GetNowFunction();
     $arFields["AUTHOR_ID"] = $arResult["UserID"];
     $arFields["BLOG_ID"] = $arBlog["ID"];
     $newID = CBlogPost::Add($arFields);
     $socnetRightsOld = array("U" => array());
     $bAdd = true;
     $bNeedMail = false;
 }
 if (IntVal($newID) > 0) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例3: IntVal

}
$user_id = IntVal($USER->GetID());
if ($user_id > 0 && $user_id == IntVal($arParams["USER_ID"])) {
    if (CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "blog")) {
        $arResult["ERROR_MESSAGE"] = array();
        $arResult["OK_MESSAGE"] = array();
        //Message delete
        if (IntVal($_GET["del_id"]) > 0) {
            if ($_GET["success"] == "Y") {
                $arResult["OK_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DELED");
            } else {
                if (check_bitrix_sessid()) {
                    $del_id = IntVal($_GET["del_id"]);
                    if ($arPost = CBlogPost::GetByID($del_id)) {
                        if ($arPost["AUTHOR_ID"] == $user_id) {
                            CBlogPost::DeleteLog($del_id);
                            if (CBlogPost::Delete($del_id)) {
                                LocalRedirect($APPLICATION->GetCurPageParam("del_id=" . $del_id . "&success=Y", array("del_id", "pub_id", "sessid", "success")));
                            } else {
                                $arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_ERROR");
                            }
                        } else {
                            $arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_NO_RIGHTS");
                        }
                    } else {
                        $arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_NO_RIGHTS");
                    }
                } else {
                    $arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_SESSID_WRONG");
                }
            }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例4: LocalRedirect

            if (CBlogPost::Delete($del_id)) {
                if ($bGroupMode) {
                    CSocNetGroup::SetLastActivity($arParams["SOCNET_GROUP_ID"]);
                }
                LocalRedirect($APPLICATION->GetCurPageParam("del_id=" . $del_id . "&success=Y", array("del_id", "hide_id", "sessid", "success")));
            } else {
                $arResult["ERROR_MESSAGE"][] = array("id" => "DELETE", "text" => GetMessage("BLOG_BLOG_BLOG_MES_DEL_ERROR"));
            }
        }
    } else {
        $bCanHide = $arResult["perms"] >= BLOG_PERMS_MODERATE ? true : !$bGroupMode && CBlogPost::GetSocNetPostPerms($hide_id, true) >= BLOG_PERMS_MODERATE;
        if (!$bCanHide) {
            $arResult["ERROR_MESSAGE"][] = array("id" => "ACCESS_DENIED", "text" => GetMessage("BLOG_BLOG_BLOG_MES_HIDE_NO_RIGHTS"));
        } elseif (CBlogPost::GetByID($hide_id)) {
            if (CBlogPost::Update($hide_id, array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_READY))) {
                CBlogPost::DeleteLog($hide_id);
                LocalRedirect($APPLICATION->GetCurPageParam("hide_id=" . $hide_id . "&success=Y", array("del_id", "hide_id", "sessid", "success")));
            } else {
                $arResult["ERROR_MESSAGE"][] = array("id" => "HIDE", "text" => GetMessage("BLOG_BLOG_BLOG_MES_HIDE_ERROR"));
            }
        }
    }
}
/********************************************************************
				/Actions
********************************************************************/
/********************************************************************
				Data
********************************************************************/
$arResult["urlToPosts"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_BLOG_POSTS"], array("user_id" => $arParams["USER_ID"]));
CpageOption::SetOptionString("main", "nav_page_in_session", "N");
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例5: array

     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/");
 BXClearCache(True, "/" . SITE_ID . "/blog/" . $arCopyBlog["URL"] . "/calendar/");
 BXClearCache(True, "/" . SITE_ID . "/blog/last_messages/");
 BXClearCache(True, "/" . SITE_ID . "/blog/commented_posts/");
 BXClearCache(True, "/" . SITE_ID . "/blog/popular_posts/");
 BXClearCache(True, "/" . SITE_ID . "/blog/last_comments/");
 BXClearCache(True, "/" . SITE_ID . "/blog/groups/" . $arCopyBlog["GROUP_ID"] . "/");
 BXClearCache(True, "/" . SITE_ID . "/blog/" . $arCopyBlog["URL"] . "/rss_out/");
 BXClearCache(True, "/" . SITE_ID . "/blog/" . $arCopyBlog["URL"] . "/rss_all/");
 BXClearCache(True, "/" . SITE_ID . "/blog/rss_sonet/");
 BXClearCache(True, "/" . SITE_ID . "/blog/rss_all/");
 BXClearCache(True, "/" . SITE_ID . "/blog/" . $arCopyBlog["URL"] . "/favorite/");
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例6: elseif

} elseif (!CModule::IncludeModule("blog")) {
    $strError = GetMessage("BLOG_MOBILE_AJAX_BLOG_MODULE_ERROR");
} elseif (!CModule::IncludeModule("socialnetwork")) {
    $strError = GetMessage("BLOG_MOBILE_AJAX_SONET_MODULE_ERROR");
} elseif (!($arBlogPost = CBlogPost::GetByID($post_id))) {
    $strError = GetMessage("BLOG_MOBILE_BLOG_POST_ERROR");
} elseif (!($arBlog = CBlog::GetByID($arBlogPost["BLOG_ID"]))) {
    $strError = GetMessage("BLOG_MOBILE_BLOG_ERROR");
}
if (!$strError) {
    if ($action == "delete_post") {
        $PostPerm = CBlogPost::GetSocNetPostPerms($post_id, true, $GLOBALS["USER"]->GetID(), $arBlogPost["AUTHOR_ID"]);
        if ($PostPerm < BLOG_PERMS_FULL) {
            $strError = GetMessage("BLOG_MOBILE_DELETE_PERMISSION_ERROR");
        } else {
            CBlogPost::DeleteLog($post_id);
            if (CBlogPost::Delete($post_id)) {
                BXClearCache(True, "/" . SITE_ID . "/blog/popular_posts/");
                BXClearCache(true, "/blog/socnet_post/" . $post_id . "/");
                BXClearCache(true, "/blog/socnet_post/gen/" . $post_id . "/");
            } else {
                $strError = GetMessage("BLOG_MOBILE_DELETE_ERROR");
            }
        }
    } elseif ($action == "get_blog_post_data") {
        $rsLog = CSocNetLog::GetList(array(), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $post_id), false, false, array("ID"));
        if ($arLog = $rsLog->Fetch()) {
            $arResult["log_id"] = $arLog["ID"];
            $arResult["post_user_id"] = $arBlogPost["AUTHOR_ID"];
            $arResult["PostPerm"] = CBlogPost::GetSocNetPostPerms($post_id, true, $GLOBALS["USER"]->GetID(), $arBlogPost["AUTHOR_ID"]);
            if ($arResult["PostPerm"] >= BLOG_PERMS_FULL) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


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