Code cleaning.

This commit is contained in:
lopar 2020-06-23 08:11:07 +03:00
parent 85f83a665a
commit 5d28be5f4f

47
inf.php
View File

@ -11,7 +11,8 @@ $own = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = "?s"', $
$presents = db::c()->query('SELECT img, sender FROM `users_presents` WHERE expiration_date >= "?s" AND owner = ?i', date('Y-m-d'), $user['id']);
if (empty($user['id'])): ?>
<html>
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Ошибка</title>
@ -21,23 +22,23 @@ if (empty($user['id'])): ?>
<p><a style="color: #99f" href="javascript:window.history.go(-1);">←назад</a></p>
</body>
</html>
<? exit(); endif; ?>
<?php exit(); endif; ?>
<html>
<html lang="ru">
<head>
<title>Информация о <?= $user['login'] ?></title>
<meta charset=UTF-8"/>
<link href="css/main.css" rel="stylesheet">
</head>
<BODY onload="<?= topsethp() ?>">
<?php if ($user['admin'] == 1 AND $own['admin'] != 1 AND file_exists('customuserdata/' . $user['id'])) die(file_get_contents('customuserdata/' . $user['id'])); ?>
<?php if ($user['admin'] == 1 && $own['admin'] != 1 && file_exists('customuserdata/' . $user['id'])) {die(file_get_contents('customuserdata/' . $user['id']));} ?>
<table width=100%>
<tr>
<td style="width: 250px; vertical-align: top;">
<?= showinf_pers($user['id']);
if (!empty($user['married'])): ?>
<a href="inf.php?<?= $user['married'] ?>" target=_blank>
<img src="i/married.gif" title="В браке с <?= $user['married'] ?>">
<img alt="В браке с <?= $user['married'] ?>" src="i/married.gif" title="В браке с <?= $user['married'] ?>">
</a>
<?php endif; ?>
</td>
@ -50,8 +51,8 @@ if (empty($user['id'])): ?>
<!-- Нижняя часть -->
<?php
$effect = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i ', $user['id'], 5)->fetch_assoc();
if ($effect['time'] AND ($own['admin'] != 1)) die('<h3>Персонаж обезличен!</h3>');
if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "<br>";
if ($effect['time'] && ($own['admin'] != 1)) {die('<h3>Персонаж обезличен!</h3>');}
if (!empty($user['realname'])) {echo "Имя: " . $user['realname'] . "<br>";}
?>
<p style="font-family: Consolas,monospace;"><?= nl2br($user['info']) ?></p>
<hr>
@ -64,13 +65,13 @@ if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "<br>";
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php if (!empty($user['prof1']) OR !empty($user['prof2'])): ?>
<?php if (!empty($user['prof1']) || !empty($user['prof2'])): ?>
<div>
<legend>Лицензии</legend>
<?php
if ($user['prof2'] == 21) echo ' <img src="i/prof21.png" title="Лицензия наемника"> ';
if ($user['prof2'] == 22) echo ' <img src="i/prof22.png" title="Лицензия лекаря"> ';
if ($user['prof1'] == 1) echo ' <img src="i/prof1.png" title="Лицензия кузнеца"> ';
if ($user['prof2'] == 21) {echo ' <img src="i/prof21.png" title="Лицензия наемника"> ';}
if ($user['prof2'] == 22) {echo ' <img src="i/prof22.png" title="Лицензия лекаря"> ';}
if ($user['prof1'] == 1) {echo ' <img src="i/prof1.png" title="Лицензия кузнеца"> ';}
?>
</div>
<?php endif; ?>
@ -80,7 +81,7 @@ if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "<br>";
$showModeratorInfo = false;
# Если я любой паладин, и смотрю не админа, или я сам админ.
if ((($own['align'] == 1) AND (!$user['admin'])) OR (!empty($own['admin']))) $showModeratorInfo = true;
if ((($own['align'] == 1) && (!$user['admin'])) || (!empty($own['admin']))) {$showModeratorInfo = true;}
if ($showModeratorInfo == 1) {
$ld = db::c()->query('SELECT * FROM `lichka` WHERE `pers` = ?i ORDER BY `id` ASC', $user['id']);
@ -92,24 +93,24 @@ if ($showModeratorInfo == 1) {
}
echo "<H4>Дополнительные сведения</H4>";
if (!empty($user['id'])) echo "ID: " . $user['id'] . "<br>";
if (!empty($user['email'])) echo "E-mail: " . $user['email'] . "<br>";
if (!empty($user['borndate'])) echo "День рождения: " . $user['borndate'] . "<br>";
if (!empty($user['ip'])) echo "IP при регистрации: " . $user['ip'] . "<br>";
if (!empty($user['id'])) {echo "ID: " . $user['id'] . "<br>";}
if (!empty($user['email'])) {echo "E-mail: " . $user['email'] . "<br>";}
if (!empty($user['borndate'])) {echo "День рождения: " . $user['borndate'] . "<br>";}
if (!empty($user['ip'])) {echo "IP при регистрации: " . $user['ip'] . "<br>";}
}
if ($own['admin'] == 1) {
if (!empty($user['exp'])) echo "Oпыт: " . $user['exp'] . "<br>";
if (!empty($user['stats'])) echo "Число неиспользованных UP-ов: " . $user['stats'] . "<br>";
if (!empty($user['money'])) echo "Кредитов: " . $user['money'] . "<br>";
if (!empty($user['room'])) echo "Комната: " . $user['room'] . "<br>";
if (!empty($user['reputation'])) echo "Всего Репутации: " . $user['reputation'] . "<br>";
if (!empty($user['doblest'])) echo "Репутации: " . $user['doblest'] . "<br>";
if (!empty($user['exp'])) {echo "Oпыт: " . $user['exp'] . "<br>";}
if (!empty($user['stats'])) {echo "Число неиспользованных UP-ов: " . $user['stats'] . "<br>";}
if (!empty($user['money'])) {echo "Кредитов: " . $user['money'] . "<br>";}
if (!empty($user['room'])) {echo "Комната: " . $user['room'] . "<br>";}
if (!empty($user['reputation'])) {echo "Всего Репутации: " . $user['reputation'] . "<br>";}
if (!empty($user['doblest'])) {echo "Репутации: " . $user['doblest'] . "<br>";}
if ($user_bank = db::c()->query('SELECT `id`,`cr`,`ekr` FROM `bank` WHERE `id` = ?i', $user['id'])) {
echo "<H4>Банковские счета</H4>";
while ($row_user_bank = $user_bank->fetch_assoc())
echo "" . $row_user_bank['id'] . ": " . $row_user_bank['cr'] . " кр, " . $row_user_bank['ekr'] . " екр.";
{echo "" . $row_user_bank['id'] . ": " . $row_user_bank['cr'] . " кр, " . $row_user_bank['ekr'] . " екр.";}
}
}
?>