Внедрение шаблонизатора. Решение самых идиотских ошибок вёрстки. Кое-где исправлены ошибки синтаксиса 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
+50 -193
View File
@@ -5,9 +5,8 @@ if (empty($_SESSION['uid'])) {
exit;
}
include "config.php";
include "functions.php";
include "startpodzemel.php";
require_once "functions.php";
require_once "startpodzemel.php";
if ($user->battle) {
header('location: fbattle.php');
exit;
@@ -17,87 +16,22 @@ $fd = mysql_fetch_array($df);
$cd = mysql_query("select `n18` from `podzem3` where `glava`='" . $fd['glava'] . "' and `name`='Канализация 1 этаж'");
$vb = mysql_fetch_array($cd);
if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 этаж' and $vb['n18'] == '8') {
Template::header('Подземелье Луки');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel=stylesheet type="text/css" href="css/main.css">
<title>Подземка - Лука</title>
<style>
BODY {
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
margin: 0 0 0 0;
scrollbar-face-color: #e3ac67;
scrollbar-highlight-color: #e0c3a0;
scrollbar-shadow-color: #b78d58;
scrollbar-3dlight-color: #b78d58;
scrollbar-arrow-color: #b78d58;
scrollbar-track-color: #e0c3a0;
scrollbar-darkshadow-color: #b78d58;
}
.menu {
z-index: 100;
background-color: #E4F2DF;
border-style: solid;
border-width: 2px;
border-color: #77c3fc
position: absolute;
left: 0;
top: 0;
visibility: hidden;
cursor: hand;
}
a.menuItem {
border: 0 solid #000000;
background-color: #484848;
color: #000000;
display: block;
font-family: Verdana, Arial;
font-size: 8pt;
font-weight: bold;
padding: 2px 12px 2px 8px;
text-decoration: none;
}
a.menuItem:hover {
background-color: #d4cbaa;
color: #000000;
}
</style>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#e2e0e0"
onload="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>)">
<div id=hint3 class=ahint></div>
<TABLE width=100% cellspacing=0 cellpadding=0 border=0>
<TR>
<TD valign=top>
<TABLE width=250 cellspacing=0 cellpadding=0>
<TR>
<TD valign=top width=250 nowrap>
<CENTER>
<?php
$userInfo = new User($_SESSION['uid']);
$userInfo->showUserDoll();
?>
</CENTER>
</TD>
</TR>
</TABLE>
<div style="width: 250px; text-align: center;">
<?php
$userInfo = new User($_SESSION['uid']);
$userInfo->showUserDoll();
?>
</div>
</TD>
<TD>
<i>
<?
<?php
$gag = mysql_query("SELECT * FROM qwest WHERE login='" . $user['login'] . "'");
while ($qw = mysql_fetch_array($gag)) {
$name_qwest = $qw["name_items"];
@@ -115,7 +49,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$ok_qwest = "1";
}
if (!$_GET['d']) {
print"Запах... ОНИ! Мою хороошую, мою чистую канализацию испортилиии...";
}
@@ -127,41 +60,32 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
}
if ($qwest_status != 'ok') {
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"Ооо... Лука рад... Лука очень благодарен тебе... Лука даст тебе подарок... Лука даст тебе одно из двух... Лука даст Гайку силы или Гайку мудрости... выбирай...";
}
if ($ok_qwest == '1' && $_GET['d'] == '1.2') {
print"Ооо... Лука рад... Лука очень благодарен тебе... Лука даст тебе подарок... Лука даст тебе одно из двух... Лука даст Гайку силы или Гайку мудрости... выбирай...";
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.3') {
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$res = mysql_query($sql);
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
if (!$res) {
echo mysql_error();
}
print"<font style='font-size:11px; color:red;'>Вы получили 'Гайку силы'.</font><br><br>
Лука говарит спасибо...";
if ($ok_qwest == '1' && $_GET['d'] == '1.3') {
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$res = mysql_query($sql);
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
if (!$res) {
echo mysql_error();
}
print"<span style='font-size:11px; color:red;'>Вы получили 'Гайку силы'.</span><br><br> Лука говарит спасибо...";
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.4') {
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$res = mysql_query($sql);
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
if (!$res) {
echo mysql_error();
}
print"<font style='font-size:11px; color:red;'>Вы получили 'Гайку мудрости'.</font><br><br>
Лука говарит спасибо...";
if ($ok_qwest == '1' && $_GET['d'] == '1.4') {
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$res = mysql_query($sql);
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
if (!$res) {
echo mysql_error();
}
print"<span style='font-size:11px; color:red;'>Вы получили 'Гайку мудрости'.</span><br><br>Лука говарит спасибо...";
}
}
if (($_GET['d'] == '2') && ($user['level'] >= 4) && ($user['level'] < 7)) {
print"Цена-аа? У Луки много жетонов. Лука не жаадный. Лука берет 3 Гайки и отдает жетон. Лука дает жетон за целый болт. Лука дает ТРИ жетона за найденный вентиль.<br> Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный!";
}
@@ -365,8 +289,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else {
$ze_m = $ostalos * 0.1;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos', `massa`='$ze_m' WHERE `id`='$alls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Гайка' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$alls_id'");// x_mis ставим 0
}
if (($user['level'] >= 4) && ($user['level'] < 7)) {
if ($total_mass_v <= 0) {
@@ -546,8 +468,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else {
$ze_v = $ostalos_v * 0.2;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_v',`massa`='$ze_v' WHERE `id`='$vls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Вентиль' and `x_mis`='0' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$vls_id'");// x_mis ставим 0
}
if (($user['level'] >= 4) && ($user['level'] < 7)) {
if ($total_mass_b <= 0) {
@@ -726,11 +646,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else {
$ze_b = $ostalos_b * 0.1;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_b',`massa`='$ze_b' WHERE `id`='$bls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Болт' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$bls_id'");// x_mis ставим 0
}
if ($ziton != '0') {//1
if (!empty($ziton) {
$g = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$koll = $g["maxdur"];
$mas = $ziton * 0.1;
@@ -738,12 +656,11 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
mysql_query("UPDATE `inventory` SET maxdur=maxdur+$ziton, massa=massa+$mas,`present`='Лука' WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Жетон'");
} else {
$mas = $ziton * 0.1;
$fo = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa,present) VALUES('Жетон','0','$ziton','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
}
}//1
}
if ($ziton_v != '0') {//1
if (!empty($ziton_v)) {
$gv = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$kollv = $gv["maxdur"];
$mas = $ziton_v * 0.1;
@@ -753,9 +670,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$mas = $ziton_v * 0.1;
$fov = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_v','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
}
}//1
}
if ($ziton_b != '0') {//1
if (!empty($ziton_b)) {
$gb = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$kollb = $gb["maxdur"];
$mas = $ziton_b * 0.1;
@@ -765,9 +682,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$mas = $ziton_b * 0.1;
$fob = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_b','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
}
}//1
}
if ($ziton <= 0 and $ziton_v <= 0 and $ziton_b <= 0) {
if (empty($ziton) && empty($ziton_v) && empty($ziton_b)) {
print" ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ! ";
}
if ($ziton > 0) {
@@ -794,75 +711,40 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
if ($_GET['d'] == '7') {
if ($qwest != '1') {
$T1 = mysql_query("INSERT INTO qwest (user_id,login,name_qwest,name_items,id_items,dlja,zadanie,kw,status) VALUES('" . $user['id'] . "','" . $user['login'] . "','kluchiik','Ключиик','','Лука','Найти ключиик','0','no')");
print"<font style='font-size:11px; color:red;'>Вы приняли задание.(Найти 'ключиик').</font><br><br>
print"<span style='font-size:11px; color:red;'>Вы приняли задание.(Найти 'ключиик').</span><br><br>
Хорошо... Лука будет ждать...";
} else {
print"<font style='font-size:11px; color:red;'>Вы уже приняли задание.(Найти 'ключиик').</font><br><br>
print"<span style='font-size:11px; color:red;'>Вы уже приняли задание.(Найти 'ключиик').</span><br><br>
Ну что? Лука ждёт...";
}
}
}
?>
</i>
<BR><BR>
<?
</i><BR><BR>
<?php
//Вопросы)
if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1'> Запах?? Ты вообще о чем? </A><BR>";
}
if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1.1'> Я тут гайки-вентили нашел, тебе они случайно не нужны? </A><BR>";
}
if ($qwest_status != 'ok') {
if ($ok_qwest == '1') {
if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1.2'> Вот твой ключиик! </A><BR>";
}
if ($qwest_status != 'ok' && $ok_qwest == '1') {
print"&bull;<A href='?act=luka&d=1.2'> Вот твой ключиик! </A><BR>";
}
}
if (!isset($_GET['d'])) {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '1') {
print"&bull;<A href='?act=luka'> Понятно. Но я хотел поговорить о другом. </A><BR>";
}
if ($_GET['d'] == '1') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka&d=2'> Я хочу знать, сколько жетонов ты мне дашь. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka'> С гайками все ясно. Вернемся назад. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"&bull;<A href='?act=luka&d=1.3'> Выбераю Гайку силы.</A><BR>";
}
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"&bull;<A href='?act=luka&d=1.4'> Выбераю Гайку мудрости.</A><BR>";
}
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду..</A><BR>";
}
if ($ok_qwest == '1' && $_GET['d'] == '1.2') {
print"&bull;<A href='?act=luka&d=1.3'> Выбераю Гайку силы.</A><BR>";
print"&bull;<A href='?act=luka&d=1.4'> Выбераю Гайку мудрости.</A><BR>";
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду..</A><BR>";
}
if ($_GET['d'] == '1.3') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
@@ -870,61 +752,39 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
if ($_GET['d'] == '1.4') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '2') {
print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>";
}
if ($_GET['d'] == '2') {
print"&bull;<A href='?act=luka'> Спасибо, за прайс-лист. </A><BR>";
}
if ($_GET['d'] == '2') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '3') {
print"&bull;<A href='?act=luka&d=4'> Я хотел еще спросить... </A><BR>";
}
if ($_GET['d'] == '3') {
print"&bull;<A href='main.php?act=none'> Хорошо, пойду еще принесу.</A><BR>";
}
if ($_GET['d'] == '4') {
print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>";
}
if ($_GET['d'] == '4') {
print"&bull;<A href='?act=luka&d=5'> Расскажи мне о себе. </A><BR>";
}
if ($_GET['d'] == '4') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '5') {
print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>";
}
if ($qwest != '1') {
if ($_GET['d'] == '5') {
print"&bull;<A href='?act=luka&d=6'> Может помочь чем? </A><BR>";
}
if ($qwest != '1' && $_GET['d'] == '5') {
print"&bull;<A href='?act=luka&d=6'> Может помочь чем? </A><BR>";
}
if ($_GET['d'] == '5') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
}
if ($_GET['d'] == '6') {
print"&bull;<A href='?act=luka&d=7'> Я помогу тебе... принесу я ключиик... жди! </A><BR>";
}
if ($_GET['d'] == '6') {
print"&bull;<A href='main.php?act=none'> Да ну тя сам разберайся.</A><BR>";
}
if ($_GET['d'] == '7') {
print"&bull;<A href='main.php?act=none'> Я, пойду.(конец диалога).</A><BR>";
}
print"</i><BR><BR>";
print"</i>";
?>
<BR><BR>
</TD>
<TD>
<?php
@@ -941,8 +801,5 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
<DIV ID="oMenu" style="position:absolute; border:1px solid #666; background-color:#CCC; display:none; "></DIV>
<TEXTAREA ID=holdtext STYLE="display:none;"></TEXTAREA>
</body>
</html>
<?
}
?>
}