2022-06-06 21:30:34 +00:00
|
|
|
<?php
|
2022-12-19 18:26:14 +00:00
|
|
|
|
2022-12-30 19:03:37 +00:00
|
|
|
use Core\Db;
|
2022-12-19 18:26:14 +00:00
|
|
|
|
|
|
|
const GAME = true;
|
2022-06-06 21:30:34 +00:00
|
|
|
include('_incl_data/__config.php');
|
|
|
|
include('_incl_data/class/__db_connect.php');
|
2022-12-19 18:26:14 +00:00
|
|
|
define('IP', UserIp::get());
|
|
|
|
$u = User::start();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
if (isset($_GET['test_login']) || isset($_GET['test_login2'])) {
|
|
|
|
die();
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
if (isset($_GET['chat'])) {
|
|
|
|
$sp2 = Db::getRows('select * from chat where spam > 0 order by time desc ');
|
|
|
|
foreach ($sp2 as $row) {
|
|
|
|
echo date('d.m.Y H:i', $row['time']) . ' <b>' . $row['login'] . '</b>: ' . $row['text'] . '<hr>';
|
|
|
|
}
|
|
|
|
die();
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
if (!$u->info['admin']) {
|
2023-01-10 16:29:32 +00:00
|
|
|
die('Спамер? :)');
|
2022-12-19 18:26:14 +00:00
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
?>
|
2022-12-19 18:26:14 +00:00
|
|
|
|
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html lang="ru">
|
2022-06-06 21:30:34 +00:00
|
|
|
<head>
|
2023-01-10 16:29:32 +00:00
|
|
|
<title>Редактирование фильтра от спама</title>
|
2023-01-10 17:26:14 +00:00
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
2023-03-31 18:30:14 +00:00
|
|
|
<link href="//img.new-combats.tech/css/main.css" rel="stylesheet" type="text/css">
|
2022-12-19 18:26:14 +00:00
|
|
|
<script type="text/javascript" src="js/jquery.1.11.js"></script>
|
|
|
|
<body style="padding-top:0; margin-top:7px; height:100%; background-color:#dedede;">
|
2023-01-10 16:29:32 +00:00
|
|
|
<strong>Список запрещенных слов\ссылок:</strong>
|
|
|
|
<input onClick="location.href='/spam.php';" type="button" value="Обновить"><br><br>
|
2022-12-19 18:26:14 +00:00
|
|
|
<?php
|
|
|
|
$spam = Db::getValue('select data from spam_word where id = 1');
|
|
|
|
$spam = explode('|', $spam);
|
2022-06-06 21:30:34 +00:00
|
|
|
//
|
2022-12-19 18:26:14 +00:00
|
|
|
if (isset($_GET['del'])) {
|
2023-01-10 16:29:32 +00:00
|
|
|
echo '<div style="color: red;">Слово "<b>' . $spam[floor(
|
2022-12-19 18:26:14 +00:00
|
|
|
(int)$_GET['del']
|
2023-01-10 16:29:32 +00:00
|
|
|
)] . '</b>" удалено.<br><br></div>';
|
2022-12-19 18:26:14 +00:00
|
|
|
unset($spam[floor((int)$_GET['del'])]);
|
|
|
|
$spam = implode('|', $spam);
|
|
|
|
Db::sql('replace into spam_word set id = 1, data = ?', [$spam]);
|
|
|
|
$spam = explode('|', $spam);
|
|
|
|
} elseif (isset($_POST['add'])) {
|
2023-01-10 17:26:14 +00:00
|
|
|
$_POST['add'] = htmlspecialchars($_POST['add'], null);
|
2023-01-10 16:29:32 +00:00
|
|
|
echo '<div style="color: green">Слово "<b>' . $_POST['add'] . '</b>" добавлено.<br><br></div>';
|
2022-12-19 18:26:14 +00:00
|
|
|
$spam = implode('|', $spam);
|
|
|
|
$spam .= '|' . $_POST['add'];
|
|
|
|
Db::sql('replace into spam_word set id = 1, data = ?', [$spam]);
|
|
|
|
$spam = explode('|', $spam);
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
2022-12-19 18:26:14 +00:00
|
|
|
if (is_array($spam)) {
|
|
|
|
$i = 0;
|
|
|
|
while ($i < count($spam)) {
|
|
|
|
echo $spam[$i] . ' <a href="/spam.php?del=' . $i . '"><span style="color: red">x</span></a><hr>';
|
|
|
|
$i++;
|
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
?>
|
2022-12-19 18:26:14 +00:00
|
|
|
<form method="post">
|
|
|
|
<label>
|
|
|
|
<input type="text" name="add" value="" style="width:244px;">
|
2023-01-10 16:29:32 +00:00
|
|
|
</label> <input type="submit" value="Добавить">
|
2022-06-06 21:30:34 +00:00
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|