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


PHP CEventMessage::GetByID方法代码示例

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


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

示例1: LocalRedirect

        $bVarsFromForm = true;
    } else {
        if (strlen($save) > 0) {
            if (!empty($_REQUEST["type"])) {
                LocalRedirect(BX_ROOT . "/admin/type_edit.php?EVENT_NAME=" . $EVENT_NAME . "&lang=" . LANGUAGE_ID);
            } else {
                LocalRedirect(BX_ROOT . "/admin/message_admin.php?lang=" . LANGUAGE_ID);
            }
        } else {
            LocalRedirect(BX_ROOT . "/admin/message_edit.php?lang=" . LANGUAGE_ID . "&ID=" . $ID . "&type=" . $_REQUEST["type"] . "&" . $tabControl->ActiveTabParam());
        }
    }
}
$str_ACTIVE = "Y";
$str_EVENT_NAME = $EVENT_NAME;
$em = CEventMessage::GetByID($ID);
if (!$em->ExtractEditFields("str_")) {
    $ID = 0;
} else {
    $str_LID = array();
    $db_LID = CEventMessage::GetLang($ID);
    while ($ar_LID = $db_LID->Fetch()) {
        $str_LID[] = $ar_LID["LID"];
    }
}
if ($bVarsFromForm) {
    $str_LID = $LID;
    $DB->InitTableVarsForEdit("b_event_message", "", "str_");
}
if ($ID > 0 && $COPY_ID <= 0) {
    $APPLICATION->SetTitle(str_replace("#ID#", "{$ID}", GetMessage("EDIT_MESSAGE_TITLE")));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:message_edit.php

示例2: trim

$arParams["EMAIL_TO"] = trim($arParams["EMAIL_TO"]);
if ($arParams["EMAIL_TO"] == '') {
    $arParams["EMAIL_TO"] = COption::GetOptionString("main", "email_from");
}
if (isset($_POST["ajaxm"])) {
    $arFields = array("NAME" => $_POST["name"], "EMAIL" => $_POST["email"], "EMAIL_TO" => $arParams["EMAIL_TO"], "TEXT" => $_POST["message"]);
    $ibe = new CIBlockElement();
    $preview_text = $_POST["message"];
    $messageParams = array("IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => $arParams["IBLOCK_ID"], "NAME" => $_POST["name"], "ACTIVE" => "N", "ACTIVE_FROM" => date('d.m.Y H:i'), "PREVIEW_TEXT" => $preview_text, "CODE" => $_POST["email"]);
    if ($qID = $ibe->Add($messageParams)) {
        $link = "bitrix/admin/iblock_element_edit.php?IBLOCK_ID={$arParams["IBLOCK_ID"]}&type={$arParams["IBLOCK_TYPE"]}&ID={$qID}&lang=ru";
        $text = $_POST["message"] . "\n\n" . $link;
        $arFields = array("TEXT" => $_POST["message"], "AUTHOR" => $_POST['name'], "AUTHOR_EMAIL" => $_POST['email'], "EMAIL" => $_POST["email"], "EMAIL_TO" => $arParams["EMAIL_TO"], "LINK" => $link);
        if (is_array($arParams['EVENT_MESSAGE_ID'])) {
            foreach ($arParams['EVENT_MESSAGE_ID'] as $event) {
                $rsEM = CEventMessage::GetByID($event);
                $arEM = $rsEM->Fetch();
                CEvent::Send($arEM['EVENT_NAME'], SITE_ID, $arFields, "N", $event);
            }
        } else {
            $event = $arParams['EVENT_MESSAGE_ID'];
            $rsEM = CEventMessage::GetByID($event);
            $arEM = $rsEM->Fetch();
            CEvent::Send($arEM['EVENT_NAME'], SITE_ID, $arFields, "N", $event);
        }
    } else {
        echo $ibe->LAST_ERROR;
    }
} else {
    $this->IncludeComponentTemplate();
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:component.php


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