From 92772463e6694fbce8686db0c518b09d87967135 Mon Sep 17 00:00:00 2001 From: Ivor Barhansky Date: Wed, 19 Jul 2023 15:36:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D1=82=D1=83=D1=80=D0=B0=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D1=81=D0=BE=20?= =?UTF-8?q?=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA=D0=BE=D0=B9=20=D0=BA=D0=BB?= =?UTF-8?q?=D0=B0=D0=BD=D1=8B.=20#54.=20Closes=20#56.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _incl_data/__config.php | 4 +- _incl_data/autoload.php | 1 + _incl_data/class/Clan/ClanInfo.php | 13 + _incl_data/class/Clan/ItemStorage.php | 34 +-- _incl_data/class/Clan/Register.php | 136 ++++++++++ _incl_data/class/Core/Db.php | 12 +- _incl_data/class/Images.php | 27 ++ _incl_data/class/Uploader.php | 57 ++-- _incl_data/class/User.php | 43 +-- _incl_data/class/User/Clan.php | 90 ++++++ _incl_data/crons/undone/clear.php | 1 - buttons.php | 45 +-- cron/clear.php | 1 - js/onlineList.js | 100 +++---- main.php | 2 +- modules_data/_clan.php | 293 ++++++++++++-------- modules_data/_locations.php | 2 +- modules_data/_mod.php | 13 +- modules_data/location/a_clanreg.php | 27 +- modules_data/location/cp1.php | 10 - modules_data/location/cp2.php | 376 +++++++++++++------------- online.php | 79 +++--- 22 files changed, 844 insertions(+), 522 deletions(-) create mode 100644 _incl_data/class/Clan/ClanInfo.php create mode 100644 _incl_data/class/Clan/Register.php create mode 100644 _incl_data/class/Images.php create mode 100644 _incl_data/class/User/Clan.php diff --git a/_incl_data/__config.php b/_incl_data/__config.php index 065cadeb..f03fe1d4 100644 --- a/_incl_data/__config.php +++ b/_incl_data/__config.php @@ -3,8 +3,8 @@ use Core\Config; use Insallah\Tournaments\Tournament; -error_reporting(E_ALL ^ E_NOTICE); -ini_set('display_errors', 'Off'); +//error_reporting(E_ALL); + date_default_timezone_set('Europe/Moscow'); header('Cache-Control: no-cache, no-store, must-revalidate'); diff --git a/_incl_data/autoload.php b/_incl_data/autoload.php index 9a639dfb..c11d54e9 100644 --- a/_incl_data/autoload.php +++ b/_incl_data/autoload.php @@ -1,5 +1,6 @@ 0; + } +} diff --git a/_incl_data/class/Clan/ItemStorage.php b/_incl_data/class/Clan/ItemStorage.php index 1984da6c..22925716 100644 --- a/_incl_data/class/Clan/ItemStorage.php +++ b/_incl_data/class/Clan/ItemStorage.php @@ -14,7 +14,7 @@ class ItemStorage private function isGoodForStorage(array $item, $userClanId): bool { if (empty($item['inslot']) || !empty($item['gift'])) { - $this->error = ' .'; + $this->error = 'Предмет не найден.'; } $idata = ConversionHelper::dataStringToArray($item['data']); if ( @@ -23,10 +23,10 @@ class ItemStorage !empty($idata['icos']) || !empty($idata['fromlaba']) ) { - $this->error = ' .'; + $this->error = 'Предмет не подходит.'; } if (!empty($idata['toclan']) && explode('#', $idata['toclan'])[0] == $userClanId) { - $this->error = ' .'; + $this->error = 'Предмет уже принадлежит клану.'; } return empty($this->error); } @@ -37,7 +37,7 @@ class ItemStorage $item = ItemsModel::getOwnedItemById($itemId, $user['id']); $clanName = Db::getValue('select name from clan where id = ?', [$clanId]) ?? ''; if (empty($clanName)) { - return ' .'; + return 'Клан не найден.'; } if (!$this->isGoodForStorage($item, $user['clan'])) { return $this->error; @@ -50,7 +50,7 @@ class ItemStorage User::start()->addDelo( 2, $user['id'], - '"System.transfer.MONEY": "' . $item['name'] . '" (#id : "' . $itemId . '") (x' . $col . ') "' . $clanName . '" (' . $clanId . ').', + '"System.transfer.MONEY": Предмет "' . $item['name'] . '" (#id : "' . $itemId . '") (x' . $col . ') был пожертвован клану "' . $clanName . '" (' . $clanId . ').', time(), $user['city'], 'System.transfer.clan', @@ -63,14 +63,14 @@ class ItemStorage } Db::sql( 'insert into clan_operations (clan, time, type, text, val, uid) values (?,unix_timestamp(),?,?,?,?)', - [$clanId, $sendType, $user['login'], $item['name'] . ("x$col : [$itemId]"), $user['id']] + [$clanId, $sendType, $user['login'], $item['name'] . ("x$col Ид: [$itemId]"), $user['id']] ); Db::sql( 'update items_users set lastUPD = unix_timestamp(), uid = ?, data = ? where id = ?', ['-21' . $user['clan'], $item['data'], $itemId] ); - return ' "' . $item['name'] . '" .'; + return 'Вы передали предмет "' . $item['name'] . '" клану.'; } @@ -86,7 +86,7 @@ class ItemStorage mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "' . $itm_['uid'] . '" LIMIT 1') ); if ($user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id'])) { - $r = ' ,
'; + $r = 'Вы не можете изьять данный предмет, он не принадлежит клану
'; } elseif (isset($itm_['id'])) { if ($itm_['inOdet'] != 0) { @@ -94,11 +94,11 @@ class ItemStorage } else { $o = ''; } - $r = ' "' . $itm_['name'] . '"
'; + $r = 'Вы успешно изъяли предмет "' . $itm_['name'] . '"
'; $col = $this->itemsX(((int)$id)); mysql_query( 'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time( - ) . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') : [' . $id . '] | : [' . $itm_['uid'] . ']", "' . $user['id'] . '")' + ) . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")' ); mysql_query( 'UPDATE `items_users` SET `lastUPD` = "' . time( @@ -106,7 +106,7 @@ class ItemStorage ); } else { - $r = ' .
'; + $r = 'Предмет не найден.
'; } return $r; } @@ -129,16 +129,16 @@ class ItemStorage $col = $this->itemsX(((int)$id)); mysql_query( 'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time( - ) . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') : [' . $id . '] : [' . $cls . ']", "' . $user['id'] . '")' + ) . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")' ); mysql_query( 'UPDATE `items_users` SET `lastUPD` = "' . time( ) . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1' ); - $r = ' "' . $itm_['name'] . '"
'; + $r = 'Вы успешно взяли предмет "' . $itm_['name'] . '" из хранилища
'; } else { - $r = ' .
' . $id; + $r = 'Предмет не найден.
' . $id; } return $r; } @@ -172,7 +172,7 @@ class ItemStorage ); mysql_query( 'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time( - ) . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') : [' . $pl['id'] . ']", "' . $user['id'] . '")' + ) . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")' ); } elseif ($pl['uid'] == $user['id']) { $col = $this->itemsX(((int)$pl['id'])); @@ -185,9 +185,9 @@ class ItemStorage ); mysql_query( 'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time( - ) . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') : [' . $pl['id'] . ']", "' . $user['id'] . '")' + ) . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")' ); } } } -} \ No newline at end of file +} diff --git a/_incl_data/class/Clan/Register.php b/_incl_data/class/Clan/Register.php new file mode 100644 index 00000000..1d2c7e8c --- /dev/null +++ b/_incl_data/class/Clan/Register.php @@ -0,0 +1,136 @@ +newClanId; + } + + public function __construct() + { + if (!isset($_POST['newclanname'], $_POST['newclanalign'], $_FILES['newclanlogo'])) { + return; + } + + $this->setName($_POST['newclanname']); + $this->setLogo(); + $this->setAlign(intval($_POST['newclanalign'])); + $this->new(); + } + + private function hasGoodName(): bool + { + return Db::getValue('select count(id) from clan where name = ?', [$this->name]) === 0; + } + + public function new() + { + if (!$this->hasGoodName()) { + return; + } + $imageId = $this->logo->saveToDb(); + if (!$imageId) { + echo $this->logo::$error; + return; + } + Db::sql('insert into clan (name, align, logo) values (?,?,?)', [$this->name, $this->align, $imageId]); + $this->newClanId = Db::lastInsertId(); + } + + public static function approve(int $clanId) + { + Db::sql('update clan set status = 1, time_reg = unix_timestamp() where id = ?', [$clanId]); + } + + public static function reject(int $clanId) + { + Db::sql('delete from clan where id = ?', [$clanId]); + } + + public static function printForm(): string + { + $img = Config::img() . '/i/align'; + return << + div.regclangrid [type=radio] { + position: absolute; + opacity: 0; + width: 0; + height: 0; + } + + /* IMAGE STYLES */ + div.regclangrid [type=radio] + img { + cursor: pointer; + } + + /* CHECKED STYLES */ + div.regclangrid [type=radio]:checked + img { + outline: 1px solid brown; + padding: 2px; + } + + div.regclangrid { + display: grid; + grid-template-columns: 100px auto; + } + +
+
+
+
+
+
размер: 24×15, формат: png или gif, до 30Кб
+
Склонность:
+
+ + + + +
+
+
+
+ +
+ REGISTERFORM; + } + + private function setName(string $name) + { + $this->name = $name; + } + + private function setAlign(int $align) + { + if (!in_array($align, [0, 1, 3, 7])) { + $align = 0; + } + $this->align = $align; + } + + private function setLogo() + { + $this->logo = new Uploader('newclanlogo'); + $this->logo->setMaxFileSize(.03); + $this->logo->setDimensions(24, 15); + $this->logo->setExtentions(['gif', 'png']); + } + +} diff --git a/_incl_data/class/Core/Db.php b/_incl_data/class/Core/Db.php index c8ce4ba7..d1078f8f 100644 --- a/_incl_data/class/Core/Db.php +++ b/_incl_data/class/Core/Db.php @@ -2,7 +2,6 @@ namespace Core; -use Exception; use PDO; use PDOException; use PDOStatement; @@ -15,14 +14,14 @@ class Db /** * DB constructor. - * @throws Exception + * @throws PDOException */ public function __construct() { try { self::$db = Database::pdoinit(); } catch (PDOException $e) { - throw new Exception($e->getMessage()); + throw new PDOException($e->getMessage()); } } @@ -55,19 +54,20 @@ class Db * @param string $query * @return int */ - static public function exec(string $query): int + public static function exec(string $query): int { self::init(); return self::$db->exec($query); } /** + * @param ?string $name [optional] Name of the sequence object from which the ID should be returned. * @return string */ - static public function lastInsertId(): string + public static function lastInsertId(?string $name = null): string { self::init(); - return self::$db->lastInsertId(); + return self::$db->lastInsertId($name); } /** diff --git a/_incl_data/class/Images.php b/_incl_data/class/Images.php new file mode 100644 index 00000000..9c386eb9 --- /dev/null +++ b/_incl_data/class/Images.php @@ -0,0 +1,27 @@ +customName = $customName; + } + + public function __construct($name) { if (!isset($_FILES[$name])) { return; } - $this->FILE = $_FILES[$name]; - $this->cnm = $cnm; + $this->file = $_FILES[$name]; } /** - * @param int $max + * @param int $max * @param int|null $min * @return void */ @@ -40,7 +50,7 @@ class Uploader } /** - * @param int $max + * @param int $max * @param int|null $min * @return void */ @@ -98,7 +108,7 @@ class Uploader private function hasNormalDimensions(): bool { - [$width, $height] = getimagesize($this->FILE['tmp_name']); + [$width, $height] = getimagesize($this->file['tmp_name']); if (!$width || !$height) { self::$error = 'Не подтянулись размеры файла.'; return false; @@ -123,7 +133,7 @@ class Uploader if (!$this->maxFileSizeMb) { $this->setMaxFileSize(2); } - if ($this->FILE['size'] > $this->maxFileSizeMb * (1024 * 1024) || $this->FILE['size'] <= 0) { + if ($this->file['size'] > $this->maxFileSizeMb * (1024 * 1024) || $this->file['size'] <= 0) { self::$error = 'Неверный размер файла. Максимальный размер файла ' . $this->maxFileSizeMb . ' МБ'; return false; } @@ -133,8 +143,8 @@ class Uploader private function hasNormalType(): bool { if ( - !preg_match('/\.(' . $this->extensions . ')$/i', $this->FILE['name'], $this->extMatches) || - !preg_match('/image/i', $this->FILE['type']) + !preg_match('/\.(' . $this->extensions . ')$/i', $this->file['name'], $this->extMatches) || + !preg_match('/image/i', $this->file['type']) ) { self::$error = 'Неверный тип файла. Допустимые типы : ' . $this->extensions; return false; @@ -156,17 +166,25 @@ class Uploader $this->extMatches[1] = strtolower($this->extMatches[1]); $fn = uniqid('f_', true) . '.' . $this->extMatches[1]; $fn2 = uniqid('f_', true) . '.gif'; - if ($this->cnm) { - $fn = $this->cnm; - $fn2 = $this->cnm; + if ($this->customName) { + $fn = $this->customName . '.' . pathinfo($this->file['name'], PATHINFO_EXTENSION); + $fn2 = $this->customName; } - if (!move_uploaded_file($this->FILE['tmp_name'], $this->savePath . $fn)) { + if (!move_uploaded_file($this->file['tmp_name'], $this->savePath . $fn)) { self::$error = 'Ошибка загрузки файла'; return false; } + var_dump([$fn2, $fn, $this->savePath . $fn]); return [$fn2, $fn, $this->savePath . $fn]; } + private function uploadToDatabase(): int + { + $id = time(); + Db::sql('insert into images (mime_type, img, id) VALUES (?,?,?)', [$this->file['type'], file_get_contents($this->file['tmp_name']), $id]); + return $id; + } + public function saveimg() { return $this->hasNormalFilePath() && @@ -174,4 +192,11 @@ class Uploader $this->hasNormalFileSize() && $this->hasNormalType() ? $this->upload() : false; } -} \ No newline at end of file + + public function saveToDb() + { + return $this->hasNormalDimensions() && + $this->hasNormalFileSize() && + $this->hasNormalType() ? $this->uploadToDatabase() : false; + } +} diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index a73c04e1..8e81de95 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -1276,18 +1276,19 @@ class User return $plid; } - public function microLogin2(array $userInfo): string + private function microLogin2(array $userInfo): string { $result = ''; if ($userInfo['align'] > 0) { $result .= ''; } if ($userInfo['clan'] > 0) { - $clanName = Db::getValue('select name_mini from clan where id = ?', [$userInfo['clan']]); - $result .= ''; + $result .= ''. $userInfo['clanName'] .''; } $result .= '' . $userInfo['login'] . '[' . $userInfo['level'] . ']'; - $result .= ''; + if ($userInfo['login'] !== 'невидимка') { + $result .= ''; + } return $result; } @@ -1298,33 +1299,17 @@ class User } else { $inf = Db::getRow( 'select - users.id, - invis, - users.align, - align2, - clan, - cityreg, - login, - users.level, - c.name_mini - from users left join clan as c on c.id = users.clan - where users.id = ?', - [$id] + users.id, + if(invis = 1 or invis < unix_timestamp(), login, ?) as login, + if(invis = 1 or invis < unix_timestamp(), users.align, 0) as align, + if(status > 0, clan, 0) as clan, + if(invis = 1 or invis < unix_timestamp(), users.level, ?) as level, + if(status > 0, clan.name, ?) as clanName + from users left join clan on clan.id = users.clan and status > 0 where users.id = ?', + ['невидимка', '??', '', $id] ); } - $r = ''; - if ( - isset($inf['id']) && - ( - ($inf['invis'] < time() && $inf['invis'] !== 1) || - ($this->info['id'] == $inf['id'] && $nnz === 1) - ) - ) { - $r = $this->microLogin2($inf); - } else { - $r = 'Невидимка [??]'; - } - return $r; + return isset($inf['id']) ? $this->microLogin2($inf) : ''; } public function testHome(): array diff --git a/_incl_data/class/User/Clan.php b/_incl_data/class/User/Clan.php new file mode 100644 index 00000000..8d2ec87c --- /dev/null +++ b/_incl_data/class/User/Clan.php @@ -0,0 +1,90 @@ +userid = $userinfo['id']; + if (isset($_POST['joinclan']) && ClanInfo::isJoinable($_POST['joinclan'])) { + $this->join($_POST['joinclan']); + exit(''); + } + $c = Db::getRow('select * from clan where id = ?', [$userinfo['clan']]); + if (!empty($c)) { + foreach ($c as $k => $v) { + $this->$k = $v; + } + } + } + + private function join(string $clanname) + { + Db::sql('update users set clan = (select id from clan where clan.name = ?) where id = ?', [$clanname, $this->userid]); + } + + public function getId(): int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function getAlign(): ?int + { + return $this->align; + } + + public function printLogoImage(): string + { + return ''; + } + + public function getStatus(): ?int + { + return $this->status; + } + + public function printClan() + { + echo 'Склонность' . $this->printLogoImage() . $this->getName(); + } + + public function getLogo(): ?int + { + return $this->logo; + } + + /** + * Клан зарегистрирован и подверждён. + * @return bool + */ + public function isRegistered(): bool + { + return !empty($this->id) && $this->status !== 0; + } + + /** + * Клан зарегистрирован и ожидает подтверждения. + * @return bool + */ + public function isAwaitingConfirmation(): bool + { + return !empty($this->id) && $this->status === 0; + } +} diff --git a/_incl_data/crons/undone/clear.php b/_incl_data/crons/undone/clear.php index d65c657a..ae9c76b0 100644 --- a/_incl_data/crons/undone/clear.php +++ b/_incl_data/crons/undone/clear.php @@ -91,7 +91,6 @@ function delete_user_all( $uid , $login ) { mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$uid.'" OR `login` = "'.$login.'"'); mysql_query('DELETE FROM `online` WHERE `uid` = "'.$uid.'"'); mysql_query('DELETE FROM `pirogi` WHERE `uid` = "'.$uid.'"'); - mysql_query('DELETE FROM `post` WHERE `uid` = "'.$uid.'"'); mysql_query('DELETE FROM `reimage` WHERE `uid` = "'.$uid.'"'); mysql_query('DELETE FROM `rep` WHERE `uid` = "'.$uid.'"'); mysql_query('DELETE FROM `repass` WHERE `uid` = "'.$uid.'"'); diff --git a/buttons.php b/buttons.php index 4197a210..ba97fb8f 100644 --- a/buttons.php +++ b/buttons.php @@ -32,6 +32,9 @@ $u = User::start(); $filter = new Filter(); $chat = new Chat(); +$userclan = new \User\Clan($u->info); + + ini_set('max_execution_time', '120'); if (isset($_GET['showcode'])) { @@ -58,6 +61,15 @@ if ($u->info['online'] < time() - 60) { $u->stats = $u->getStats($u->info['id'], 0); +if (!isset($_COOKIE['d1c'])) { + $detect = new MobileDetect; + $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer'; + $_COOKIE['d1c'] = $deviceType; + setcookie('d1c', $deviceType, (time() + 86400)); +} else { + $deviceType = $_COOKIE['d1c']; +} + ?> @@ -73,6 +85,8 @@ $u->stats = $u->getStats($u->info['id'], 0); - - isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer'; - $_COOKIE['d1c'] = $deviceType; - setcookie('d1c', $deviceType, (time() + 86400)); - } else { - $deviceType = $_COOKIE['d1c']; - } - - if ($deviceType == 'tablet' || $deviceType == 'phone'): ?> + - +
+ + +
- - + +isAwaitingConfirmation()) { + exit('
Заявка на регистрацию клана '. $userclan->printClan() .' в процессе рассмотрения.
'); +} + +if (!isset($res['id'])) { + $clans = Db::getRows('select name, align, level from clan where status = 1 order by align, level desc, name'); + ?> + +
+ + +
+
Вы можете вступить в один из существующих кланов, либо же создать свой.
+
+

Заявка на регистрацию клана

+
    +
  • При подаче заявки с вас снимается сумма необходимая для регистрации клана.
  • +
  • В случаи отказа в регистрации клана (по любой причине), еврокредиты возвращаются персонажу.
  • +
  • Администрация вправе отказать в регистрации без объяснения причин.
  • +
  • При регистрации клана, глава клана в течении 60 дней не имеет право передавать своё главенство другому игроку.
  • +
  • Стоимость регистрации клана: екр.
  • +
+
+ $u->info['money2']): ?> + × У вас недостаточно еврокредитов! В наличии: info['money2'] ?> екр. + + + +
+ Дописать сам факт регистрации. +
+
+

Заявка на вступление в клан

+
+ +
+ + +
+ Дописать логотип и, собственно, вступление. +
+ + info['clan_prava'] != 'glava') { if (isset($_GET['clan_exit']) && $u->newAct($_GET['sd4']) == true) { if ($u->info['money'] >= 50) { $txt = 'Игрок ' . $u->info['login'] . '[' . $u->info['level'] . '] покинул клан. (50 кр.)'; mysql_query( - 'INSERT INTO `clan_news` (`clan`, `time`, `ddmmyyyy`, `uid`, `ip`, `login`, `title`, `text`) VALUES ("' . $res['id'] . '", "' . time( - ) . '", "' . date( + 'INSERT INTO `clan_news` (`clan`, `time`, `ddmmyyyy`, `uid`, `ip`, `login`, `title`, `text`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . date( 'd.m.Y' ) . '", "0", "127.0.0.1", "Администрация", "Клановое сообщение", "' . mysql_real_escape_string( $txt @@ -446,8 +544,7 @@ if ($u->info['clan_prava'] != 'glava') { ); } else { mysql_query( - 'UPDATE `users` SET `palpro` = 0, `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "' . time( - ) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + 'UPDATE `users` SET `palpro` = 0, `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); } $ar = $u->rem_itm_cl($u->info, $res['id'], 7); @@ -577,8 +674,7 @@ if ($u->info['clan_prava'] != 'glava') { if (isset($_GET['add'], $_POST['textadd']) && $tt[2][0] == 1) { $lmsg = mysql_fetch_array( mysql_query( - 'SELECT `id` FROM `clan_news` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > ' . (time( - ) - 10) . ' LIMIT 1' + 'SELECT `id` FROM `clan_news` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > ' . (time() - 10) . ' LIMIT 1' ) ); if (isset($lmsg['id'])) { @@ -859,7 +955,7 @@ if ($u->info['clan_prava'] != 'glava') { $c_pr = [ 100, //принять 50, //выгнать - 100 //сменить главу + 100, //сменить главу ]; if (isset($_POST['svb_canals']) && $tt[11][0] == 1) { @@ -911,8 +1007,7 @@ if ($u->info['clan_prava'] != 'glava') { ) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time( - ) . '","1","' . $u->info['login'] . '","' . mysql_real_escape_string( + 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","1","' . $u->info['login'] . '","' . mysql_real_escape_string( $mn ) . '","' . $u->info['id'] . '")' ); @@ -939,8 +1034,7 @@ if ($u->info['clan_prava'] != 'glava') { ) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time( - ) . '","3","' . $u->info['login'] . '","' . (mysql_real_escape_string( + 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . (mysql_real_escape_string( $mn ) * -1) . '","' . $u->info['id'] . '")' ); @@ -969,8 +1063,7 @@ if ($u->info['clan_prava'] != 'glava') { ) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time( - ) . '","2","' . $u->info['login'] . '","' . mysql_real_escape_string( + 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","2","' . $u->info['login'] . '","' . mysql_real_escape_string( $mn ) . '","' . $u->info['id'] . '")' ); @@ -1007,8 +1100,7 @@ if ($u->info['clan_prava'] != 'glava') { ) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time( - ) . '","3","' . $u->info['login'] . '","' . mysql_real_escape_string( + 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . mysql_real_escape_string( $mn ) . '","' . $u->info['id'] . '")' ); @@ -1041,8 +1133,7 @@ if ($u->info['clan_prava'] != 'glava') { ); } else { mysql_query( - 'UPDATE `users` SET `palpro` = 0, `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "' . time( - ) . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1' + 'UPDATE `users` SET `palpro` = 0, `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "' . time() . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1' ); } $u->info['money'] -= $c_pr[1]; @@ -1589,8 +1680,7 @@ if ($u->info['clan_prava'] != 'glava') { } else { $lwar = mysql_fetch_array( mysql_query( - 'SELECT * FROM `clan_wars` WHERE `time_finish` > ' . time( - ) . ' AND ((`clan1` = "' . $cln['id'] . '" AND `clan2` = "' . $res['id'] . '") OR (`clan2` = "' . $cln['id'] . '" AND `clan1` = "' . $res['id'] . '")) LIMIT 1 ' + 'SELECT * FROM `clan_wars` WHERE `time_finish` > ' . time() . ' AND ((`clan1` = "' . $cln['id'] . '" AND `clan2` = "' . $res['id'] . '") OR (`clan2` = "' . $cln['id'] . '" AND `clan1` = "' . $res['id'] . '")) LIMIT 1 ' ) ); if (!isset($lwar['id'])) { @@ -1609,12 +1699,10 @@ if ($u->info['clan_prava'] != 'glava') { 'UPDATE `clan` SET `money2` = `money2` - ' . $mkr . ' WHERE `id` = "' . $res['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `clan_wars` (`clan1`,`clan2`,`time_start`,`time_finish`,`type`,`text`) VALUES ("' . $res['id'] . '","' . $cln['id'] . '","' . time( - ) . '","' . (time() + 60 * 60 * 24) . '","' . $tpcw . '","Война!")' + 'INSERT INTO `clan_wars` (`clan1`,`clan2`,`time_start`,`time_finish`,`type`,`text`) VALUES ("' . $res['id'] . '","' . $cln['id'] . '","' . time() . '","' . (time() + 60 * 60 * 24) . '","' . $tpcw . '","Война!")' ); mysql_query( - 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time( - ) . '","4","' . $u->info['login'] . '","clanwar_' . $mkr . '_' . $cln['id'] . '","' . $u->info['id'] . '")' + 'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","4","' . $u->info['login'] . '","clanwar_' . $mkr . '_' . $cln['id'] . '","' . $u->info['id'] . '")' ); echo 'Вы успешно обьявили войну клану "' . $cln['name'] . '" за ' . $mkr . ' екр.
'; } @@ -1635,8 +1723,7 @@ if ($u->info['clan_prava'] != 'glava') { "' . time( - ) . '" LIMIT 1' + 'SELECT COUNT(`id`) FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '" LIMIT 1' ) ); $warc = $warc[0]; @@ -1658,8 +1745,7 @@ if ($u->info['clan_prava'] != 'glava') { "' . time( - ) . '"' + 'SELECT * FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '"' ); while ($pl = mysql_fetch_array($sp)) { $cln1 = mysql_fetch_array( @@ -1716,8 +1802,7 @@ if ($u->info['clan_prava'] != 'glava') { ); echo 'Вы успешно подали заявку в союз "' . $cnm['name'] . '"
'; mysql_query( - 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time( - ) . '","1")' + 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","1")' ); } } else { @@ -1751,8 +1836,7 @@ if ($u->info['clan_prava'] != 'glava') { ); echo 'Вы успешно подали заявку в альянс "' . $cnm['name'] . '"
'; mysql_query( - 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time( - ) . '","2")' + 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","2")' ); } } else { @@ -1778,16 +1862,14 @@ if ($u->info['clan_prava'] != 'glava') { ); if (!isset($cnm['id'])) { mysql_query( - 'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time( - ) . '","' . mysql_real_escape_string( + 'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string( $nm ) . '","1","' . $res['id'] . '","' . $res['id'] . '")' ); $id = mysql_insert_id(); $res['join1'] = $id; mysql_query( - 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time( - ) . '","1","' . time() . '")' + 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","1","' . time() . '")' ); mysql_query( 'UPDATE `clan` SET `join1` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1' @@ -1818,16 +1900,14 @@ if ($u->info['clan_prava'] != 'glava') { ); if (!isset($cnm['id'])) { mysql_query( - 'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time( - ) . '","' . mysql_real_escape_string( + 'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string( $nm ) . '","2","' . $res['id'] . '","' . $res['id'] . '")' ); $id = mysql_insert_id(); $res['join2'] = $id; mysql_query( - 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time( - ) . '","2","' . time() . '")' + 'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","2","' . time() . '")' ); mysql_query( 'UPDATE `clan` SET `join2` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1' @@ -1909,8 +1989,7 @@ if ($u->info['clan_prava'] != 'glava') { ); $rzv = 'Союз ' . $szu['name'] . ' принял клан ' . $zvy['name'] . '.'; mysql_query( - 'UPDATE `clan_join` SET `time_end` = "' . time( - ) . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "1"' + 'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "1"' ); //mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","1")'); mysql_query( @@ -1926,8 +2005,7 @@ if ($u->info['clan_prava'] != 'glava') { ); $rzv = 'Альянс ' . $szu['name'] . ' принял клан ' . $zvy['name'] . '.'; mysql_query( - 'UPDATE `clan_join` SET `time_end` = "' . time( - ) . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "2" AND `time_end` = "0"' + 'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "2" AND `time_end` = "0"' ); //mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","2")'); mysql_query( @@ -1986,8 +2064,7 @@ if ($u->info['clan_prava'] != 'glava') { 'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $res['id'] . '" LIMIT 1' ); mysql_query( - 'UPDATE `clan_join` SET `time_end` = "' . time( - ) . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1' + 'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1' ); echo '
Вы успешно покинули союз "' . $j1['name'] . '"
'; header('location: main.php?clan&diplom'); @@ -2019,8 +2096,7 @@ if ($u->info['clan_prava'] != 'glava') { 'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $dels['id'] . '" LIMIT 1' ); mysql_query( - 'UPDATE `clan_join` SET `time_end` = "' . time( - ) . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1' + 'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1' ); echo '
Клан "' . $delc['name'] . '" был исключен из данного союза
'; header('location: main.php?clan&diplom'); @@ -2256,7 +2332,9 @@ if ($u->info['clan_prava'] != 'glava') { AND `iu`.`id` = "' . mysql_real_escape_string($_GET['ungive_itm']) . '" LIMIT 1' ) ); - $ps = \Core\ConversionHelper::dataStringToArray($itms['data']); + if (isset($itms['data'])) { + $ps = ConversionHelper::dataStringToArray($itms['data']); + } $ps['cl'] = explode('#', $ps['toclan']); $use_s = $ps['cl'][1]; if (isset($_GET['ungive_itm']) && $ps['cl'][0] == $res['id'] && ($tt[14][0] == 1 || ($u->info['id'] == $use_s))) { @@ -2372,8 +2450,7 @@ if ($u->info['clan_prava'] != 'glava') { echo 'Название титула не должно быть пустым
'; } else { mysql_query( - 'INSERT INTO `clan_tituls` (`clan`,`user_add`,`time_add`,`name`) VALUES ("' . $res['id'] . '","' . $u->info['id'] . '","' . time( - ) . '","' . mysql_real_escape_string($nm) . '")' + 'INSERT INTO `clan_tituls` (`clan`,`user_add`,`time_add`,`name`) VALUES ("' . $res['id'] . '","' . $u->info['id'] . '","' . time() . '","' . mysql_real_escape_string($nm) . '")' ); echo 'Титул был успешно добавлен
'; } @@ -2457,9 +2534,7 @@ if ($u->info['clan_prava'] != 'glava') { while ($pl = mysql_fetch_array($sp)) { ?>
- - *   *   info['clan_prava'] != 'glava') { -
\ No newline at end of file + diff --git a/modules_data/_locations.php b/modules_data/_locations.php index 6d61452e..c08a28ec 100644 --- a/modules_data/_locations.php +++ b/modules_data/_locations.php @@ -8,7 +8,7 @@ if (!defined('GAME')) { $re = ''; if (isset($u->error2)) { - $re = $u->error2; + $re = '' . $u->error . ''; } if (isset($_GET['nightatack'])) { diff --git a/modules_data/_mod.php b/modules_data/_mod.php index 252e9bc9..bac40738 100644 --- a/modules_data/_mod.php +++ b/modules_data/_mod.php @@ -1628,10 +1628,6 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) { $cl['name'] ) . '" OR `name_mini` = "' . mysql_real_escape_string( $cl['name2'] - ) . '" OR `name_rus` = "' . mysql_real_escape_string( - $cl['name'] - ) . '" OR `name_rus` = "' . mysql_real_escape_string( - $cl['name2'] ) . '" LIMIT 1' ); if (!isset($pu['id'])) { @@ -1654,9 +1650,7 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) { 'img.new-combats.com/i/clan/' . $cl['name2'] . '.gif' )) { $ins = mysql_query( - 'INSERT INTO `clan` (`name`,`name_rus`,`name_mini`,`site`,`align`,`time_reg`) VALUES ( - "' . $cl['name2'] . '", - "' . $cl['name'] . '", + 'INSERT INTO `clan` (`name`,`site`,`align`,`time_reg`) VALUES ( "' . $cl['name2'] . '", "' . $cl['site'] . '", "' . $cl['align'] . '", @@ -1735,9 +1729,8 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) { $cmsg->setText("К сожалению Вам отказано в регистрации клана "{$cl['name']}". Вам зачисленно 50 екр."); $chat->sendMsg($cmsg); //Отправляем сумму - mysql_query( - 'UPDATE `users` SET `money2` = `money2` + 50 WHERE `id` = "' . $pu['id'] . '" LIMIT 1;' - ); + $u->addEkr(50, $pu['id']); + $txt = 'Возврат за регистрацию клана от Администрации: 50 екр. Зачисленны: ' . date( 'd.m.Y H:i', time() ); diff --git a/modules_data/location/a_clanreg.php b/modules_data/location/a_clanreg.php index bbd489b3..456a4eb9 100644 --- a/modules_data/location/a_clanreg.php +++ b/modules_data/location/a_clanreg.php @@ -177,31 +177,15 @@ if (isset($_POST['clan_name'])) { info['clan'] > 0) { - $clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $u->info['clan'] . '" LIMIT 1')); ?> - Вы уже состоите в клане и не можете подать заявку на регистрацию нового клана.

-
-

Клановые войны

- info['clan_prava'] == 'glava') { - echo 'Нет ни одной войны, но вы можете обьявить её!'; - } else { - echo 'Нет ни одной войны, но ваш глава клана может обьявить её!'; - } - ?> -
+ Вы уже состоите в клане и не можете подать заявку на регистрацию нового клана.

+ -

Требования к значку: размер (ШхВ в пикселях) 24х15, графический тип GIF, размер до 30кб.

+

Требования к значку: размер (ШхВ в пикселях) 24х15, размер до 30кб.

- Стоимость регистрации кланов:
- нейтральный - 50 - екр.
- светлый - 50 - екр.
- тёмный - 50 - екр.
+ Стоимость регистрации кланов: 50 екр.

Заявка на регистрацию подает будущий глава клана, у которого должна быть при себе необходимая сумма. @@ -289,4 +273,5 @@ if ($u->info['clan'] > 0) { При регистрации клана, глава клана в течении 60 дней не имеет право передавать своё главенство другому игроку.

- \ No newline at end of file + + diff --git a/modules_data/location/cp1.php b/modules_data/location/cp1.php index c34faea8..d08b6327 100644 --- a/modules_data/location/cp1.php +++ b/modules_data/location/cp1.php @@ -199,11 +199,6 @@ function timeOut($ttm): string src="//img.new-combats.tech/newyear2014.png" width="60" height="90" title="" class="aFilter"/> -
- - src="//img.new-combats.tech/city/capitalcity/day/2pochta.gif" - width="111" height="72" class="aFilter"/>
@@ -284,11 +279,6 @@ function timeOut($ttm): string href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.14&rnd=';" title="">Вокзал -  Почта
diff --git a/modules_data/location/cp2.php b/modules_data/location/cp2.php index b67dbcd2..dcf1a3b2 100644 --- a/modules_data/location/cp2.php +++ b/modules_data/location/cp2.php @@ -1,203 +1,213 @@ ' . $re . ''; - $tattack = 'Напасть   '; - -if($u->room['file']=='cp2') -{ - if(date("H")>=6 && date("H")<22) { - $now = 'day'; - }else{ - $now = 'night'; - } +if ($u->room['file'] != 'cp2') { + return; +} +if (date("H") >= 6 && date("H") < 22) { + $now = 'day'; +} else { + $now = 'night'; +} ?> - - - - - + = 22): ?> + + + + + + +
+
+ + +
- getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?> -
-
- - - - - -
- '.$re.''; } ?> - - - - -
-
- -
- -
- -
src="//img.new-combats.tech/city/capitalcity/day/euroshop.gif" width="78" height="63" class="aFilter" />
-
src="//img.new-combats.tech/city/capitalcity/day/1ubkill.gif" width="116" height="186" class="aFilter" />
-
src="//img.new-combats.tech/city/capitalcity/day/1ureg.gif" width="106" height="73" class="aFilter" />
-
src="//img.new-combats.tech/city/capitalcity/day/cp_hostel.gif" width="86" height="90" class="aFilter" />
-
src="//img.new-combats.tech/city/capitalcity/day/flower_shop.gif" width="74" height="68" class="aFilter" />
-
src="//img.new-combats.tech/i/images/300x225/capital/2strelka.gif" width="30" height="54" class="aFilter" />
-
src="//img.new-combats.tech/i/images/300x225/capital/3strelka.gif" width="30" height="53" class="aFilter" />
-
- -
-
-=22) -{ -?> - - + +
+ src="/city/capitalcity/day/euroshop.gif" width="78" height="63" class="aFilter" alt=""> +
+
+ src="/city/capitalcity/day/1ubkill.gif" width="116" height="186" class="aFilter" alt=""> +
+
+ src="/city/capitalcity/day/cp_hostel.gif" width="86" height="90" class="aFilter" alt=""> +
+
+ src="/city/capitalcity/day/flower_shop.gif" width="74" height="68" class="aFilter" alt=""> +
+
+ src="/i/images/300x225/capital/2strelka.gif" width="30" height="54" class="aFilter" alt=""> +
+
+ src="//img.new-combats.tech/i/images/300x225/capital/3strelka.gif" width="30" height="53" class="aFilter" alt=""> +
+
+ + - - - - -
- -
- -
- Внимание!Рекомендуем установить функцию второго пароля во вкладке "Безопасность", это обезопасит вашего персонажа от взлома.
- Администрация.

-
- -
- \ No newline at end of file diff --git a/online.php b/online.php index 6549b0d2..0fbe28b3 100644 --- a/online.php +++ b/online.php @@ -689,62 +689,45 @@ $sp = mysql_query( 'SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`,`delete`,`molch`,`da` FROM `chat` WHERE ( ( - `delete` > 0 - AND + `delete` > 0 AND `time` > ' . (time() - 360) . ' - ) - OR + ) OR ( - `time` > ' . (time() - 120) . ' - OR - ( - `time` = -1 - AND - ( - `to` = "' . $u->info['login'] . '" - OR - `type` = 8 - ) - ) - OR - ( - `time` < -1 - AND - `time` > -' . time() . ' - AND - ( - `to` = "' . $u->info['login'] . '" - OR - `type` = 8 - OR - `to` = "" - ) - ) - ) - ) - AND - `new` = "1" - AND - ( - `id` > ' . ((int)$_POST['mid']) . ' - OR - `delete` > 0 - OR - `spam` > 0 - OR + `time` > ' . (time() - 120) . ' OR ( - `time` < 0 - AND - `time` > -' . time() . ' - AND + `time` = -1 AND ( - `to` = "' . $u->info['login'] . '" - OR + `to` = "' . $u->info['login'] . '" OR + `type` = 8 + ) + ) OR + ( + `time` < -1 AND + `time` > -' . time() . ' AND + ( + `to` = "' . $u->info['login'] . '" OR + `type` = 8 OR `to` = "" ) ) ) - ORDER BY `id` ASC' + ) + AND + `new` = "1" AND + ( + `id` > ' . ((int)$_POST['mid']) . ' OR + `delete` > 0 OR + `spam` > 0 OR + ( + `time` < 0 AND + `time` > -' . time() . ' AND + ( + `to` = "' . $u->info['login'] . '" OR + `to` = "" + ) + ) + ) + ORDER BY `id`' ); while ($pl = mysql_fetch_array($sp)) {