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


PHP CForumNew::Delete方法代码示例

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


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

示例1: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB, $APPLICATION;
     $this->errors = false;
     if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/meeting/install/db/" . strtolower($DB->type) . "/uninstall.sql");
         if ($this->errors === false && CModule::IncludeModule('forum')) {
             $dbRes = CSite::GetList($by = 'sort', $order = 'asc', array());
             while ($arSite = $dbRes->Fetch()) {
                 $forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, $arSite['ID']);
                 if ($forumId > 0) {
                     CForumNew::Delete($forumId);
                 }
             }
         }
     }
     UnRegisterModuleDependences("calendar", "OnAfterCalendarConvert", "meeting", "CMeetingEventHandlers", "OnAfterCalendarConvert");
     UnRegisterModuleDependences("tasks", "OnTaskDelete", "meeting", "CMeetingEventHandlers", "OnTaskDelete");
     UnRegisterModule("meeting");
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:index.php

示例2: foreach

         $arID[] = $arResult['ID'];
     }
 }
 foreach ($arID as $ID) {
     if (strlen($ID) <= 0) {
         continue;
     }
     switch ($_REQUEST['action']) {
         case "delete":
             if (!CForumNew::CanUserDeleteForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
                 $lAdmin->AddGroupError(GetMessage("FA_DELETE_NO_PERMS"), $ID);
                 continue;
             }
             @set_time_limit(0);
             $DB->StartTransaction();
             if (!CForumNew::Delete($ID)) {
                 $DB->Rollback();
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);
                 } else {
                     $lAdmin->AddGroupError(GetMessage("FA_DELETE_ERROR"), $ID);
                 }
             }
             $DB->Commit();
             break;
         case "activate":
         case "deactivate":
             if (!CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
                 $lAdmin->AddUpdateError(GetMessage("FA_NO_PERMS2UPDATE") . " " . $ID . "", $ID);
                 continue;
             }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:forum_admin.php

示例3: array

    $arUsers[1] = array("USER_ID" => 1, "SHOW_ABC" => "admin");
}
$arAdmin = $arUsers[1];
unset($arUsers[1]);
$arUser = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST1"));
$arUser2 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST2"));
$arUser3 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST3"));
$arUser4 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST4"));
$arUser5 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST5"));
$arUser6 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST6"));
$arForums = array(array("XML_ID" => "COMMUNITY_PHOTO_COMMENTS", "NAME" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_NAME"), "DESCRIPTION" => "", "SORT" => 3, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", "1" => "Y")), array("XML_ID" => "COMMUNITY_USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_FORUM_DESCRIPTION"), "SORT" => 4, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("1" => "Y")));
foreach ($arForums as $arForum) {
    $dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"]));
    if ($resForum = $dbForum->Fetch()) {
        if (WIZARD_INSTALL_DEMO_DATA) {
            CForumNew::Delete($resForum["ID"]);
        } else {
            $res = CForumNew::GetSites($resForum["ID"]);
            if (!array_key_exists(WIZARD_SITE_ID, $res)) {
                $res[WIZARD_SITE_ID] = WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#";
                CForumNew::Update($resForum["ID"], array("SITES" => $res));
            }
            continue;
        }
    }
    $forumID = CForumNew::Add($arForum);
    if ($forumID < 1 || !isset($arForum["TOPICS"]) || !is_array($arForum["TOPICS"])) {
        continue;
    }
    foreach ($arForum["TOPICS"] as $arTopic) {
        $arTopic["FORUM_ID"] = $forumID;
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php


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