Старт переноса showinf_pers(); в класс (наконец!_)

This commit is contained in:
lopar 2020-07-04 21:37:01 +03:00
parent 93da7c0177
commit c6729f4a7b

View File

@ -43,6 +43,10 @@ class User
}
}
protected function showItem(array $item) {
echo sprintf('<img src="/i/sh/%s" class="item-wrap-normal tooltip" title="<strong>%s</strong>">', $item['image'], $item['name']);
}
public function showUserInfo() {
$dressed_item = [];
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
@ -62,13 +66,13 @@ class User
Предметы на тушке: <br>
USERINFO;
if (isset($dressed_item[1])) {
echo "В руке — " .$dressed_item[1]['name']."<br>";
$this->showItem($dressed_item[1]);
}
if (isset($dressed_item[2])) {
echo "В другой руке — " .$dressed_item[2]['name']."<br>";
$this->showItem($dressed_item[2]);
}
if (isset($dressed_item[4])) {
echo "На пузе — " .$dressed_item[4]['name']."<br>";
$this->showItem($dressed_item[4]);
}
}