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

This commit is contained in:
lopar 2020-07-04 23:37:47 +03:00
parent 42905cb9ac
commit de3ddf058b
3 changed files with 157 additions and 2 deletions

View File

@ -30,6 +30,7 @@ class User
public $married; public $married;
public $exp; public $exp;
public $stats; public $stats;
public $shadow;
use Rooms; use Rooms;

View File

@ -53,8 +53,9 @@ if (empty($user->id)): ?>
<tr> <tr>
<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>";} include_once 'views/user-info-doll.php';
try {$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"

153
views/user-info-doll.php Normal file
View File

@ -0,0 +1,153 @@
<div style="text-align: center">
<?php if (!empty($user->align)): ?>
<img src="/i/align_<?= $user->align ?>.png" alt="Склонность">
<?php endif; ?>
<?php if ($user->block): ?>
<span class="private"><s><?= $user->login ?></s></span>
<?php else: ?>
<strong><?= $user->login ?></strong>
<?php endif; ?>
<?php if (!empty($user->clan)): ?>
<img src="/i/clan/<?= $user->clan ?>.png" alt="<?= $user->clan ?>">
<?php endif; ?>
</div>
<div style="width: 100%; height: 16px; background: #ffaaff; overflow: hidden; border-radius: 3px; font-size: 14px; text-align: center;" >
добавить здоровье 🤔
</div>
<table style="width: 100%; text-align: center;">
<tr>
<td width=62 valign=top>
<table width=100%>
<tr>
<td>
<?php if (isset($dressed_item[1])): ?>
<img src="/i/sh/<?= $dressed_item[1]['image'] ?>" class="item-wrap-normal tip" alt="Слот [1]">
<span class="tiptext">
<strong><?= $dressed_item[1]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [1]" alt="Пустой слот [1]>
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[2])): ?>
<img src="/i/sh/<?= $dressed_item[2]['image'] ?>" class="item-wrap-normal tip" alt="Слот [2]">
<span class="tiptext">
<strong><?= $dressed_item[2]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [2]" alt="Пустой слот [2]">
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[3])): ?>
<img src="/i/sh/<?= $dressed_item[3]['image'] ?>" class="item-wrap-normal tip" alt="Слот [3]">
<span class="tiptext">
<strong><?= $dressed_item[3]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [3]" alt="Пустой слот [3]">
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[4])): ?>
<img src="/i/sh/<?= $dressed_item[4]['image'] ?>" class="item-wrap-normal tip" alt="Слот [4]">
<span class="tiptext">
<strong><?= $dressed_item[4]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [4]" alt="Пустой слот [4]">
<?php endif; ?>
</td>
</tr>
</table>
</td>
<td valign=top>
<img src="/i/shadow/<?= $user->shadow ?>" onerror=" this.src = '/i/shadow/0.gif';">
</td>
<td width="62" valign=top>
<table width=100%>
<tr>
<td>
<?php if (isset($dressed_item[5])): ?>
<img src="/i/sh/<?= $dressed_item[5]['image'] ?>" class="item-wrap-normal tip" alt="Слот [5]">
<span class="tiptext">
<strong><?= $dressed_item[5]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [5]" alt="Пустой слот [5]>
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[6])): ?>
<img src="/i/sh/<?= $dressed_item[6]['image'] ?>" class="item-wrap-normal tip" alt="Слот [6]">
<span class="tiptext">
<strong><?= $dressed_item[6]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [6]" alt="Пустой слот [6]">
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[7])): ?>
<img src="/i/sh/<?= $dressed_item[7]['image'] ?>" class="item-wrap-normal tip" alt="Слот [7]">
<span class="tiptext">
<strong><?= $dressed_item[7]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [7]" alt="Пустой слот [7]">
<?php endif; ?>
</td>
</tr>
<tr>
<td>
<?php if (isset($dressed_item[8])): ?>
<img src="/i/sh/<?= $dressed_item[8]['image'] ?>" class="item-wrap-normal tip" alt="Слот [8]">
<span class="tiptext">
<strong><?= $dressed_item[8]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [8]" alt="Пустой слот [8]">
<?php endif; ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="text-align: center">
<?php if (isset($dressed_item[9])): ?>
<img src="/i/sh/<?= $dressed_item[9]['image'] ?>" class="item-wrap-normal tip" alt="Слот [9]">
<span class="tiptext">
<strong><?= $dressed_item[9]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [9]" alt="Пустой слот [9]">
<?php endif; ?>
<?php if (isset($dressed_item[10])): ?>
<img src="/i/sh/<?= $dressed_item[10]['image'] ?>" class="item-wrap-normal tip" alt="Слот [10]">
<span class="tiptext">
<strong><?= $dressed_item[10]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [10]" alt="Пустой слот [10]">
<?php endif; ?>
<?php if (isset($dressed_item[11])): ?>
<img src="/i/sh/<?= $dressed_item[11]['image'] ?>" class="item-wrap-normal tip" alt="Слот [11]">
<span class="tiptext">
<strong><?= $dressed_item[11]['name'] ?></strong>
</span>
<?php else: ?>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [11]" alt="Пустой слот [11]">
<?php endif; ?>
</div>