game/spam.php

74 lines
2.4 KiB
PHP
Raw Normal View History

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']) {
die('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? :)');
}
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>
2022-12-19 18:26:14 +00:00
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.1.11.js"></script>
<body style="padding-top:0; margin-top:7px; height:100%; background-color:#dedede;">
<strong><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:</strong> &nbsp;
<input onClick="location.href='/spam.php';" type="button" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"><br><br>
<?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'])) {
echo '<div style="color: red;"><3E><><EFBFBD><EFBFBD><EFBFBD> &quot;<b>' . $spam[floor(
(int)$_GET['del']
)] . '</b>&quot; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<br><br></div>';
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'])) {
$_POST['add'] = htmlspecialchars($_POST['add'], null, 'cp1251');
echo '<div style="color: green"><3E><><EFBFBD><EFBFBD><EFBFBD> &quot;<b>' . $_POST['add'] . '</b>&quot; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<br><br></div>';
$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;">
</label> <input type="submit" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
2022-06-06 21:30:34 +00:00
</form>
</body>
</html>