Старт переноса showinf_pers(); в класс
This commit is contained in:
parent
d1ae47bae2
commit
a2835046a4
@ -44,11 +44,11 @@ class User
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function showUserInfo() {
|
public function showUserInfo() {
|
||||||
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i' AND dressed_slot > 0, $this->id);
|
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
|
||||||
foreach ($dressed_items->fetch_assoc() as $item) {
|
foreach ($dressed_items->fetch_assoc() as $item) {
|
||||||
echo 1;
|
echo 1;
|
||||||
}
|
}
|
||||||
echo <<<USERINFO
|
return <<<USERINFO
|
||||||
Имя {$this->login} <br>
|
Имя {$this->login} <br>
|
||||||
Сила {$this->strength} <br>
|
Сила {$this->strength} <br>
|
||||||
Ловкость {$this->dexterity} <br>
|
Ловкость {$this->dexterity} <br>
|
||||||
|
2
inf.php
2
inf.php
@ -54,7 +54,7 @@ if (empty($user->id)): ?>
|
|||||||
<td style="width: 250px; vertical-align: top;">
|
<td style="width: 250px; vertical-align: top;">
|
||||||
<?php
|
<?php
|
||||||
try {echo showinf_pers($user->id);} catch (Exception $e) {echo "<div class='private'>Ошибка генератора персонажа showinf_pers(): {$e}</div>";}
|
try {echo showinf_pers($user->id);} catch (Exception $e) {echo "<div class='private'>Ошибка генератора персонажа showinf_pers(): {$e}</div>";}
|
||||||
try {$user->showUserInfo();} catch (Exception $e) {echo "<div class='private'>Ошибка генератора персонажа showinf_pers(): {$e}</div>";}
|
try {echo $user->showUserInfo();} catch (Exception $e) {echo "<div class='private'>Ошибка классового генератора персонажа showUserInfo(): {$e}</div>";}
|
||||||
if (!empty($user->married)): ?>
|
if (!empty($user->married)): ?>
|
||||||
<a href="inf.php?<?= $user->married ?>" target=_blank>
|
<a href="inf.php?<?= $user->married ?>" target=_blank>
|
||||||
<img alt="В браке с <?= $user->married ?>" src="i/married.gif"
|
<img alt="В браке с <?= $user->married ?>" src="i/married.gif"
|
||||||
|
Loading…
Reference in New Issue
Block a user