System chat from zayavka

This commit is contained in:
lopar
2018-11-05 22:54:18 +02:00
parent 073d56fc6b
commit 9d14ff16b3
3 changed files with 24 additions and 15 deletions
+6 -7
View File
@@ -2512,14 +2512,13 @@ function addchp($text, $who, $room = 0)
fclose($fp); //закрытие
}
function AddChatSystem($text)
/**
* @param $msg
* @throws \Krugozor\Database\Mysql\Exception
* Отправка системного сообщения в чат.
*/function AddChatSystem($msg)
{
$fp = fopen("tmp/chat.txt", "a");
flock($fp, LOCK_EX);
fputs($fp, ":[" . time() . "]:[!sys2all!!]:[" . ($text) . "]:[1]\r\n");
fflush($fp);
flock($fp, LOCK_UN);
fclose($fp);
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`,`uid`,`msg`,`type`) VALUES (?i,"?s","?s","?s")', 1, 'System', $msg, 'sys');
}
function err($t)