Прикручиваем шаблон. Хороним идиотские ошибки.

This commit is contained in:
Igor Barkov (iwork) 2020-09-30 15:58:44 +03:00
parent 733d1cf87b
commit 2f723e02b8
22 changed files with 44 additions and 42 deletions

View File

@ -1,6 +1,6 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
exit;
}
require_once "functions.php";

View File

@ -1,7 +1,7 @@
<?
session_start();
require_once('functions.php');
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
@ -21,8 +21,7 @@ function loadmap_cell()
{
global $forest;
$dat = unserialize($forest['data']);
$dat = ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']];
return $dat;
return ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']];
}
$map_user = loadmap_cell();
@ -73,33 +72,40 @@ if ($_GET['move'] == 'true') {
} else {
$error = 'Not in this life';
}
if (empty($error)) db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']);
if (empty($error)) {
db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']);
}
}
if ($map_user['Right'] == 1) $map_page = <<<MAP
if ($map_user['Right'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 20px; height: 117px;"
class="pngimg" src="i/forest/pointer_2.png" title="{$var_map['cell_' . ($forest['room_id'] + 1)]}"
onclick="location.href='?move=true&Dir=Right';"/>
onclick="location.href='?move=true&Dir=Right';" alt="Вправо">
MAP;
if ($map_user['Left'] == 1) $map_page = <<<MAP
}
if ($map_user['Left'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 20px; cursor: pointer; width: 20px; height: 117px; "
class="pngimg" src="i/forest/pointer_6.png" title="{$var_map['cell_' . ($forest['room_id'] - 1)]}"
onclick="location.href='?move=true&Dir=Left';"/>
onclick="location.href='?move=true&Dir=Left';" alt="Влево">
MAP;
if ($map_user['Down'] == 1) $map_page = <<<MAP
}
if ($map_user['Down'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 10px; left: 332px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_4.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Down';"/>
onclick="location.href='?move=true&Dir=Down';" alt="Вниз">
MAP;
if ($map_user['Up'] == 1) $map_page = <<<MAP
}
if ($map_user['Up'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_8.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Up';"/>
onclick="location.href='?move=true&Dir=Up';" alt="Вверх">
MAP;
}
Template::header('forest');
?>
<!doctype html>
<html lang="ru">
<head>
<title>forest</title>
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<style>
.bt {
@ -112,8 +118,6 @@ MAP;
margin-right: 18px;
}
</style>
</head>
<body>
<div id="ajaxContainer" style="display: none;"></div>
<div class="contentContainer">
<div class="buttonContainer">
@ -135,6 +139,4 @@ MAP;
<div style="position: relative; width: 780px; height: 350px; background-image: url('forest/<?= $forest['room'] ?>.jpg');">
<?= $map_page ?>
</div>
</div>
</body>
</html>
</div>

2
ch.php
View File

@ -1,6 +1,6 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}

View File

@ -1,7 +1,7 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}

View File

@ -1,7 +1,7 @@
<?php
ob_start("ob_gzhandler");
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}

View File

@ -1,6 +1,6 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { exit;}
if(empty($_SESSION['uid'])) { exit;}
require_once "functions.php";
if($user->room == 51) { header('location: city.php'); exit; }

View File

@ -6,7 +6,7 @@
*/
session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php");
//$msg = filter_input(INPUT_POST,'msg');

View File

@ -6,7 +6,7 @@
*/
session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php");
//$msg = filter_input(INPUT_POST,'msg');

View File

@ -1,6 +1,6 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { exit; }
if(empty($_SESSION['uid'])) { exit; }
require_once 'functions.php';
$error = '';

View File

@ -1,6 +1,6 @@
<?
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); exit; }
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; }
include('config.php');
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$_SESSION['uid'].'" LIMIT 1'));
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));

View File

@ -1,6 +1,6 @@
<?
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); exit; }
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; }
require_once "functions.php";
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$base = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160));

View File

@ -1,6 +1,6 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); exit; }
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; }
require_once "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));

View File

@ -1,7 +1,7 @@
<?php
ob_start("ob_gzhandler");
session_start();
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
if(empty($_SESSION['uid'])) { header("Location: index.php"); }
require_once "functions.php";
header("Cache-Control: no-cache");
$errkom = '';

View File

@ -1,7 +1,7 @@
<?php
ob_start("ob_gzhandler");
session_start();
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
if(empty($_SESSION['uid'])) { header("Location: index.php"); }
require_once "functions.php";
header("Cache-Control: no-cache");

View File

@ -1,6 +1,6 @@
<?php
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
if(empty($_SESSION['uid'])) { header("Location: index.php"); }
$tar = mysql_fetch_array(mysql_query("SELECT `id`, `align` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['ldnick'])."' LIMIT 1"));
$target = $_POST['ldnick'];

View File

@ -1,6 +1,6 @@
<?
session_start();
if(!isset($_SESSION['uid'])) { exit('Not access ...'); }
if(empty($_SESSION['uid'])) { exit('Not access ...'); }
$us = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['target']).'" LIMIT 1'));
if($user['align'] != 2.99) {

View File

@ -1,5 +1,5 @@
<?
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); exit; }
if(empty($_SESSION['uid'])) { header('Location: ../index.php'); exit; }
$us = mysql_fetch_array(mysql_query('SELECT `id`, `vip`, `vip_time`, `login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['target']).'" LIMIT 1'));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "'.$us['id'].'" LIMIT 1'));

View File

@ -6,7 +6,7 @@ if ($get === 'exit') {
session_destroy();
header("Location: fight.php");
}
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
}

View File

@ -1,6 +1,6 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header('Location: /index.php');
}
require_once 'functions.php';

View File

@ -1,6 +1,6 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
}
require_once "functions.php";

View File

@ -1,7 +1,7 @@
<?php
ob_start("ob_gzhandler");
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
}
require_once "functions.php";

View File

@ -1,6 +1,6 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { header("Location: index.php"); }
if(empty($_SESSION['uid'])) { header("Location: index.php"); }
require_once "functions.php";
$effect = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '{$user['id']}' LIMIT 1"));