本文整理汇总了PHP中message::send方法的典型用法代码示例。如果您正苦于以下问题:PHP message::send方法的具体用法?PHP message::send怎么用?PHP message::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::send方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: message
break;
case 'message_send':
if (!$_userid) {
wap_msg($L['please_login'], 'index.php?moduleid=' . $moduleid . '&action=login');
}
if ($submit) {
require DT_ROOT . '/include/post.func.php';
require DT_ROOT . '/module/member/message.class.php';
$do = new message();
$message = array();
$message['typeid'] = 0;
$message['touser'] = $touser;
$message['title'] = $title;
$message['content'] = $content;
$message = convert($message, 'utf-8', DT_CHARSET);
if ($do->send($message)) {
wap_msg($L['send_success'], 'index.php?moduleid=' . $moduleid . '&action=message');
} else {
wap_msg($do->errmsg);
}
} else {
$head_title = $L['send_message'] . $DT['seo_delimiter'] . $head_title;
$touser = isset($touser) ? trim($touser) : '';
$title = isset($title) ? trim($title) : '';
$content = isset($content) ? trim($content) : '';
if ($TP == 'touch') {
$head_link = 'index.php?moduleid=' . $moduleid . '&action=message';
$back_link = 'javascript:Dback(\'' . $head_link . '\');';
}
include template('message_send', $TP);
}
示例2: send
public function send()
{
global $USER, $DB;
$context = $this->dialogue->context;
$conversationid = $this->conversation->conversationid;
// check permission
if ($USER->id != $this->_authorid or !has_capability('mod/dialogue:reply', $context)) {
throw new \moodle_exception("This doesn't belong to you!");
}
$sql = "SELECT MAX(dm.conversationindex)\n FROM {dialogue_messages} dm\n WHERE dm.conversationid = :conversationid";
$params = array('conversationid' => $conversationid);
// get last conversation index
$index = $DB->get_field_sql($sql, $params);
// increment index
$index++;
// set the conversation index, important for order of display
$DB->set_field('dialogue_messages', 'conversationindex', $index, array('id' => $this->_messageid));
parent::send();
}
示例3: IsInjected
if (IsInjected($visitor_email)) {
echo "Bad email value!";
exit(1);
}
$email_from = 'ashish@ashishkumar.org';
//<== update the email address
$email_subject = "New Form submission";
$email_body = "You have received a new message from the user {$name} with email id {$visitor_email} \n" . "Here is the message:\n {$message} \n\n\n" . ($to = "ashish@ashishkumar.org");
//<== update the email address
try {
$message = new message();
$message->setSender($email_from);
$message->addTo($to);
$message->setSubject($email_subject);
$message->setTextBody($email_body);
$message->send();
} catch (InvalidArgumentException $e) {
// To add
}
//mail() not supported on GAE
//mail($to,$email_subject,$email_body,$headers);
//done. redirect to main page.
header('Location: index.php');
exit(0);
// Function to validate against any email injection attempts
function IsInjected($str)
{
$injections = array('(\\n+)', '(\\r+)', '(\\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)');
$inject = join('|', $injections);
$inject = "/{$inject}/i";
if (preg_match($inject, $str)) {
示例4: notifyOutbid
public function notifyOutbid()
{
require_once 'message_class.php';
$notifymessage = new message();
$messageinfo = array();
$messageinfo['content'] = "Alert! You have been outbid on the task <a href='/ViewTask.php?id=" . $this->taskid . "'>" . $this->title . "</a>!";
$messageinfo['taskID'] = $this->taskid;
$messageinfo['receiverID'] = $this->getBidLeaderID();
$messageinfo['isSystem'] = true;
$notifymessage->send($messageinfo);
return 1;
}
示例5: message
<?php
require_once 'php/message_class.php';
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if (!isset($_SESSION['userid'])) {
die;
}
//requires POST['receiverID'] and POST['content']
//This is called from AJAX so we don't need to bother with the rest of the page
if (isset($_GET['submit'])) {
$outmessage = new message();
$outmessage->send($_GET);
$outmessages = array();
array_push($outmessages, $outmessage);
printMessages($outmessages);
die;
}
require_once 'php/user_class.php';
require_once 'php/message_lister.php';
//AJAX call to get new message content
if (isset($_GET['getConvos'])) {
$convoUsers = array();
$convoUsers = getConversationList();
foreach ($convoUsers as $user) {
?>
<tr onclick="window.document.location='Messaging.php?UserID=<?php
echo $user->userid;
?>
';">
示例6: message
<?php
require "classes/message.php";
try {
$email = new message();
//$email = new message("bear-wolf@ukr.net","Новая заявка с сайта 'TopSnab'", trim($_POST["fullName"]), trim($_POST["phone"]),trim($_POST['view']));
$email->to = "bear-wolf@ukr.net";
$email->from = "Новая заявка с сайта 'TopSnab'";
$email->name = trim($_POST["fullName"]);
$email->phone = trim($_POST["phone"]);
$email->description = trim($_POST['view']);
$email->theme = "Content-type: text/plain; charset=\"utf-8\"\n From: {$email->from}";
if ($email->send() > 0) {
echo "Сообщение отправилось успешно";
}
} catch (Exception $e) {
echo "Exception=" . $e;
}
示例7: send
public function send()
{
global $USER, $DB;
$cm = $this->dialogue->cm;
$course = $this->dialogue->course;
$incomplete = (empty($this->_bulkopenrule) and empty($this->_participants) or empty($this->_subject) or empty($this->_body));
if ($incomplete) {
throw new \moodle_exception("Incomplete conversation cannot send!");
}
if (!empty($this->_bulkopenrule)) {
// clearout participants as this is now a template which will be copied
$this->_state = dialogue::STATE_BULK_AUTOMATED;
// update state to bulk automated
$DB->set_field('dialogue_messages', 'state', $this->_state, array('id' => $this->_messageid));
return true;
}
parent::send();
}
示例8: json_encode
<?php
require_once 'message_class.php';
$message = new message();
$error = $message->send($_POST);
if ($error == null) {
$error['Success'] = true;
}
echo json_encode($error);