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


PHP CForumMessage::Delete方法代码示例

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


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

示例1: ForumSpamMessage

function ForumSpamMessage($message, &$strErrorMessage, &$strOKMessage, $arAddParams = array())
{
    global $USER;
    $arError = array();
    $arOK = array();
    $arAddParams = !is_array($arAddParams) ? array($arAddParams) : $arAddParams;
    $arAddParams["PERMISSION"] = !empty($arAddParams["PERMISSION"]) ? $arAddParams["PERMISSION"] : false;
    $message = ForumDataToArray($message);
    if (empty($message)) {
        $arError[] = GetMessage("SPAM_NO_MESS");
    } else {
        foreach ($message as $MID) {
            if (!CForumMessage::CanUserDeleteMessage($MID, $USER->GetUserGroupArray(), $USER->GetID(), $arAddParams["PERMISSION"])) {
                $arError[] = GetMessage("SPAM_NO_PERMS") . "(MID=" . $MID . ")";
            } else {
                $arMessage = CForumMessage::GetByID($MID, array("FILTER" => "N"));
                if (CModule::IncludeModule("mail")) {
                    CMailMessage::MarkAsSpam($arMessage["XML_ID"], "Y");
                }
                if (CForumMessage::Delete($MID)) {
                    $arOK[] = GetMessage("SPAM_OK") . "(MID=" . $MID . ")";
                    CForumEventLog::Log("message", "spam", $MID, print_r($arMessage, true));
                } else {
                    $arError[] = GetMessage("SPAM_NO") . "(MID=" . $MID . ")";
                }
            }
        }
    }
    if (!empty($arError)) {
        $strErrorMessage .= implode(".\n", $arError) . ".\n";
    }
    if (!empty($arOK)) {
        $strOKMessage .= implode(".\n", $arOK) . ".\n";
    }
    return empty($arError) ? true : false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:36,代码来源:include.php

示例2: delete

 public function delete()
 {
     if ($this->message === null) {
         $this->errorCollection->addOne(new Error(Loc::getMessage("FORUM_CM_ERR_COMMENT_IS_LOST2"), self::ERROR_MESSAGE_IS_NULL));
     } else {
         if (\CForumMessage::Delete($this->message["ID"])) {
             \CForumEventLog::Log("message", "delete", $this->message["ID"], serialize($this->message + array("TITLE" => $this->topic["TITLE"])));
             /***************** Events ******************************************/
             /***************** Events OnAfterCommentUpdate *********************/
             $fields = array($this->entity->getType(), $this->entity->getId(), array("TOPIC_ID" => $this->topic["ID"], "MESSAGE_ID" => $this->message["ID"], "MESSAGE" => $this->getComment(), "ACTION" => "DEL"));
             $event = new Event("forum", "OnAfterCommentUpdate", $fields);
             $event->send();
             /***************** Events OnCommentModerate ************************/
             $event = new Event("forum", "OnCommentDelete", $fields);
             $event->send();
             /***************** /Events *****************************************/
         } else {
             $text = Loc::getMessage("FORUM_CM_ERR_DELETE");
             if (($ex = $this->getApplication()->getException()) && $ex) {
                 $text = $ex->getString();
             }
             $this->errorCollection->addOne(new Error($text, self::ERROR_PARAMS_MESSAGE));
         }
     }
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:26,代码来源:comment.php

示例3: foreach

            if ($exception = $APPLICATION->GetException()) {
                $lAdmin->AddGroupError($exception->GetString(), $id);
            } else {
                $lAdmin->AddGroupError('Ошибка редактирования отзывов', $id);
            }
        }
    }
}
if (($idList = $lAdmin->GroupAction()) && check_bitrix_sessid()) {
    foreach ($idList as $id) {
        if (!(int) $id) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case 'delete':
                CForumMessage::Delete($id);
                break;
        }
    }
}
$themeList = [];
$orderList = strtoupper($by) === 'ID' ? [$by => $order] : [$by => $order, 'ID' => 'DESC'];
$reviewCollection = CForumMessage::GetList($orderList);
$adminResult = new CAdminResult($reviewCollection, $tableId);
$adminResult->NavStart();
$lAdmin->NavText($adminResult->GetNavPrint('На странице:', true));
while ($res = $adminResult->NavNext(true, 'f_')) {
    $row =& $lAdmin->AddRow($f_ID, $res);
    if ((int) $res['PARAM2']) {
        $element = CIBlockElement::GetList([], ['ID' => $res['PARAM2']], false, false, ['ID', 'IBLOCK_ID', 'IBLOCK_TYPE', 'NAME'])->Fetch();
        $res['IBLOCK_ELEMENT'] = $element ? '<a href="/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=' . $element['IBLOCK_ID'] . '&type=' . $element['IBLOCK_TYPE'] . '&ID=' . $element['ID'] . '" target="_blank"]>' . $element['NAME'] . '</a>' : $res['PARAM2'] . ' (Удалён)';
开发者ID:Varfann,项目名称:bx-features,代码行数:31,代码来源:forum_review.php


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