UserInfo() изменён на новую вёрстку.
This commit is contained in:
parent
3a2414e225
commit
3c2816c400
158
classes/User.php
158
classes/User.php
@ -66,148 +66,6 @@ EMPTY_SLOT;
|
||||
}
|
||||
|
||||
public function showUserInfo()
|
||||
{
|
||||
$starSign = star_sign($this->borndate);
|
||||
$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;
|
||||
}
|
||||
echo <<<USERINFO
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<td style="width: 250px; vertical-align: top;">
|
||||
<div style="text-align: center">
|
||||
USERINFO;
|
||||
if ($this->align) {
|
||||
echo sprintf('<img src="/i/align_%s.png" alt="Склонность">', $this->align);
|
||||
}
|
||||
if ($this->block) {
|
||||
echo sprintf('<span class="private"><s>%s</s></span>', $this->login);
|
||||
} else {
|
||||
echo sprintf('<strong>%s</strong>', $this->login);
|
||||
}
|
||||
if ($this->clan) {
|
||||
echo sprintf('<img src="/i/clan/%s.png" alt="%s">', $this->clan, $this->clan);
|
||||
}
|
||||
echo <<<USERINFO
|
||||
</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>
|
||||
USERINFO;
|
||||
if (isset($dressed_item[1])) {
|
||||
$this->showItem($dressed_item[1]);
|
||||
} else {
|
||||
$this->showItem(1);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[2])) {
|
||||
$this->showItem($dressed_item[2]);
|
||||
} else {
|
||||
$this->showItem(2);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[3])) {
|
||||
$this->showItem($dressed_item[3]);
|
||||
} else {
|
||||
$this->showItem(3);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[4])) {
|
||||
$this->showItem($dressed_item[4]);
|
||||
} else {
|
||||
$this->showItem(4);
|
||||
}
|
||||
echo '</td></tr>';
|
||||
echo <<<USERINFO
|
||||
</table>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<img src="/i/shadow/{$this->shadow}" onerror=" this.src = '/i/shadow/0.gif';">
|
||||
</td>
|
||||
<td width="62" valign=top>
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<td>
|
||||
USERINFO;
|
||||
if (isset($dressed_item[5])) {
|
||||
$this->showItem($dressed_item[5]);
|
||||
} else {
|
||||
$this->showItem(5);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[6])) {
|
||||
$this->showItem($dressed_item[6]);
|
||||
} else {
|
||||
$this->showItem(6);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[7])) {
|
||||
$this->showItem($dressed_item[7]);
|
||||
} else {
|
||||
$this->showItem(7);
|
||||
}
|
||||
echo '</td></tr><tr><td>';
|
||||
if (isset($dressed_item[8])) {
|
||||
$this->showItem($dressed_item[8]);
|
||||
} else {
|
||||
$this->showItem(8);
|
||||
}
|
||||
echo '</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: center">';
|
||||
if (isset($dressed_item[9])) {
|
||||
$this->showItem($dressed_item[9]);
|
||||
} else {
|
||||
$this->showItem(9);
|
||||
}
|
||||
if (isset($dressed_item[10])) {
|
||||
$this->showItem($dressed_item[10]);
|
||||
} else {
|
||||
$this->showItem(10);
|
||||
}
|
||||
if (isset($dressed_item[11])) {
|
||||
$this->showItem($dressed_item[11]);
|
||||
} else {
|
||||
$this->showItem(11);
|
||||
}
|
||||
echo <<<USERINFO
|
||||
</div>
|
||||
</td>
|
||||
<td width="100%">
|
||||
Уровень {$this->level} <br>
|
||||
Сила {$this->strength} <br>
|
||||
Ловкость {$this->dexterity} <br>
|
||||
Интуиция {$this->intuition} <br>
|
||||
Выносливость {$this->endurance} <br>
|
||||
Интеллект {$this->intelligence} <br>
|
||||
Мудрость {$this->wisdom} <br>
|
||||
Находится в {$this->getRoomName($this->room)}<br>
|
||||
</td>
|
||||
<td style="vertical-align: top; width: 100px; text-align: center;">
|
||||
<img src="i/zodiac/{$starSign}.png" alt="Родовой знак">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
USERINFO;
|
||||
if ($this->married) {
|
||||
echo sprintf('<a href = "inf.php?%s" target = _blank ><img alt = "В браке с %s" src = "i/married.gif" title = "В браке с %s"></a >', $this->married, $this->married, $this->married);
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
}
|
||||
|
||||
public function showUserInfo2()
|
||||
{
|
||||
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
|
||||
while ($row = $dressed_items->fetch_assoc()) {
|
||||
@ -300,20 +158,12 @@ USERINFO;
|
||||
echo 'Уровень<br>Сила<br>Ловкость<br>Интуиция<br>Выносливость<br>Интеллект<br>Мудрость<br>Находится в:';
|
||||
echo '</div>';
|
||||
echo '<div class="column">';
|
||||
echo $this->level.'<br>'.$this->strength.'<br>'.$this->dexterity.'<br>'.$this->intuition.'<br>'.$this->endurance.'<br>'.$this->intelligence.'<br>'.$this->wisdom.'<br>'.$this->getRoomName($this->room);
|
||||
echo $this->level . '<br>' . $this->strength . '<br>' . $this->dexterity . '<br>' . $this->intuition . '<br>' . $this->endurance . '<br>' . $this->intelligence . '<br>' . $this->wisdom . '<br>' . $this->getRoomName($this->room);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo <<<USERINFO
|
||||
<hr>
|
||||
Уровень {$this->level} <br>
|
||||
Сила {$this->strength} <br>
|
||||
Ловкость {$this->dexterity} <br>
|
||||
Интуиция {$this->intuition} <br>
|
||||
Выносливость {$this->endurance} <br>
|
||||
Интеллект {$this->intelligence} <br>
|
||||
Мудрость {$this->wisdom} <br>
|
||||
Находится в {$this->getRoomName($this->room)}
|
||||
USERINFO;
|
||||
if ($this->married) {
|
||||
echo sprintf('<a href = "inf.php?%s" target = _blank ><img alt = "В браке с %s" src = "i/married.gif" title = "В браке с %s"></a >', $this->married, $this->married, $this->married);
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
12
css/main.css
12
css/main.css
@ -261,11 +261,10 @@ hr {
|
||||
}
|
||||
|
||||
img.item-wrap-normal {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 98px;
|
||||
height: 98px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
padding: 7px;
|
||||
display: inline-block;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #AAA;
|
||||
@ -385,8 +384,13 @@ div.user-info-container > div.user-info > div.stats-container {
|
||||
}
|
||||
|
||||
div.user-info-container > div.user-info > div.stats-container > div.column {
|
||||
flex: 50%;
|
||||
padding: 10px;
|
||||
font-size: larger;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.user-info-container > div.user-info > div.stats-container > div.column + div.column {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.user-info-container > div.user-signs {
|
||||
|
4
inf.php
4
inf.php
@ -50,9 +50,9 @@ if (empty($user->id)): ?>
|
||||
die(file_get_contents('customuserdata/' . $user['id']));
|
||||
}
|
||||
try {
|
||||
$user->showUserInfo2();
|
||||
$user->showUserInfo();
|
||||
} catch (Exception $e) {
|
||||
echo "<div class='private'>Ошибка классового генератора персонажа showUserInfo(): {$e}</div>";
|
||||
echo "<div class='private'>Ошибка генератора showUserInfo() в User.php: {$e}</div>";
|
||||
} ?>
|
||||
|
||||
<hr>
|
||||
|
Loading…
Reference in New Issue
Block a user