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


PHP Messages::flagMessage方法代码示例

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


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

示例1: tra

// Strip Re:Re:Re: from subject
if (isset($_REQUEST['action']['reply']) || isset($_REQUEST['action']['replyall'])) {
    $_REQUEST['subject'] = tra("Re: ") . preg_replace("/^(" . tra("Re: ") . ")+/i", "", $_REQUEST['subject']);
}
$gBitSmarty->assign('to', $_REQUEST['to']);
$gBitSmarty->assign('cc', $_REQUEST['cc']);
$gBitSmarty->assign('bcc', $_REQUEST['bcc']);
$gBitSmarty->assign('subject', $_REQUEST['subject']);
$gBitSmarty->assign('body', $_REQUEST['body']);
$gBitSmarty->assign('priority', $_REQUEST['priority']);
$gBitSmarty->assign('sent', 0);
$feedback = array();
$gBitSmarty->assignByRef('feedback', $feedback);
if (isset($_REQUEST['replyto']) || isset($_REQUEST['replyallto'])) {
    $flagHash = array('msg_id' => $_REQUEST['msg_id'], 'act' => 'is_replied', 'actval' => 'y');
    $messages->flagMessage($flagHash);
}
if (isset($_REQUEST['send'])) {
    $message = '';
    // Validation:
    // must have a subject or body non-empty (or both)
    if (!empty($_REQUEST['subject']) && !empty($_REQUEST['body'])) {
        // Parse the to, cc and bcc fields into an array
        $arrTo = explode(',', preg_replace('/ /', '', $_REQUEST['to']));
        $arrCc = explode(',', preg_replace('/ /', '', $_REQUEST['cc']));
        $arrBcc = explode(',', preg_replace('/ /', '', $_REQUEST['bcc']));
        $toUsers = array_unique(array_merge($arrTo, $arrCc, $arrBcc));
        // Validation: either to, cc or bcc must have a valid user
        if (count($toUsers)) {
            // Insert the message in the inboxes of each user
            foreach ($toUsers as $toUser) {
开发者ID:bitweaver,项目名称:messages,代码行数:31,代码来源:compose.php

示例2: Messages

/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
require_once MESSAGES_PKG_PATH . 'Messages.php';
if (!$gBitUser->isRegistered()) {
    $gBitSystem->fatalError(tra("You are not logged in"));
}
$gBitSystem->isPackageActive('messages');
$gBitSystem->verifyPermission('p_messages_send');
$messages = new Messages();
if (isset($_REQUEST["msgdel"])) {
    $messages->expunge($gBitUser->mUserId, $_REQUEST['msgdel']);
}
if (!empty($_REQUEST['act'])) {
    $messages->flagMessage($_REQUEST);
}
$gBitSmarty->assign('msg_id', $_REQUEST['msg_id']);
// get prev / next messages
$listHash = $_REQUEST;
$listHash['neighbour'] = 'next';
$next = $messages->getNeighbourMessage($listHash);
$listHash['neighbour'] = 'prev';
$prev = $messages->getNeighbourMessage($listHash);
$gBitSmarty->assign('next', $next);
$gBitSmarty->assign('prev', $prev);
// Mark the message as read
$flagHash = array('msg_id' => $_REQUEST['msg_id'], 'act' => 'is_read', 'actval' => 'y');
$messages->flagMessage($flagHash);
// Get the message and assign its data to template vars
$msg = $messages->getMessage($gBitUser->mUserId, $_REQUEST['msg_id']);
开发者ID:bitweaver,项目名称:messages,代码行数:31,代码来源:read.php


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