本文整理汇总了PHP中messages_send函数的典型用法代码示例。如果您正苦于以下问题:PHP messages_send函数的具体用法?PHP messages_send怎么用?PHP messages_send使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了messages_send函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ws_pack_send_message
/**
* Post a discussion
*
* @param string $subject Subject of the message
* @param string $message Content of message
* @param int $recipient Recipient GUID
* @param string $sender User GUID
*
* @return SuccessResult|ErrorResult
*/
function ws_pack_send_message($subject, $message, $recipient, $sender)
{
$result = false;
$user = elgg_get_logged_in_user_entity();
$api_application = ws_pack_get_current_api_application();
if (!empty($user) && !empty($api_application)) {
$send_message = messages_send($subject, $message, $recipient, $user->guid);
if ($send_message !== false) {
$result = new SuccessResult($send_message);
}
}
if ($result === false) {
$result = new ErrorResult(elgg_echo("ws_pack:error:notfound"));
}
return $result;
}
示例2: admin_delete_photo
function admin_delete_photo($user_id, $image_id)
{
global $hp_includepath;
require_once $hp_includepath . 'message-functions.php';
deletePhoto($user_id, $image_id);
$title = 'En bild i ditt fotoalbum har tagits bort';
$message = 'Bild nummer ' . intval($image_id + 1) . ' i ditt fotoalbum har raderats av en administratör.' . "\n";
$message .= 'Det kan finnas många anledningar till att en bild tas bort, men oftast beror det på något av följande:' . "\n";
$message .= '* Bilden innehöll rasistisk eller nazistisk propaganda.' . "\n";
$message .= '* Bilden var pornografisk.' . "\n";
$message .= '* Bilden var rent ut sagt äcklig eller vidrig, och kunde verka obehaglig för våra yngre medlemmar.' . "\n";
$message .= '* Bilden var kränkande.' . "\n";
$message .= "\n\n";
$message .= 'Vi som arbetar med hamsterpaj vill göra siten till en så trevlig webbplats som möjligt, därför är behöver vi';
$message .= ' ibland ta bort bilder. Vi hoppas att du förstår varför bilden togs bort och önskar dig en trevlig tid här på hamsterpaj.';
$message .= "\n\n\n" . 'Med vänliga hälsningar, hamsterpaj.net administrations-team.';
messages_send(2348, $user_id, $title, $message);
//log_admin_event('deleted photo', $message , $_SESSION['login']['id'], $user_id, $image_id);
//loggning görs i deletePhoto()
}
示例3: refuse_image
function refuse_image($userid, $validator)
{
if ($userid == 17505 || $userid == 573633 || $userid == 625747 || $userid == 68767) {
die('Man kan inte ta bort denna bild...');
exit;
}
global $hp_path;
$query = 'UPDATE userinfo SET image = "3", image_validator = "' . $validator . '" ';
$query .= ' WHERE userid = "' . $userid . '" LIMIT 1';
mysql_query($query) or die;
if (unlink(PATHS_IMAGES . 'users/full/' . $userid . '.jpg') && unlink(PATHS_IMAGES . 'users/thumb/' . $userid . '.jpg')) {
messages_send(2348, $userid, '', $_POST['message'], 0, 7);
} else {
echo '<script language="javascript">alert("Ett fel uppstod när ' . $userid . '.jpg skulle tas bort!");</script>';
}
admin_report_event($_SESSION['login']['username'], 'Refused avatar', $userid);
log_admin_event('avatar validated', 'denied', $validator, $userid, 0);
//image id not available here
admin_action_count($_SESSION['login']['id'], 'avatar_denied');
}
示例4: post
/**
* {@inheritdoc}
*/
public function post(ParameterBag $params)
{
$reply_to = get_entity($params->guid);
$from = elgg_get_logged_in_user_entity();
$subject = strip_tags($params->subject);
$message = $params->message;
if (elgg_is_active_plugin('hypeInbox')) {
if (!$reply_to instanceof InboxMessage) {
throw new GraphException('Can not instantiate the message');
}
$action = new SendMessage();
$action->entity = $reply_to;
$action->subject = $params->subject;
$action->body = $params->message;
$action->attachment_guids = array();
$action->sender_guid = $from->guid;
$action->recipient_guids = $reply_to->getParticipantGuids();
$attachment_uids = (array) $params->attachment_uids;
foreach ($attachment_uids as $uid) {
$attachment = $this->graph->get($uid);
if ($attachment && $attachment->origin == 'graph' && $attachment->access_id == ACCESS_PRIVATE) {
$action->attachment_guids[] = $attachment->guid;
} else {
hypeGraph()->logger->log("Can not use node {$uid} as attachment. Only resources uploaded via Graph API with private access can be attached.", "ERROR");
}
}
try {
if ($action->validate() !== false) {
$action->execute();
}
$message = $action->entity;
if (!$message) {
throw new Exception(implode(', ', $action->getResult()->getErrors()));
}
} catch (Exception $ex) {
throw new GraphException($ex->getMessage());
}
return array('nodes' => array($message));
} else {
$id = messages_send($subject, $message, $reply_to->fromId, $from->guid, $reply_to->guid);
return array('nodes' => array(get_entity($id)));
}
}
示例5: register_error
$_SESSION['msg_title'] = $title;
$_SESSION['msg_contents'] = $message_contents;
if (empty($send_to)) {
register_error(elgg_echo("messages:user:blank"));
forward("mod/messages/send.php");
}
$user = get_user($send_to);
if (!$user) {
register_error(elgg_echo("messages:user:nonexist"));
forward("mod/messages/send.php");
}
// Make sure the message field, send to field and title are not blank
if (empty($message_contents) || empty($title)) {
register_error(elgg_echo("messages:blank"));
forward("mod/messages/send.php");
}
// Otherwise, 'send' the message
$result = messages_send($title, $message_contents, $send_to, 0, $reply);
// Save 'send' the message
if (!$result) {
register_error(elgg_echo("messages:error"));
forward("mod/messages/send.php");
}
// successful so uncache form values
unset($_SESSION['msg_to']);
unset($_SESSION['msg_title']);
unset($_SESSION['msg_contents']);
// Success message
system_message(elgg_echo("messages:posted"));
// Forward to the users inbox
forward('mod/messages/sent.php');
示例6: message_send
/**
* Web service to send a message
*
* @param string $subject (required)
* @param string $body (required)
* @param int $send_to (required)
* @param int $reply (optional), Default 0
*
* @return Success/Fail
*/
function message_send($subject, $body, $send_to, $reply = 0)
{
$recipient = get_user_by_username($send_to);
$recipient_guid = $recipient->guid;
$result = messages_send($subject, $body, $recipient_guid, 0, $reply);
return $result;
}
示例7: get_input
$original_msg_guid = (int) get_input('original_guid');
elgg_make_sticky_form('messages');
if (empty($recipients)) {
register_error(elgg_echo("messages:user:blank"));
forward("messages/compose");
}
$recipient = (int) elgg_extract(0, $recipients);
if ($recipient == elgg_get_logged_in_user_guid()) {
register_error(elgg_echo("messages:user:self"));
forward("messages/compose");
}
$user = get_user($recipient);
if (!$user) {
register_error(elgg_echo("messages:user:nonexist"));
forward("messages/compose");
}
// Make sure the message field, send to field and title are not blank
if (!$body || !$subject) {
register_error(elgg_echo("messages:blank"));
forward("messages/compose");
}
// Otherwise, 'send' the message
$result = messages_send($subject, $body, $user->guid, 0, $original_msg_guid);
// Save 'send' the message
if (!$result) {
register_error(elgg_echo("messages:error"));
forward("messages/compose");
}
elgg_clear_sticky_form('messages');
system_message(elgg_echo("messages:posted"));
forward('messages/inbox/' . elgg_get_logged_in_user_entity()->username);
示例8: get_input
$message_option = get_input('message_option');
$message = get_input('message');
$event = get_entity($guid);
if (elgg_instanceof($event, 'object', 'event_calendar') && $event->canEdit()) {
$guids = array();
$invitees = event_poll_get_invitees($guid);
if ($message_option == 'all') {
foreach ($invitees as $user) {
$guids[] = $user->guid;
}
} else {
$voted_guids = event_poll_get_voted_guids($guid);
foreach ($invitees as $user) {
if (!in_array($user->guid, voted_guids)) {
$guids[] = $user->guid;
}
}
}
$subject = elgg_echo('event_poll:schedule_message:subject', array($event->title));
$body = $message . "\n\n" . elgg_get_site_url() . 'event_poll/vote/' . $guid;
$sender_guid = elgg_get_logged_in_user_guid();
notify_user($guids, $sender_guid, $subject, $body, array(), 'email');
foreach ($guids as $guid) {
messages_send($subject, $body, $guid, $sender_guid, 0, false, false);
}
system_message(elgg_echo('event_poll:schedule_message:response'));
forward($event->getURL());
} else {
register_error(elgg_echo('event_poll:error_event_poll_edit'));
forward();
}
示例9: register_error
// Make sure the message field, send to field and title are not blank
if (!$body || !$subject) {
register_error(elgg_echo("messages:blank"));
forward("messages/compose");
}
elgg_make_sticky_form('messages');
// Send to collection of friends
if (!empty($collection_guid)) {
$collection = get_members_of_access_collection($collection_guid, false);
foreach ($collection as $member) {
if (!$member->isBanned()) {
$result += messages_send($subject, $body, $member->guid, $from, $reply, true, true);
}
}
}
if (!empty($recipient_guid)) {
$user = get_user($recipient_guid);
if (!$user) {
register_error(elgg_echo("messages:user:nonexist"));
forward("messages/compose");
}
$result = messages_send($subject, $body, $recipient_guid, $from, $reply, true, true);
}
// Save 'send' the message
if (!$result) {
register_error(elgg_echo("messages:error"));
forward("messages/compose");
}
elgg_clear_sticky_form('messages');
system_message(elgg_echo("messages:posted"));
forward('messages/inbox/' . elgg_get_logged_in_user_entity()->username);
示例10: get_user
$user = get_user($user_guid);
}
$trip = get_entity($trip_guid);
elgg_set_page_owner_guid($trip->guid);
if ($user && elgg_instanceof($trip, 'trip')) {
if ($trip->getOwnerGUID() != elgg_get_logged_in_user_guid()) {
system_message(elgg_echo("mytrips:PreOrderCorrect"));
//eliminar de follower
//copio en variable local
$follower = $trip->follower;
//busco posición del user a borrar
$clave = array_search($user->guid, $follower);
//lo borro
unset($follower[$clave]);
//vuelvo a asignar
$trip->follower = $follower;
//añadir en preorder
//copio en variable local
$preorder = $trip->preorder;
//añado al usuario
array_push($preorder, $user->guid);
//vuelvo a copiar el array
$trip->preorder = $preorder;
messages_send(elgg_echo('mytrips:manageOrders:preorderOk:subjet', array($trip->name)), elgg_echo('mytrips:manageOrders:preorderOk:message', array("<a href=\"" . $user->getURL() . "\">" . $user->name . "</a>", "<a href=\"" . $trip->getURL() . "\">" . $trip->name . "</a>")), $trip->owner_guid, 0, $user->guid);
} else {
register_error(elgg_echo("mytrips:cantleave"));
}
} else {
register_error(elgg_echo("mytrips:cantleave"));
}
forward(REFERER);
示例11: event_poll_resend_invitations
function event_poll_resend_invitations($event)
{
$subject = elgg_echo('event_poll:reschedule_subject', array($event->title));
$body = elgg_echo('event_poll:reschedule_body');
$invitees = event_poll_get_invitees($event->guid);
$guids = array();
foreach ($invitees as $invitee) {
$guids[] = $invitee->guid;
}
$sender_guid = elgg_get_logged_in_user_guid();
$body .= "\n\n" . elgg_get_site_url() . 'event_poll/vote/' . $event->guid;
if (is_array($invitees) && count($invitees) > 0) {
// email invitees
notify_user($guids, $sender_guid, $subject, $body, array(), 'email');
foreach ($guids as $guid) {
messages_send($subject, $body, $guid, $sender_guid, 0, false, false);
}
}
return true;
}
示例12: elgg_echo
$trip->summaryPreOrderUserGuid = $summaryPreOrderUserGuid;
$trip->summaryPreOrderTrayecto = $summaryPreOrderTrayecto;
$trip->summaryPreOrderBultos = $summaryPreOrderBultos;
$trip->summaryPreOrderConfirmed = $summaryPreOrderConfirmed;
//Rosana
$linktotrip = "<a href=\"" . $trip->getURL() . "\">" . $trip->name . "</a>";
$trayecto = elgg_echo($trip->trayecto, array(), $user->language);
//El mensaje se traduce segun el receiver.
$linktoforum = "<a href='" . elgg_get_site_url() . "discussion/owner/" . $trip->guid . "'>" . elgg_echo('mytrips:forum', array(), $user->language) . "</a>";
$subject = elgg_echo('mytrips:manageOrders:desconfirmadoOk:subjet', array($trip->name), $user->language);
$owner = $trip->getOwnerGUID();
$owner = get_entity($owner);
$body = elgg_echo('mytrips:manageOrders:desconfirmadoOk:message', array($owner->name, $linktotrip, $trayecto, $trip->aportacionViajero, $linktoforum), $user->language);
//no tengo claro quien es el sender en esta llamada
//Antonio MANDAR A: DE PARTE DE:
messages_send($subject, $body, $userguid, 0, $trip->owner_guid);
/*
$result = messages_send(elgg_echo('mytrips:manageOrders:desconfirmadoOk:subjet',array($trip->name)), elgg_echo('mytrips:manageOrders:desconfirmadoOk:message'), $trip->owner_guid, 0,$user->guid);
if (!$result) {
register_error(elgg_echo("messages:error"));
}
else {
system_message(elgg_echo("messages:posted"));
}*/
/*
if ($user && elgg_instanceof($trip, 'trip')
{
if ($trip->getOwnerGUID() != elgg_get_logged_in_user_guid())
{
if ($trip->leave($user)) {
示例13: strip_tags
* @package ElggMessages
*/
$subject = strip_tags(get_input('subject'));
$body = get_input('body');
$recipient_username = get_input('recipient_username');
elgg_make_sticky_form('messages');
//$reply = get_input('reply',0); // this is the guid of the message replying to
if (!$recipient_username) {
register_error(elgg_echo("messages:user:blank"));
forward("messages/compose");
}
$user = get_user_by_username($recipient_username);
if (!$user) {
register_error(elgg_echo("messages:user:nonexist"));
forward("messages/compose");
}
// Make sure the message field, send to field and title are not blank
if (!$body || !$subject) {
register_error(elgg_echo("messages:blank"));
forward("messages/compose");
}
// Otherwise, 'send' the message
$result = messages_send($subject, $body, $user->guid, 0, $reply);
// Save 'send' the message
if (!$result) {
register_error(elgg_echo("messages:error"));
forward("messages/compose");
}
elgg_clear_sticky_form('messages');
system_message(elgg_echo("messages:posted"));
forward('messages/inbox/' . elgg_get_logged_in_user_entity()->username);
示例14: group_invite_member
function group_invite_member($groupid, $username)
{
global $hp_url;
$query = 'SELECT id FROM login WHERE username = "' . $username . '" LIMIT 1';
$result = mysql_query($query) or die(report_sql_error($query));
if (mysql_num_rows($result) == 0) {
jscript_alert('Personen du ville bjuda in finns inte');
jscript_location($_SERVER['PHP_SELF'] . '?action=goto&groupid=' . $groupid);
exit;
}
$data = mysql_fetch_assoc($result);
$userid = $data['id'];
$selectquery = 'SELECT COUNT(*) AS added FROM groups_members WHERE userid = ' . $userid . ' AND groupid = ' . $groupid;
$result = mysql_query($selectquery) or die(report_sql_error($query));
$data = mysql_fetch_assoc($result);
if ($data['added'] == 0) {
$query = 'SELECT name, owner FROM groups_list WHERE groupid = ' . $groupid;
$result = mysql_query($query) or die(report_sql_error($query));
$data = mysql_fetch_assoc($result);
$groupname = $data['name'];
$owner = $data['owner'];
$url = $hp_url . 'traffa/groups.php?action=invited_member&groupid=' . $groupid . '&userid=' . $userid;
$title = 'Inbjudan att gå med i gruppen: ' . $groupname;
$message = 'Du har blivit inbjuden till gruppen: ' . $groupname . '<br />';
$message .= 'Om du vill gå med i min grupp trycker du bara på länken här nedanför<br />';
$message .= '<a href="' . $url . '">[Bli medlem i gruppen]</a><br />';
$query = 'INSERT INTO groups_members (groupid, userid, approved) VALUES (' . $groupid . ',' . $userid . ', 3)';
mysql_query($query) or die(report_sql_error($query));
messages_send($owner, $userid, $title, $message, $allowhtml = 1);
} else {
jscript_alert("Du kan inte bjuda in denna person");
}
}
示例15: elgg_echo
$body = elgg_echo('mytrips:manageOrders:preorderOk:msgViajero:requestType', array("<a href=\"" . $user->getURL() . "\">" . $user->name . "</a>", elgg_echo($summaryPreOrderTrayecto[$clave]), $aportacionFinal, $bultos));
//al usuario
messages_send($subjet, $body, $user->guid, $trip->owner_guid);
break;
case "2":
//Sólo Maleta
array_push($summaryPreOrderUserGuid, $user->guid);
array_push($summaryPreOrderTrayecto, -1);
array_push($summaryPreOrderBultos, $bultos);
array_push($summaryPreOrderConfirmed, 0);
$body = elgg_echo('mytrips:manageOrders:preorderOk:Maleta', array("<a href=\"" . $user->getURL() . "\">" . $user->name . "</a>", $aportacionFinal, $bultos, "<a href=\"" . $trip->getURL() . "\">" . $trip->name . "</a>"));
//al conductor
messages_send($subjet, $body, $trip->owner_guid, 0, $user->guid);
$body = elgg_echo('mytrips:manageOrders:preorderOk:msgViajero:Maleta', array("<a href=\"" . $user->getURL() . "\">" . $user->name . "</a>", $aportacionFinal, $bultos));
//al usuario
messages_send($subjet, $body, $user->guid, $trip->owner_guid);
break;
}
//messages_send($subject, $body, $recipient_guid, $sender_guid)
$trip->summaryPreOrderUserGuid = $summaryPreOrderUserGuid;
$trip->summaryPreOrderTrayecto = $summaryPreOrderTrayecto;
$trip->summaryPreOrderBultos = $summaryPreOrderBultos;
$trip->summaryPreOrderConfirmed = $summaryPreOrderConfirmed;
system_messages(elgg_echo('mytrips:manageOrders:saved'));
}
forward($trip->getUrl());
//Buscar clave en un array multidimensional
/*function search($array, $key, $value)
{
$results = array();