diff --git a/chat.php b/chat.php index 44f59bc..042e4fc 100644 --- a/chat.php +++ b/chat.php @@ -14,7 +14,7 @@ include_once "config.php"; $msg = filter_input(INPUT_POST,'msg'); $uid = $_SESSION['uid']; -if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); +if ($msg) db::c()->query('INSERT INTO `chat` (`uid`, `msg`) VALUES (?i, "?s")', $uid, $msg); function show_messages() { @@ -29,8 +29,10 @@ FROM `chat` ORDER BY `id` ASC LIMIT 50'); while ($message = $chat->fetch_assoc()) { $d = new DateTime($message['msgdate']); $m = htmlspecialchars($message['msg']); - if ($message['type'] == 'sys') { + if ($message['type'] == 'sys') { /* Системка */ echo sprintf('%s %s', $d->format('H:i'),$m)."
"; + } elseif ($message['type'] == 'sms') { /* Телеграмма */ + echo sprintf('[Телеграмма]: %s %s', $d->format('H:i'),$m)."
"; } else echo sprintf('%s [%s]: %s', $d->format('H:i'),$message['from'],$m)."
"; } } diff --git a/enter.php b/enter.php index a90fe5d..2af375b 100644 --- a/enter.php +++ b/enter.php @@ -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"); diff --git a/i/klan/zamok/klan_img_08h.jpg b/i/klan/zamok/klan_img_08h.jpg deleted file mode 100644 index 56ca99f..0000000 Binary files a/i/klan/zamok/klan_img_08h.jpg and /dev/null differ