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


PHP Message::createMessage方法代码示例

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


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

示例1: balanceLog

 /**
  * 余额变更日志,推送
  *
  * @return boolean
  */
 public static function balanceLog($category, $user_id, $amount, $note = '', $is_push = true)
 {
     if (empty($user_id) || empty($amount)) {
         return false;
     }
     //记录日志
     $withdraw = new Withdraw();
     $withdraw->category = $category;
     $withdraw->user_id = $user_id;
     $withdraw->amount = $amount;
     $withdraw->note = $note;
     $withdraw->state = 1;
     if ($withdraw->save()) {
         $message = array('user_id' => $withdraw->user_id, 'type' => Message::OTHER, 'content' => $withdraw->note . ',金额:' . $withdraw->amount . '元');
         Message::createMessage($message, $is_push);
     }
     return true;
 }
开发者ID:astronautyan,项目名称:O2OMobile_PHP,代码行数:23,代码来源:Withdraw.php

示例2: run

 public function run()
 {
     if (isset($_POST['email']) && isset($_POST['msg'])) {
         $app = isset($_POST['app']) ? $_POST['app'] : null;
         $res = Message::createMessage($_POST['email'], $_POST['msg'], $app);
     } else {
         $res = array('result' => false, 'msg' => 'something somewhere went terribly wrong');
     }
     Rest::json($res);
     Yii::app()->end();
 }
开发者ID:Koulio,项目名称:pixelhumain,代码行数:11,代码来源:SendMessageAction.php

示例3: createTopic

 /**
  * createTopics-funktio lähettää Topic-mallille kutsun luoda uusi keskustelu ja Message-mallille lisätä uusi viesti
  */
 public static function createTopic()
 {
     $params = $_POST;
     if ($params['title'] != null && $params['content'] != null && !ctype_space($params['title']) && !ctype_space($params['content'])) {
         $topic = Topic::createTopic($params['title'], $params['category']);
         $message = Message::createMessage($topic->id, $params['content']);
         $messages = Message::all($topic->id);
         View::make('keskustelu.html', array('topic' => $topic, 'messages' => $messages));
     }
     $categories = Category::all();
     View::make('luokeskustelu.html', array('categories' => $categories, 'error' => "Otsikko tai aloitusviestisi oli tyhjä"));
 }
开发者ID:hyttijan,项目名称:Tsoha-Bootstrap,代码行数:15,代码来源:topic_controller.php

示例4: Message

<?php

include_once "header.php";
if ($_SERVER["REQUEST_METHOD"] === 'POST') {
    $newTweet = new Message();
    $newTweet->createMessage($conn, $_SESSION["user_id"], $_GET['receive_id'], $_POST["subject"], $_POST["message"]);
    header("Location: http://localhost/ProjectTwitter/message_show.php");
}
?>
<hr>
<form method="post" action="#" style="padding: 20px">
    <label>CREATE NEW MESSAGE</label><br>
    <label></label><br>
    <input name="subject" placeholder="Enter Subject"/><br>
    <label></label><br>
    <textarea name="message" placeholder="Enter tweet here"></textarea><br>
    <label></label><br>
    <input type="submit" value="MESSAGE">
</form>
<hr>
开发者ID:HubertAdamus,项目名称:Pure_PHP,代码行数:20,代码来源:message_create.php

示例5: mysqli_real_escape_string

<?php

require_once "classes/class_message.php";
if (isset($_POST['delete'])) {
    Message::deleteMessage($_POST['message_id']);
}
if (isset($_POST['submit'])) {
    $content = mysqli_real_escape_string($connection, $_POST['content']);
    $author = mysqli_real_escape_string($connection, $_POST['author']);
    if (trim($author) == "") {
        $author = "Anonymous";
    }
    if (trim($content) == "") {
        $error = true;
    } else {
        Message::createMessage($content, $author);
    }
}
$all_messages = Message::getAllMessages();
require_once "templates/header.php";
?>

	<div class="row">
		<div class="col-md-12"><h1>Guestbook</h1></div>
	</div>
	<?php 
