Big cleaning.

This commit is contained in:
lopar 2018-12-13 01:37:27 +02:00
parent 9f0d0b540e
commit 03d07b0543
12 changed files with 21 additions and 245 deletions

View File

@ -1,6 +1,11 @@
<?
include "config.php";
include "functions.php";
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
require_once "../functions.php";
$id = mysql_query("SELECT * FROM `clans`");
$clans = mysql_num_rows($id);
$check = 0;

View File

@ -1,86 +0,0 @@
<?PHP
// Настройки
$SECURITY_IMAGE_TYPE = 'GIF'; // Возможные форматы: GIF, JPEG, PNG
$SECURITY_WIDTH = 130; // Ширина изображения
$SECURITY_HEIGHT = 30; // Высота изображения
$SECURITY_NUM_GENSIGN = 4; // Количество символов, которые нужно набрать
$EXT = strtoupper($_GET['ext']);
if($EXT == 'GIF' || $EXT == 'JPEG' || $EXT == 'PNG') $SECURITY_IMAGE_TYPE = $EXT;
if(is_numeric($_GET['width']) && $_GET['width']>100 && $_GET['width']<500) $SECURITY_WIDTH = $_GET['width'];
if(is_numeric($_GET['height']) && $_GET['height']>100 && $_GET['height']<500) $SECURITY_HEIGHT = $_GET['height'];
if(is_numeric($_GET['qty']) && $_GET['qty']>2 && $_GET['qty']<10) $SECURITY_NUM_GENSIGN = $_GET['qty'];
// Ядро
//session_register('securityCode');
$SECURITY_FONT_SIZE = intval($SECURITY_HEIGHT/(($SECURITY_HEIGHT/$SECURITY_WIDTH)*7));
$SECURITY_NUM_SIGN = intval(($SECURITY_WIDTH*$SECURITY_HEIGHT)/150);
$CODE = array();
$LETTERS = array('0','1','2','3','4','5','6','7','8','9');
$FIGURES = array('50','70','90','110','130','150','170','190','210');
// Создаем полотно
$src = imagecreatetruecolor($SECURITY_WIDTH,$SECURITY_HEIGHT);
// Заливаем фон
$fon = imagecolorallocate($src,255,255,255);
imagefill($src,0,0,$fon);
// Если папка шрифтов пуста
for($i = 0; $i<$SECURITY_NUM_GENSIGN; $i++)
{
// Ориентир
$h = 1;
// Рисуем
$color = imagecolorallocatealpha($src,$FIGURES[rand(0,sizeof($FIGURES)-1)],$FIGURES[rand(0,sizeof($FIGURES)-1)],$FIGURES[rand(0,sizeof($FIGURES)-1)],rand(10,30));
$letter = $LETTERS[rand(0,sizeof($LETTERS)-1)];
$x = (empty($x)) ? $SECURITY_WIDTH*0.1 : $x + ($SECURITY_WIDTH*0.8)/$SECURITY_NUM_GENSIGN+rand(0,$SECURITY_WIDTH*0.01);
$y = ($h == rand(1,2)) ? (($SECURITY_HEIGHT*1)/4) + rand(0,$SECURITY_HEIGHT*0.1) : (($SECURITY_HEIGHT*1)/4) - rand(0,$SECURITY_HEIGHT*0.1);
// Запоминаем
$CODE[] = $letter;
if($h == rand(0,10)) $letter = strtoupper($letter);
// Пишем
imagestring($src,9,$x,$y,$letter,$color);
}
// Получаем код
$_SESSION['securityCode'] = implode('',$CODE);
// Печать
if($SECURITY_IMAGE_TYPE == 'PNG')
{
header ("Content-type: image/png");
imagepng($src);
}
elseif($SECURITY_IMAGE_TYPE == 'JPEG')
{
header ("Content-type: image/jpeg");
imagejpeg($src);
}
else
{
header ("Content-type: image/gif");
imagegif($src);
}
imagedestroy($src);
?>

View File

@ -1 +0,0 @@
sebkru|oldbknet|welcombats|mycombats|vipbk|old-dark|recombats|legbk|febk|skycombats|cambats|zagad

17
top.php
View File

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<title>Рейтинги</title>
</head>
<body>
<a href="/"> на главную</a>
<?php if (!empty($error)): ?>
<h1><?php echo $error; ?></h1>
<?php else: ?>
<h1>Рейтинги</h1>
🏆 Ух ты, пусто! Будет интереснее после открытия!
<?php endif; ?>
</body>
</html>

View File

@ -12,27 +12,29 @@
div {
margin: 0 auto;
overflow: auto;
text-align: right;
}
a img {
a {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
padding: 5px;
}
a img:hover {
a:hover {
box-shadow: 0 0 7px slategray;
}
</style>
</HEAD>
<body>
<div style="text-align: right;">
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
<a href="/klan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
<a href="/orden.php" title="Особые умения" target="main"><img src="http://placehold.it/32x32/33ff33?text=O"/></a>
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
<div>
<a href="/user_anketa.php" title="Анкета" target="main">Анкета</a>
<a href="/friend.php" title="Друзья" target="main">Друзья</a>
<a href="/main.php?edit=1" title="Инвентарь" target="main">Инвентарь</a>
<a href="/relikt.php?edit=1" title="Реликты" target="main">Реликты</a>
<a href="/klan.php" title="Клан" target="main">Клан</a>
<a href="/orden.php" title="Особые умения" target="main">Особые умения</a>
<a href="/moderators.php" title="Модераторы" target="main">Модераторы</a>
<a href="/forum.php" title="Форум" target="main">Форум</a>
</div>
</body>
</html>

View File

@ -1,9 +1,6 @@
<?php
session_start();
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'on');
if (@$_SESSION['uid'] == null) header("Location: index.php");
include './config.php';
if ($_SESSION['uid'] == null) header("Location: index.php");
include "functions.php";
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = \''.$_SESSION['uid'].'\' LIMIT 1;'));
if ($user['battle'] != 0) { header('location: fbattle.php'); echo "jljkljkl"; die(); }

