Remove chat auto-respond.

This commit is contained in:
lopar 2018-03-02 14:58:47 +02:00
parent ec4b01e4fc
commit 4aac64916d
3 changed files with 1 additions and 72 deletions

23
ch.php

File diff suppressed because one or more lines are too long

View File

@ -155,6 +155,6 @@ include("config.php");
</script> </script>
<meta content="MSHTML 5.00.2614.3500" name="GENERATOR"/> <meta content="MSHTML 5.00.2614.3500" name="GENERATOR"/>
</head> </head>
<body style="text-align: center;"> <body>
</body> </body>
</html> </html>

View File

@ -13,58 +13,10 @@ if($user['klan']) {
$shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1")); $shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1"));
} }
$var_txt = mysql_fetch_array(mysql_query('SELECT `id`, `text` FROM `auto_text` WHERE `owner` = "'.$user['id'].'" LIMIT 1'));
if(isset($var_txt['id'])) {
$var_txt['text'] = $var_txt['text'];
} else {
$var_txt['text'] = 'Текст не установлен.';
}
if($_POST['bankpsw']) { if($_POST['bankpsw']) {
echo "<b style='color: Red;'>".auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $user['id'])."</b>"; echo "<b style='color: Red;'>".auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $user['id'])."</b>";
} }
if(isset($_POST['off_text'])) {
if($user['auto_text'] == 1) {
$user['auto_text'] = 0;
mysql_query('UPDATE `users` SET `auto_text` = "'.$user['auto_text'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Автоответчик отключён.</b>';
}
}
if(isset($_POST['on_text'])) {
if($user['auto_text'] == 0) {
if(isset($var_txt['id'])) {
$user['auto_text'] = 1;
mysql_query('UPDATE `users` SET `auto_text` = "'.$user['auto_text'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo '<b style=\'color: Red;\'>Автоответчик включён.</b>';
} else {
echo '<b style=\'color: Red;\'>Автоответчик пуст. Введите текст для ответа.</b>';
}
}
}
if(isset($_POST['set_text'])) {
if(strlen($_POST['chat_text']) > 4 && strlen($_POST['chat_text']) <= 50) {
if($user['level'] > 6) {
if($user['money'] >= 25) {
mysql_query('DELETE FROM `auto_text` WHERE `owner` = "'.$user['id'].'" AND `login` = "'.$user['login'].'"');
mysql_query('INSERT INTO `auto_text` (`owner`, `login`, `text`) VALUES ("'.$user['id'].'", "'.$user['login'].'", "'.mysql_real_escape_string($_POST['chat_text']).'")');
$user['money'] -= 25;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$var_txt['text'] = $_POST['chat_text'];
echo '<b style=\'color: Red;\'>Новый текст автоотвечика записан.</b>';
} else {
echo '<b style=\'color: Red;\'>Цена установки автоответчика 25 кредитов.</b>';
}
} else {
echo '<b style=\'color: Red;\'>Ваш уровень мал для использования данной функции.</b>';
}
} else {
echo '<b style=\'color: Red;\'>Текст автоответчика должен быть не короче 5 и не длиннее 50 символов.</b>';
}
}
if($_GET['unset_bank'] == 1) { if($_GET['unset_bank'] == 1) {
exit_bank('?error=bank'); exit_bank('?error=bank');
} }