From c99e54af1a1cf0e8db53ed5ed3af92c4bfd6fa12 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 10 Mar 2021 23:43:48 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=20?= =?UTF-8?q?=D1=81=D0=BF=D0=B5=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=82=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B8=D0=B7=20=D0=B3=D0=BB?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20=D0=B2=20=D0=B1=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B5=20=D1=83=D0=B7=D0=BA=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Battles/InventoryItem.php | 14 ++-- classes/Battles/Item.php | 9 +-- classes/Battles/UserInfo.php | 107 +++++++++++++++++------------- 3 files changed, 72 insertions(+), 58 deletions(-) diff --git a/classes/Battles/InventoryItem.php b/classes/Battles/InventoryItem.php index 561d3be..9e5d193 100644 --- a/classes/Battles/InventoryItem.php +++ b/classes/Battles/InventoryItem.php @@ -22,12 +22,16 @@ class InventoryItem extends Item public function printImage() { - if (in_array($this->item_type, range(1,12))) { - echo "item_id} title='Надеть'>"; - parent::printImage(); - echo ""; + if (in_array($this->item_type, range(1, 12))) { + echo <<item_id} title='Надеть'> + + +HTML; } else { - parent::printImage(); + echo << +IMG; } } diff --git a/classes/Battles/Item.php b/classes/Battles/Item.php index a60cfa0..c2105e4 100644 --- a/classes/Battles/Item.php +++ b/classes/Battles/Item.php @@ -1,6 +1,6 @@ image}" class="item-wrap-normal" alt=""> -IMG; - } protected function wrap(int $number):string { diff --git a/classes/Battles/UserInfo.php b/classes/Battles/UserInfo.php index 53229a9..ed26067 100644 --- a/classes/Battles/UserInfo.php +++ b/classes/Battles/UserInfo.php @@ -78,31 +78,68 @@ class UserInfo extends UserStats $this->money . '
' . $this->Bank->getMoney(); } - $nameString = ''; - if ($this->align) { - $nameString = sprintf('Склонность', $this->align); + $nameString = null; + $nameString .= $this->align ? "Склонность" : ""; + $nameString .= $this->block ? "$this->login" : "$this->login"; + $nameString .= $this->clan ? "Клан" : ""; + + echo << +
$nameString
+
+
$captions
+
$variables
+
+ +HTML; + } + + /** + * О персонаже для модераторов. + * @return string|null + */ + private function showPrivateData(): ?string + { + if (!$this->watcherIsAdmin || !$this->watcherIsModerator) { + return null; } - if ($this->block) { - $nameString .= '' . $this->login . ''; - } else { - $nameString .= ' ' . $this->login . ' '; + $birthday = date('d.m.Y', strtotime($this->borndate)); + $userLogs = GameLogs::getUserLogs($this->id); + $log = null; + while ($userLogRow = $userLogs->fetchArray(SQLITE3_ASSOC)) { + $log .= sprintf('%s
', date('d.m.Y H:i ', strtotime($userLogRow['date'])) . $userLogRow['text']); } - if ($this->clan) { - $nameString .= sprintf('Клан', $this->clan); - } - echo '
'; - echo '
'; - echo '' . $nameString . ''; - echo '
'; - echo '
'; - echo '
'; - echo $captions; - echo '
'; - echo '
'; - echo $variables; - echo '
'; - echo '
'; - echo '
'; + $adminData = $this->watcherIsAdmin ? $this->showAdminOnlyData() : null; + return << + E-Mail: $this->email
+ ДР Игрока: $birthday
+ IP Регистрации: $this->ip
+ $adminData
+
Личное дело
+ $log +
+ +INFO; + } + + /** + * О персонаже для администраторов. + * @return string|null + */ + private function showAdminOnlyData(): ?string + { + $this->Bank = new Bank($this->id); + $bankMoney = $this->Bank->getMoney(); + return <<id
+ИД Комнаты: $this->room
+Деньги: $this->money
+Деньги в банке: $bankMoney
+Опыт: $this->experience
+Нераспределённые очки: $this->free_stat_points
+INFO; + } private function Info() @@ -110,10 +147,7 @@ class UserInfo extends UserStats echo '