本文整理匯總了PHP中messages::sendMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP messages::sendMessage方法的具體用法?PHP messages::sendMessage怎麽用?PHP messages::sendMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類messages
的用法示例。
在下文中一共展示了messages::sendMessage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: messages
function action_index()
{
$data = new messages();
if (isset($_POST['send'])) {
if ($_POST["id"]) {
$data->sendMessage($_POST["id"], $_POST["message"]);
}
}
$messages = $data->getMessages();
$data = array(array($messages, 'messages'));
$this->view->generate('messages.tpl', $data);
}
示例2: die
$sql .= " published_day = '{$d}' ,";
$sql .= " published_month = '{$m}' ,";
$sql .= " published_year = '{$y}' ";
$sql .= " where articles.articleID=" . $value;
$result = $db->query($sql);
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
// Also we have to update on the article versions...
$sql = " update article_versions ";
$sql .= " set article_versions.stageID = '6' , status = 'live' , ";
$sql .= " status = 'published' ,";
$sql .= " dateline= '{$date_published}' ,";
$sql .= " published_day = '{$d}' ,";
$sql .= " published_month = '{$m}' ,";
$sql .= " published_year = '{$y}' ";
$sql .= " where article_versions.articleID=" . $value;
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$receiverID = array($editorID, $writerID, $newsdirectorID);
$msg = new messages();
$title = $_SESSION['title'];
$_SESSION['task'] = 'publish';
$_SESSION['title'] = $title;
$subject = " PUBLISHED : " . $_SESSION['title'];
$message = " The article was successfully published. Thanks =) ";
$msg->sendMessage($_SESSION['userID'], $receiverID, $date_msg_created, 0, $subject, $message);
}
}
header('Location: view_article_versions.php?stageID=5');
示例3: header
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
header('Location: login.php');
}
if (isset($_SESSION['login'])) {
$userID = $_SESSION['userID'];
$usertype = $_SESSION['usertype'];
}
// print_r($_POST);
if (isset($_POST['send'])) {
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$date_msg_created = time();
$msg = new messages();
$result = $msg->sendMessage($_SESSION['userID'], $to, $date_msg_created, 'Unread', $subject, $message);
if ($result) {
$_SESSION['task'] = 'sent';
$_SESSION['title'] = $subject;
$_SESSION['to'] = $to;
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->sending_msg, 'Sending a message " ' . $_SESSION['title'] . ' " to ' . getUser_info($_SESSION['to'], 'fullname'));
header('location: view_messages.php');
}
}
if (isset($_POST['cancel'])) {
header('location: view_messages.php');
}