if ($all_messages) {
    while ($message = mysqli_fetch_array($all_messages)) {
        ?>
			<div class="message">
				<p><?php 
开发者ID:victorarsenie,项目名称:developer-test,代码行数:31,代码来源:guestbook.php

示例6: session_start

require_once "src/connection.php";
session_start();
if (isset($_SESSION['user']) == false) {
    header("location: login.php");
}
$myUser = $_SESSION['user'];
if ($_SERVER['REQUEST_METHOD'] == "GET" || $_SERVER['REQUEST_METHOD'] == "POST") {
    if (isset($_GET['userId'])) {
        $userIdToShow = $_GET['userId'];
        $userToShow = User::getUserById($userIdToShow);
    } else {
        $userToShow = $myUser;
    }
    if (isset($_POST['message'])) {
        Message::createMessage($_POST['message'], $myUser->getId(), $userIdToShow);
    }
    echo "Wymiana wiadomosci z u¿ytkownikiem <strong>{$userToShow->getUserName()}</strong><br><br>";
    echo "<form action='show_message.php?userId={$userIdToShow}' method='post'>\n          <input type = 'text' name = 'message' placeholder='write message'>\n          <input type = 'submit' value='Post'>\n        </form>";
    $allMessages = Message::showAllMessagesByUser($myUser->getId(), $userIdToShow);
    foreach ($allMessages as $message) {
        $authorId = $message->getAuthorId();
        $receiverId = $message->getReceiverId();
        $author = User::getUserById($authorId);
        $receiver = User::getUserById($receiverId);
        echo "<strong>{$author->getUserName()}</strong> wys³a³ wiadomoœæ u¿ytkownikowi <strong>{$receiver->getUserName()}</strong>:<br>";
        echo "{$message->getMessageText()}<br>";
        echo "Wyslano: {$message->getMessageDate()}<br><br>";
    }
}
echo "\n<br><br>\n<a href = 'show_user.php?userId={$myUser->getId()}'>Powrót na swój profil</a>\n<br><br>\n<a href = 'main.php'>Powrot do glównej</a>\n<br><br>\n<a href = 'logout.php'>Wyloguj</a>";
开发者ID:BartoszJanGodlewski,项目名称:TweeterWorkshop,代码行数:30,代码来源:show_message.php

示例7: User

require_once "functions/function.inputSanitizer.inc.php";
require_once "classes/class.DbConnect.inc.php";
require_once "classes/class.User.inc.php";
require_once "classes/class.Tweet.inc.php";
require_once "classes/class.Comment.inc.php";
require_once "classes/class.Message.inc.php";
require_once "includes/userLoginCheck.inc.php";
/**
 * Upload from DB the data of the user who is the 'owner' of the page
 */
$visitedUser = new User($conn);
$visitedUser->loadFromDB(sanitizeMySQL($conn, $_GET['user']));
if ($_SERVER['REQUEST_METHOD'] = 'POST' && isset($_POST['messageText'])) {
    if (strlen($_POST['messageText']) > 5 && strlen($_POST['messageText']) < 60) {
        $message = new Message($conn);
        if ($message->createMessage($user->getId(), $visitedUser->getId(), sanitizeMySQL($conn, $_POST['messageText']))) {
            header("Location: userPage.php?user=" . $_POST['visitedUserId'] . "");
        }
    }
}
?>
<!DOCTYPE html>
<html lang="pl-PL">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>MyTwitt</title>

    <!-- Bootstrap -->
开发者ID:grzesieksocha,项目名称:myTweet,代码行数:31,代码来源:userPage.php

示例8: Message

<?php

session_start();
require '../class/pdo_connect.php';
include '../class/user_class.php';
include '../class/message_class.php';
$sendMessage = new Message();
$sendMessage->createMessage($connect);
header("Location: accueil.php");
exit;
开发者ID:TheAbstractDev,项目名称:My-Meetic-PHP,代码行数:10,代码来源:chat-fetch.php

示例9: session_start

<?php

require_once "src/connection.php";
session_start();
if (isset($_SESSION['user']) == false) {
    header("location: login.php");
}
$myUser = $_SESSION['user'];
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if (strlen($_POST['message']) > 0) {
        $createdMessage = Message::createMessage($_POST['sender'], $_POST['receiver'], $_POST['message']);
        if ($createdMessage != false) {
            echo "<br><br>Message sent!";
        }
        header("Refresh:2; url=mailbox.php");
    }
}
if ($_SERVER['REQUEST_METHOD'] == "GET") {
    if (isset($_GET['userId'])) {
        $userIdToShow = $_GET['user'];
        $userToShow = User::getUserById($userIdToShow);
    } else {
        $userToShow = $myUser;
    }
    $userIdToShow = $_GET['userId'];
    $userToShow = User::getUserById($userIdToShow);
    if ($userToShow != false) {
        echo "<br>Strona usera {$userToShow->getEmail()}.<br><br>";
        if ($myUser->getId() != $userIdToShow) {
            echo "\n                <form action='send_message.php?userId={$_GET['userId']}' method='POST'>\n                    <textarea name='message' placeholder='message text'></textarea>\n                    <br>\n                    <input type='hidden' name='sender' value='{$myUser->getId()}'>\n                    <input type='hidden' name='receiver' value='{$userIdToShow}'>\n                    <input type='submit' value='Send a message to {$userToShow->getEmail()}.'>\n                </form>\n                ";
        }
开发者ID:VoyteckLenartovich,项目名称:tweeter_workshop,代码行数:31,代码来源:send_message.php


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