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


PHP messages::displayMessage方法代码示例

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


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

示例1: messages

<?php

/**
 * Delete a specific message of your own then display your messages
 */
if ($_SESSION['username'] != "") {
    require_once 'web/core/navigation.php';
    // get and initiate the course class to access the functions
    require_once 'src/core/controller/messages.php';
    $ObjMessages = new messages();
    if ($d) {
        $messageid = $ObjMessages->uuidToMessageID($d);
        // get messages for this user with correct pagination
        $messages = $ObjMessages->displayMessage($ObjAkonga->usernametoid($_SESSION['username']), $messageid, 0, 1);
        // Remove the message chosen
        foreach ($messages as $item) {
            $removeMessage = $ObjMessages->delteMessage($ObjMessages->uuidToMessageID($messageid));
            if ($removeMessage !== false) {
                $responseMsg = "Your message has been deleted";
            } else {
                $responseMsg = "Your message could not be deleted, please try again.";
            }
        }
        // create the view for messages
        $messages = $ObjMessages->displayMessage($ObjAkonga->usernametoid($_SESSION['username']), '', 0, 15);
        require_once 'web/core/messages/view.php';
    } else {
        // Missing message ID so just pull the inbox
        $messageid = "";
        // get messages for this user with correct pagination
        $messages = $ObjMessages->displayMessage($ObjAkonga->usernametoid($_SESSION['username']), $messageid, 0, 15);
开发者ID:TohuMuna,项目名称:akonga,代码行数:31,代码来源:delete.php

示例2: messages

    $ObjMessages = new messages();
    // check for start and limit values for pagination
    if ($e) {
        $startval = (int) $e;
        if ($f) {
            $limitval = (int) $f;
        } else {
            $limitval = 15;
        }
    } else {
        $startval = 0;
        $limitval = 15;
    }
    if ($d) {
        $messageid = $ObjMessages->uuidToMessageID($d);
    } else {
        $messageid = "";
    }
    // get messages for this user with correct pagination
    $messages = $ObjMessages->displayMessage($ObjAkonga->usernametoid($_SESSION['username']), $messageid, $startval, $limitval);
    // Set the message to read if the message has not previously been read
    foreach ($messages as $item) {
        if ($item['message_state'] == '1') {
            $ObjMessages->markAsRead($messageid);
        }
    }
    // create the view for messages
    require_once 'web/core/messages/view.php';
} else {
    require_once 'web/core/login/index.php';
}
开发者ID:TohuMuna,项目名称:akonga,代码行数:31,代码来源:view.php


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