本文整理汇总了PHP中Messages::getUserMessagesBefore方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::getUserMessagesBefore方法的具体用法?PHP Messages::getUserMessagesBefore怎么用?PHP Messages::getUserMessagesBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::getUserMessagesBefore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
require_once '../phpInclude/db_connection.php';
error_reporting(E_ALL);
require_once '../classes/AllClasses.php';
$user_id = $_REQUEST['user_id'];
$user_id2 = $_REQUEST['user_id2'];
$id = $_REQUEST['id'] ? $_REQUEST['id'] : 0;
$user = new Users();
$message = new Messages();
if (!empty($user_id) && !empty($user_id2)) {
$messages = $message->getUserMessagesBefore($user_id, $user_id2, $id);
$success = '1';
$msg = 'success';
} else {
$success = '0';
$msg = 'Incomplete Parameters';
}
echo json_encode(array('success' => $success, 'msg' => $msg, 'messages' => $messages));
示例2: array
// +-----------------------------------+
$token = $_REQUEST['token'];
$user2 = $_REQUEST['user_id2'];
$message_id = $_REQUEST['message_id'];
$GLOBALS['timezone'] = $_REQUEST['timezone'];
if (!($token && $user2 && $message_id)) {
$success = "0";
$msg = "Incomplete Parameters";
$data = array();
} else {
// +-----------------------------------+
// + STEP 3: perform operations +
// +-----------------------------------+
$user_id = GeneralFunctions::getUserId($token);
if ($user_id) {
$data = Messages::getUserMessagesBefore($user_id, $user2, $message_id);
if ($data) {
$success = "1";
$msg = "Records Found";
} else {
$success = '0';
$msg = "No Record Found";
}
} else {
$success = "0";
$msg = "Token Expired";
}
}
// +-----------------------------------+
// + STEP 4: send json data +
// +-----------------------------------+