Внедрение шаблонизатора. Решение самых идиотских ошибок вёрстки. Кое-где исправлены ошибки синтаксиса php.

This commit is contained in:
Igor Barkov (iwork)
2020-09-30 22:12:34 +03:00
parent 8b1a2e9b38
commit a4de6c51a3
41 changed files with 4688 additions and 5715 deletions
+22 -33
View File
@@ -18,7 +18,7 @@ if ($_SESSION['uid'] != 2) header("Location: index.php");
require_once 'config.php';
$user = new User($_SESSION['uid']);
$status = '';
$dirname = "i/presents/";
$images = glob($dirname . "*.png");
@@ -48,11 +48,9 @@ if (!empty($_POST['sendAction'])) {
if ($_POST['sender'] == 1) {
$sender = "Анонимный подарок";
}
elseif ($_POST['sender'] == 2 && $user->clan) {
} elseif ($_POST['sender'] == 2 && $user->clan) {
$sender = "Подарок от клана {$user->clan}";
}
else {
} else {
$sender = "Подарок от {$user->login}";
}
@@ -64,34 +62,27 @@ if (!empty($_POST['sendAction'])) {
db::c()->query('INSERT INTO `telegraph` (receiver, text) VALUES (?i,"?s")', $receiver['id'], $telegraphText);
$status = "Подарок удачно доставлен к {$_POST['receiver']}! Вы потратили <b>{$cost}</b> кр.";
}
Template::header('Дарильня');
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<script src="js/main.js"></script>
<style>
label.present > input { /* HIDE RADIO */
visibility: hidden; /* Makes input not-clickable */
position: absolute; /* Remove input from document flow */
}
<script src="js/main.js"></script>
<style>
label.present > input { /* HIDE RADIO */
visibility: hidden; /* Makes input not-clickable */
position: absolute; /* Remove input from document flow */
}
label.present > input + img { /* IMAGE STYLES */
cursor: pointer;
border: 1px solid transparent;
}
label.present > input + img { /* IMAGE STYLES */
cursor: pointer;
border: 1px solid transparent;
}
label.present > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */
border: 1px solid darkred;
background: lightcoral;
}
</style>
<title></title>
</head>
<body>
<h1>Магазин подарков</h1>
<div class="private"><?php if (!empty($status)) echo $status; ?></div>
label.present > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */
border: 1px solid darkred;
background: lightcoral;
}
</style>
<h1>Дарильня</h1>
<div class="private"><?= $status ?></div>
Вы можете сделать подарок любому персонажу. Ваш подарок будет
отображаться в информации о персонаже.<br><br>
<div>
@@ -119,6 +110,4 @@ if (!empty($_POST['sendAction'])) {
<br>
<input type="submit" value="Подарить">
</form>
</div>
</body>
</html>
</div>