Deleted deal from users table. Code cleanup.

This commit is contained in:
Igor Barkov [iwork] 2018-11-01 14:25:00 +02:00
parent 38605cf921
commit c69ec70c38

13
ch.php
View File

@ -40,8 +40,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
`o`.`date`,
`u`.`invis`,
(SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`,
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`,
`deal`
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`
FROM
`online` AS `o`,
`users` AS `u`
@ -81,8 +80,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
`o`.`date`,
`u`.`invis`,
(SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`,
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`,
`deal`
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`
FROM
`online` AS `o`,
`users` AS `u`
@ -112,8 +110,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
`o`.`date`,
`u`.`invis`,
(SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`,
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`,
`deal`
(SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`
FROM
`online` AS `o`,
`users` AS `u`
@ -266,7 +263,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
$aa = preg_replace("/sell ", "", $aa);
$act_line = " <span onmouseover=\"fastshow(\'$aa\')\" onmouseout=\"hideshow()\"><b><small>{$act[0]}</small></b></span> ";
} else $act_line = '';
echo 'w(\'', $row['login'], '\',', $row['id'], ',', $in_battle, ',\'', $row['align'], '\',\'' . ClanImage($row['klan']) . '\', \'' . $act_line . '\',\'', $row['level'], '\',\'', $row['slp'], '\',\'', $row['trv'], '\',\'', (int)$row['deal'], '\',\'', $row['login2'], '\');';
echo 'w(\'', $row['login'], '\',', $row['id'], ',', $in_battle, ',\'', $row['align'], '\',\'' . ClanImage($row['klan']) . '\', \'' . $act_line . '\',\'', $row['level'], '\',\'', $row['slp'], '\',\'', $row['trv'], '\',\'', '\',\'', $row['login2'], '\');';
}
}
?>
@ -433,7 +430,7 @@ if (isset($_GET['online']) && $_GET['online'] != null) {
if (strpos($_GET['text'], "private") !== FALSE && $user['level'] < 1) {
preg_match_all("/\[(.*)\]/U", $_GET['text'], $matches);
for ($ii = 0; $ii < count($matches[1]); $ii++) {
$dde = db::c()->query("SELECT `id` FROM `users` WHERE (`deal` = 1 OR (`align`>1 AND `align`<2)) AND `login` = '" . trim($matches[1][$ii]) . "' LIMIT 1 ;")->fetch_assoc();
$dde = db::c()->query("SELECT `id` FROM `users` WHERE ((`align`>1 AND `align`<2)) AND `login` = '" . trim($matches[1][$ii]) . "' LIMIT 1 ;")->fetch_assoc();
if (!$dde['id']) {
exit();
}