diff --git a/ch.php b/ch.php index 6df2115..6d9a670 100644 --- a/ch.php +++ b/ch.php @@ -483,14 +483,6 @@ if (isset($_GET['online']) && $_GET['online'] != null) { unset($temp); } - #Надо запомнить и дать паладинам возможность затыкать из чата. - /* - if(strstr($_GET['text'], "/afk")) { - $action = 1; - $tmp = str_replace('/afk', '', $_GET['text']); - mysql_query("UPDATE `users` SET `action` = 'afk<>:<>{$tmp}' WHERE `id` = '{$user['id']}' LIMIT 1"); - } - */ unset($tmp); # Упростил тот Адъ и Израиль до одной нормальной строчки, которая вырежет все ссылки. if (!preg_match(GAMEDOMAIN, $_GET['text']) || !preg_match("/imgur.com/", $_GET['text'])) { @@ -501,21 +493,6 @@ if (isset($_GET['online']) && $_GET['online'] != null) { $smiles2 = array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""); preg_match_all("/\[(.*)\]/U", $_GET['text'], $matches); - for ($i = 0; $i < count($matches[1]); $i++) { - $prs = db::c()->query('SELECT `id`, `auto_text`, `login` FROM `users` WHERE `login` = "' . mysql_real_escape_string($matches[1][$i]) . '" LIMIT 1')->fetch_assoc(); - if (isset($prs['id']) && $prs['auto_text'] == 1 && $user['login'] != $prs['login']) { - $txt = db::c()->query('SELECT `text` FROM `auto_text` WHERE `owner` = "' . $prs['id'] . '" LIMIT 1')->fetch_assoc(); - $_GET['text'] = 'private [' . $user['login'] . '] Атоответчик (' . $prs['login'] . '): ' . $txt['text']; - } - #$_GET['text'] = 'private ['.$user['login'].'] '.trim($matches[1][$i]); - } - - $prs = db::c()->query('SELECT `id`, `auto_text`, `login` FROM `users` WHERE `login` = "' . mysql_real_escape_string($math[2]) . '" LIMIT 1')->fetch_assoc(); - if (isset($prs['id']) && $prs['auto_text'] == 1 && $user['login'] != $prs['login']) { - $txt = db::c()->query('SELECT `text` FROM `auto_text` WHERE `owner` = "' . $prs['id'] . '" LIMIT 1')->fetch_assoc(); - $_GET['text'] = 'private [' . $user['login'] . '] Атоответчик (' . $prs['login'] . '): ' . $txt['text']; - #addchp('Автоответчик ('.$prs['login'].'): '.$txt['text'], '{[]}'.$user['login'].'{[]}'); - } $_GET['text'] = preg_replace($smiles, $smiles2, $_GET['text'], 3); $_GET['text'] = tolink($_GET['text']); diff --git a/fight.php b/fight.php index e495025..1c1f29a 100644 --- a/fight.php +++ b/fight.php @@ -155,6 +155,6 @@ include("config.php"); -
+ \ No newline at end of file diff --git a/main.php b/main.php index 853dc82..469188e 100644 --- a/main.php +++ b/main.php @@ -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")); } -$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']) { echo "".auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $user['id']).""; } -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 'Автоответчик отключён.'; - } -} - -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 'Автоответчик включён.'; - } else { - echo 'Автоответчик пуст. Введите текст для ответа.'; - } - } -} - -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 'Новый текст автоотвечика записан.'; - } else { - echo 'Цена установки автоответчика 25 кредитов.'; - } - } else { - echo 'Ваш уровень мал для использования данной функции.'; - } - } else { - echo 'Текст автоответчика должен быть не короче 5 и не длиннее 50 символов.'; - } -} - if($_GET['unset_bank'] == 1) { exit_bank('?error=bank'); }