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


PHP messages::uuidToMessageID方法代碼示例

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


在下文中一共展示了messages::uuidToMessageID方法的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

    require_once 'src/core/controller/messages.php';
    $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::uuidToMessageID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。