本文整理汇总了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');
}