Telegraph to chat on-login

This commit is contained in:
Igor Barkov [iwork]
2019-02-12 16:40:53 +02:00
parent 4f2bc7b130
commit 55813f6781
3 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -46,9 +46,9 @@ if ($username && $password) {
$ip = $_SERVER['REMOTE_ADDR'];
db::c()->query('INSERT INTO `iplog` (`owner`, `ip`, `date`) VALUES (?i, "?s", ?i)', $data['id'], $ip, time());
$rs = db::c()->query('SELECT * FROM `telegraph` WHERE `receiver` = ?i', $data['id']);
while ($res = $rs->fetch_assoc()) {
addchp($res['text'], '{[]}' . $data['login'] . '{[]}');
$sms = db::c()->query('SELECT * FROM `telegraph` WHERE `receiver` = ?i', $data['id']);
while ($res = $sms->fetch_assoc()) {
db::c()->query('INSERT INTO `chat` (`uid`, `msg`, `type`) VALUES (?i, "?s", "?s")', $uid, $msg, 'sms');
}
db::c()->query('DELETE FROM `telegraph` WHERE `receiver` = ?i', $data['id']);
header("Location: fight.php");