Add sending private messages without appearing in global chat
This commit is contained in:
parent
89fb2fc69b
commit
0edb67e935
15
privmsgs.php
15
privmsgs.php
@ -3,7 +3,20 @@
|
|||||||
require 'required.php';
|
require 'required.php';
|
||||||
require 'onlyloggedin.php';
|
require 'onlyloggedin.php';
|
||||||
|
|
||||||
if (!is_empty($VARS['markread'])) {
|
/*
|
||||||
|
* Handle everything with private messages.
|
||||||
|
* Figures out what you want based on context.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!is_empty($VARS['msg'])) {
|
||||||
|
if (!is_empty($VARS['to'])) {
|
||||||
|
$touuid = $database->select("players", ['uuid'], ['nickname' => $VARS['to']])[0]['uuid'];
|
||||||
|
$database->insert("private_messages", ["from_uuid" => $_SESSION['uuid'], "to_uuid" => $touuid, "message" => $VARS['msg'], "msg_read" => 0, "#time" => "NOW()"]);
|
||||||
|
sendOK();
|
||||||
|
} else {
|
||||||
|
sendError("Missing required arguments.", true);
|
||||||
|
}
|
||||||
|
} else if (!is_empty($VARS['markread'])) {
|
||||||
if (preg_match("/[0-9]+/", $VARS['markread'])) {
|
if (preg_match("/[0-9]+/", $VARS['markread'])) {
|
||||||
$database->update('private_messages', ['msg_read' => 1], [
|
$database->update('private_messages', ['msg_read' => 1], [
|
||||||
'AND' => [
|
'AND' => [
|
||||||
|
Reference in New Issue
Block a user