System chat from zayavka
This commit is contained in:
+6
-7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user