當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Messages::expunge方法代碼示例

本文整理匯總了PHP中Messages::expunge方法的典型用法代碼示例。如果您正苦於以下問題:PHP Messages::expunge方法的具體用法?PHP Messages::expunge怎麽用?PHP Messages::expunge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Messages的用法示例。


在下文中一共展示了Messages::expunge方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Messages

$gBitSystem->isPackageActive('messages', TRUE);
$gBitSystem->verifyPermission('p_messages_send');
$messages = new Messages();
$max_records = $gBitSystem->getConfig('max_records', 20);
// Mark messages if the mark button was pressed
if (isset($_REQUEST["mark"]) && isset($_REQUEST["msg"])) {
    foreach (array_keys($_REQUEST["msg"]) as $msg_id) {
        $parts = explode('_', $_REQUEST['action']);
        $flagHash = array('msg_id' => $msg_id, 'act' => $parts[0] . '_' . $parts[1], 'actval' => $parts[2]);
        $messages->flagMessage($flagHash);
    }
}
// Delete messages if the delete button was pressed
if (!empty($_REQUEST["delete"]) && !empty($_REQUEST["msg"])) {
    foreach (array_keys($_REQUEST["msg"]) as $msg_id) {
        $messages->expunge($gBitUser->mUserId, $msg_id);
    }
}
if (!empty($_REQUEST['filter'])) {
    if ($_REQUEST['flags'] != '') {
        $parts = explode('_', $_REQUEST['flags']);
        $_REQUEST['flag'] = substr($_REQUEST['flags'], 0, strrpos($_REQUEST['flags'], '_'));
        $_REQUEST['flagval'] = substr($_REQUEST['flags'], strrpos($_REQUEST['flags'], '_') + 1);
    }
}
if (empty($_REQUEST["sort_mode"])) {
    $_REQUEST['sort_mode'] = 'msg_date_desc';
} else {
    $_REQUEST['sort_mode'] = $_REQUEST["sort_mode"];
}
if (isset($_REQUEST["find"])) {
開發者ID:bitweaver,項目名稱:messages,代碼行數:31,代碼來源:message_box.php

示例2: Messages

// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
/**
 * 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');
開發者ID:bitweaver,項目名稱:messages,代碼行數:31,代碼來源:read.php


注:本文中的Messages::expunge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。