diff --git a/classes/User.php b/classes/User.php index ff7c7e7..b10504f 100644 --- a/classes/User.php +++ b/classes/User.php @@ -65,32 +65,39 @@ EMPTY_SLOT; { $dressed_item = []; $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id); - while ($row = $dressed_items->fetch_assoc()) { - $dressed_item[$row['dressed_slot']] = $row; + $dressed_items_row = $dressed_items->fetch_assoc(); + for ($dressed_items_row['dressed_slot'] = 1; $dressed_items_row['dressed_slot'] <= $dressed_items->getNumRows(); $dressed_items_row['dressed_slot']++) { + $dressed_item[$dressed_items_row['dressed_slot']] = $dressed_items_row ?? 0; } - echo << - align): ?> - Склонность - - block): ?> - {$this->login} - - {$this->login} - - clan): ?> - {$this->clan} - - +// while ($row = $dressed_items->fetch_assoc()) { +// $dressed_item[$row['dressed_slot']] = $row; +// } + echo '
'; + if ($this->align) { + echo sprintf('Склонность', $this->align); + } + if ($this->block) { + echo sprintf('%s', $this->login); + } else { + echo sprintf('%s', $this->login); + } + if ($this->clan) { + echo sprintf('%s', $this->clan, $this->clan); + } + echo '
- добавить здоровье 🤔 + добавить здоровье
- @@ -156,9 +163,9 @@ EMPTY_SLOT; Находится в {$this->getRoomName($this->room)}
USERINFO; -// if (isset($dressed_item[1])) { -// $this->showItem($dressed_item[1]); -// } + if (isset($dressed_item[1])) { + $this->showItem($dressed_item[1]); + } // if (isset($dressed_item[2])) { // $this->showItem($dressed_item[2]); // }
+ '; + + echo <<showItem($dressed_item[1])}