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


PHP CBlogPost::DeleteSocNetPostPerms方法代码示例

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


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

示例1: Delete

 public static function Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     $arPost = CBlogPost::GetByID($ID);
     if ($arPost) {
         foreach (GetModuleEvents("blog", "OnBeforePostDelete", true) as $arEvent) {
             if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
                 return false;
             }
         }
         $dbResult = CBlogComment::GetList(array(), array("POST_ID" => $ID), false, false, array("ID"));
         while ($arResult = $dbResult->Fetch()) {
             if (!CBlogComment::Delete($arResult["ID"])) {
                 return False;
             }
         }
         $dbResult = CBlogUserGroupPerms::GetList(array(), array("POST_ID" => $ID, "BLOG_ID" => $arPost["BLOG_ID"]), false, false, array("ID"));
         while ($arResult = $dbResult->Fetch()) {
             if (!CBlogUserGroupPerms::Delete($arResult["ID"])) {
                 return False;
             }
         }
         $dbResult = CBlogTrackback::GetList(array(), array("POST_ID" => $ID, "BLOG_ID" => $arPost["BLOG_ID"]), false, false, array("ID"));
         while ($arResult = $dbResult->Fetch()) {
             if (!CBlogTrackback::Delete($arResult["ID"])) {
                 return False;
             }
         }
         $dbResult = CBlogPostCategory::GetList(array(), array("POST_ID" => $ID, "BLOG_ID" => $arPost["BLOG_ID"]), false, false, array("ID"));
         while ($arResult = $dbResult->Fetch()) {
             if (!CBlogPostCategory::Delete($arResult["ID"])) {
                 return False;
             }
         }
         $strSql = "SELECT F.ID " . "FROM b_blog_post P, b_file F " . "WHERE P.ID = " . $ID . " " . "\tAND P.ATTACH_IMG = F.ID ";
         $z = $DB->Query($strSql, false, "FILE: " . __FILE__ . " LINE:" . __LINE__);
         while ($zr = $z->Fetch()) {
             CFile::Delete($zr["ID"]);
         }
         CBlogPost::DeleteSocNetPostPerms($ID);
         unset($GLOBALS["BLOG_POST"]["BLOG_POST_CACHE_" . $ID]);
         $arBlog = CBlog::GetByID($arPost["BLOG_ID"]);
         $result = $DB->Query("DELETE FROM b_blog_post WHERE ID = " . $ID . "", true);
         if (IntVal($arBlog["LAST_POST_ID"]) == $ID) {
             CBlog::SetStat($arPost["BLOG_ID"]);
         }
         if ($result) {
             $res = CBlogImage::GetList(array(), array("POST_ID" => $ID, "IS_COMMENT" => "N"));
             while ($aImg = $res->Fetch()) {
                 CBlogImage::Delete($aImg['ID']);
             }
         }
         if ($result) {
             $GLOBALS["USER_FIELD_MANAGER"]->Delete("BLOG_POST", $ID);
         }
         foreach (GetModuleEvents("blog", "OnPostDelete", true) as $arEvent) {
             ExecuteModuleEventEx($arEvent, array($ID, &$result));
         }
         if (CModule::IncludeModule("search")) {
             CSearch::Index("blog", "P" . $ID, array("TITLE" => "", "BODY" => ""));
             //CSearch::DeleteIndex("blog", false, "COMMENT", $arPost["BLOG_ID"]."|".$ID);
         }
         return $result;
     } else {
         return false;
     }
     return True;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:69,代码来源:blog_post.php


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