Code clean.

This commit is contained in:
lopar 2021-03-10 23:47:33 +02:00
parent 1de0d465eb
commit 9a75e9d949
3 changed files with 48 additions and 24 deletions

View File

@ -40,8 +40,8 @@ class UserInfo extends UserStats
} }
echo '<div class="slot-image">'; echo '<div class="slot-image">';
if ($isBattle) { if ($isBattle) {
$sh = '<img src="/i/shadow/%s" alt="%s" class="tip"><span class="tiptext"><b>%s</b>Уровень: %s<br>Сила: %s<br>Ловкость: %s<br>Интуиция: %s<br>Выносливость: %s<br>Интеллект: %s<br>Мудрость: %s</span>'; echo sprintf('<img src="/i/shadow/%s" alt="%s" class="tip"><span class="tiptext"><b>%s</b>Уровень: %s<br>Сила: %s<br>Ловкость: %s<br>Интуиция: %s<br>Выносливость: %s<br>Интеллект: %s<br>Мудрость: %s</span>',
echo sprintf($sh, $this->shadow, $this->login, $this->login, $this->level, $this->strength, $this->dexterity, $this->intuition, $this->endurance, $this->intelligence, $this->wisdom); $this->shadow, $this->login, $this->login, $this->level, $this->strength, $this->dexterity, $this->intuition, $this->endurance, $this->intelligence, $this->wisdom);
unset($sh); unset($sh);
} else { } else {
echo '<img src="/i/shadow/' . $this->shadow . '" alt="' . $this->login . '">'; echo '<img src="/i/shadow/' . $this->shadow . '" alt="' . $this->login . '">';
@ -156,12 +156,8 @@ INFO;
echo '<hr><!-- Нижняя часть -->'; echo '<hr><!-- Нижняя часть -->';
echo '<div class="user-info-container-lower">'; echo '<div class="user-info-container-lower">';
echo '<h2>Об игроке</h2>'; echo '<h2>Об игроке</h2>';
if ($this->realname) { echo $this->realname ? "Имя: $this->realname" : "";
echo sprintf('Имя: %s<br>', $this->realname); echo $this->info ? "<br>" . nl2br($this->info) : "";
}
if ($this->info) {
echo nl2br($this->info);
}
echo '</div><!-- user-info-container-lower -->'; echo '</div><!-- user-info-container-lower -->';
echo $this->showPrivateData(); echo $this->showPrivateData();
} }

View File

@ -303,9 +303,40 @@ Template::header('Игра');
if (errk === 1) { if (errk === 1) {
errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>'; errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>';
} }
document.getElementById("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' + document.getElementById("hint3").innerHTML = `
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2><span class="error">' + <table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA>
errkom + '</span>введите название предмета</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '" value="' + com + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>'; <tr>
<td align=center>
<b>${title}</b>
</td>
<td width=20 align=right valign=top style='cursor: pointer' onclick='closehint3();'>
<BIG><B>x
</td>
</tr>
<tr>
<td colspan=2>
<form action="${script}" method=POST>
<table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD>
<tr>
<INPUT TYPE=hidden name=sd4 value='6'>
<td colspan=2>
<span class='error'>${errkom}</span> введите название предмета
</TD>
</TR>
<TR>
<TD width=50% align=right>
<INPUT TYPE=text NAME="${name}" value="${com}">
</TD>
<TD width=50%>
<INPUT TYPE='submit' value=' »» '>
</TD>
</TR>
</TABLE>
</FORM>
</td>
</tr>
</table>
`;
document.getElementById("hint3").style.visibility = "visible"; document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100'; document.getElementById("hint3").style.left = '100';
document.getElementById("hint3").style.top = '100'; document.getElementById("hint3").style.top = '100';
@ -314,13 +345,12 @@ Template::header('Игра');
} }
</script> </script>
<div id=hint3 class=ahint></div> <div id=hint3 class=ahint></div>
<div id="hint4" style="position: absolute;"></div>
<div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div> <div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div>
<table width=100%> <table style="width: 100%">
<TR> <TR>
<td style="vertical-align: top; width: 350px"> <td style="vertical-align: top; width: 350px">
<?php $userInfo->showUserDoll(0, 1); ?> <!-- Первый столбец --> <?php $userInfo->showUserDoll(0, 1); ?> <!-- Первый столбец -->
<div align="center"> <div style="text-align: center;">
<a href='main.php?edit=1&undress=all' class="button">Снять все</a><BR> <a href='main.php?edit=1&undress=all' class="button">Снять все</a><BR>
<div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;"> <div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;">
<?= show_eff_inf($user->getId()) ?> <?= show_eff_inf($user->getId()) ?>
@ -377,7 +407,7 @@ Template::header('Игра');
</div> </div>
</div> </div>
</td> </td>
<td valign=top> <td style="vertical-align: top;">
<div class="button-container"> <!--Меню-кнопки--> <div class="button-container"> <!--Меню-кнопки-->
<FORM METHOD=POST ACTION="?edit=1" name=f1> <FORM METHOD=POST ACTION="?edit=1" name=f1>
<?php if ($user->getShadow() == '0.gif' || $user->getAdmin() == 1): ?> <?php if ($user->getShadow() == '0.gif' || $user->getAdmin() == 1): ?>
@ -396,16 +426,16 @@ Template::header('Игра');
</div> </div>
</div> </div>
<div> <!--рюкзак--> <div> <!--рюкзак-->
<table BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5"> <table style="border: 0; padding: 2px; border-spacing: 1px; width: 100%; background-color: #a5a5a5">
<caption>Рюкзак <caption>Рюкзак
(масса: <?= '?? /' . $userStats->getStrength() * 4 ?>) (масса: <?= '?? /' . $userStats->getStrength() * 4 ?>)
</caption> </caption>
<?php <?php
foreach ($iteminfo as $ii) { foreach ($iteminfo as $ii) {
echo "<tr><td width='100' align='center' bgcolor='#d3d3d3'>"; echo "<tr><td style='width: 100px; text-align: center; background-color: #d3d3d3'>";
$ii->printImage(); $ii->printImage();
$ii->printControls(); $ii->printControls();
echo "<td valign='top' bgcolor='#d3d3d3'>"; echo "<td style='vertical-align: top; background-color: #d3d3d3'>";
$ii->printInfo(); $ii->printInfo();
} }
if (!$data) { if (!$data) {

View File

@ -39,12 +39,10 @@ Template::header('Анкета');
<a href="main.php"> на главную</a> <a href="main.php"> на главную</a>
<h1>Анкета персонажа <?= $user->getLogin() ?></h1> <h1>Анкета персонажа <?= $user->getLogin() ?></h1>
<form method="post"> <form method="post">
<input name="name" placeholder="Реальное имя" value="<?= $user->getRealname() ?>"><br> <label>
<select name="color" id="color"> <input name="name" placeholder="Реальное имя" value="<?= $user->getRealname() ?>">
<option value="0" selected>Чёрный</option> Реальное имя
<option value="1">Синий</option> </label><br>
<option value="2">Зелёный</option>
</select><label for="color"></label><br>
<textarea name="hobbie" placeholder="Хобби"><?= $user->getInfo() ?></textarea><br> <textarea name="hobbie" placeholder="Хобби"><?= $user->getInfo() ?></textarea><br>
<input name="submit" type="submit"> <input name="submit" type="submit">
</form> </form>