2023-03-31 18:42:06 +00:00
|
|
|
|
<?php
|
2023-12-02 01:00:05 +00:00
|
|
|
|
if (!defined('GAME')) {
|
|
|
|
|
die();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-01-28 02:24:37 +00:00
|
|
|
|
|
2023-12-02 01:00:05 +00:00
|
|
|
|
if ($p['sm2'] != 1 && $p['citysm2'] != 1 && $p['citysm1'] != 1 && $p['sm1'] != 1) {
|
|
|
|
|
$uer = 'У Вас нет прав на использование данного заклятия';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tm = (int)$_POST['time'];
|
|
|
|
|
if ($tm != 1 && $tm != 2 && $tm != 3) { // 1 чат 2 форум 3 чат+форум
|
|
|
|
|
//todo избавиться от этого блядства.
|
|
|
|
|
$uer = 'Неверно указаны данные';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$uu = \Core\Db::getRow('select id, login, molch1, molch2 from users where login = ? order by id limit 1', [$_POST['logingo']]);
|
|
|
|
|
|
|
|
|
|
if (!isset($uu['id'])) {
|
|
|
|
|
$uer = 'Персонаж не найден в этом городе';
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-01-28 02:24:37 +00:00
|
|
|
|
|
|
|
|
|
$cmsg = new ChatMessage();
|
|
|
|
|
$cmsg->setRoom($u->info['room']);
|
|
|
|
|
$cmsg->setType(6);
|
|
|
|
|
$cmsg->setTypeTime(1);
|
2023-12-02 01:00:05 +00:00
|
|
|
|
|
|
|
|
|
if ($tm != 2 && $uu['molch1'] >= time()) {
|
|
|
|
|
(new \Moderation\Moderation($uu['id']))->unsilence();
|
|
|
|
|
$uer = "С персонажа {$uu['login']} снят запрет на общение в чате.";
|
|
|
|
|
$cmsg->setText("[img[items/pal_button3.gif]] $uer");
|
|
|
|
|
(new Chat())->sendMsg($cmsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($tm != 1 && $uu['molch2'] >= time()) {
|
|
|
|
|
\Core\Db::sql('update users set molch2 = default where id = ?', [$uu['id']]);
|
|
|
|
|
$uer = "С персонажа {$uu['login']} снят запрет на общение на форуме.";
|
|
|
|
|
$cmsg->setText("[img[items/fsleep_off.gif]] $uer");
|
|
|
|
|
(new Chat())->sendMsg($cmsg);
|
|
|
|
|
}
|