View File

@ -1,23 +0,0 @@
<html>
<head>
<title>Результат загрузки файла</title>
</head>
<body>
<?php
if($_FILES["filename"]["size"] > 1024*3*1024)
{
echo ("Размер файла превышает три мегабайта");
exit;
}
// Проверяем загружен ли файл
if(is_uploaded_file($_FILES["filename"]["tmp_name"]))
{
// Если файл загружен успешно, перемещаем его
// из временной директории в конечную
move_uploaded_file($_FILES["filename"]["tmp_name"], "/path/to/file/".$_FILES["filename"]["name"]);
} else {
echo("Ошибка загрузки файла");
}
?>
</body>
</html>

View File

@ -4,7 +4,6 @@ if (!isset($_SESSION['uid'])) {
header('Location: /index.php');
die();
}
include_once('config.php');
include_once('functions.php');
if ($user['battle'] > 0) {

View File

@ -1,23 +0,0 @@
<?
include('config.php');
if(isset($_GET['gift'])) {
if(isset($_GET['user'])) {
$us = mysql_real_escape_string($_GET['user']);
$lime = $_GET['lime']*15;
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '".$us."' AND (`name` LIKE '%Сувенир%' OR `name` LIKE '%Подарок%' OR `name` LIKE '%Валентинка%' OR `name` LIKE '%Открытка%' OR `name` LIKE 'Ель%' OR `name` LIKE '%Медаль%' OR `name` LIKE '%Статуэтка%') AND `present` != '' AND `cost` < 24 ORDER BY `id` DESC LIMIT $lime");
$cnt = mysql_query("SELECT `id` FROM `inventory` WHERE `owner` = '".$us."' AND (`name` LIKE '%Сувенир%' OR `name` LIKE '%Подарок%' OR `name` LIKE '%Валентинка%' OR `name` LIKE '%Открытка%' OR `name` LIKE 'Ель%' OR `name` LIKE '%Медаль%' OR `name` LIKE '%Статуэтка%') AND `present` != '' AND `cost` < 24");
if(mysql_num_rows($data)) { echo '<br />Сувениры : <br />'; }
$i = 0;
while($row = mysql_fetch_array($data)) {
$why_gift = mysql_fetch_assoc(mysql_query("SELECT `id` FROM `users` WHERE `login` = '".mysql_real_escape_string($row['present'])."' LIMIT 1"));
echo '<a href="inf.php?'.$why_gift['id'].'"><img src="i/sh/'.$row['img'].'" border="0" class=\'tooltip\' title="<b>'.$row['name'].'</b><br />Подарил: <b>'.$row['present'].'</b><br /><b class=\'txt\'>'.$row['letter'].'</b>" /></a>';
$i++;
}
if($i < mysql_num_rows($cnt)) {
echo '<br /><a href=\'javascript:void(0);\' id=\'showmore_gift\' value=\'1\'>Показать еще подарки</a>';
} else {
echo '<br /><b>Подарков больше нет</b>'.$cnt;
}
}
}

View File

@ -1,20 +0,0 @@
<html>
<head>
</head>
<body>
<h1>Активные игроки:</h1>
<?php
$online = mysql_query("SELECT u.login
FROM `online` o
JOIN `users` u ON o.id = u.id
WHERE `o`.`real_time` >= ".(time()-60).";");
while($v = mysql_fetch_array($online))
{
echo "<li>{$v[0]}</li>";
}
?>
</ol>
</body>
</html>

View File

@ -1,11 +0,0 @@
<HTML>
<HEAD>
<TITLE></TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-type>
</head>
<body>
<?php
?>
</body>
</htmL>

View File

@ -1,46 +0,0 @@
<?php
/* Отвязал от functions.php но так и не понял что этот файл делает.
* */
header("Content-Type: text/html; charset=utf-8");
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
//$user = mysql_fetch_array(mysql_query("SELECT `battle` FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$user = ($db->query('SELECT `battle` FROM `users` WHERE `id` = ?i LIMIT 1', $_SESSION['uid']))->fetch_assoc_array();
if ($user['battle'] != 0) {header('location: fbattle.php'); die();}
function addchp($text, $who, $room = 0)
{
global $user;
if ($room == 0) $room = $user['room'];
$fp = fopen("tmp/chat.txt", "a"); //открытие
flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА
fputs($fp, ":[" . time() . "]:[{$who}]:[" . ($text) . "]:[" . $room . "]\r\n"); //работа с файлом
fflush($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ
flock($fp, LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ
fclose($fp); //закрытие
}
/**
* FIXME Обращение к определённому персонажу в чате. Ещё сломается, если персонажа не существует.
* addchp('Сообщение об ошибке, <strong>' . $user['login'] . '', '{[]}' . nick::id(10133)->short() . '{[]}');
*/
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel=stylesheet href="css/main.css?v=1">
</head>
<body bgcolor=e2e0e0>
<p style="text-align: center;font-style: italic;">Сообщение отправлено!</p>
<script>
function cityg(){
location.href='main.php';
}
setTimeout('cityg()', 3000);
</script>
</body>
</html>